e
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Annotation;
|
||||
|
||||
|
||||
use Exception;
|
||||
use HttpServer\IInterface\Task;
|
||||
use Http\IInterface\Task;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Annotation\Route;
|
||||
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\HttpFilter;
|
||||
use Http\HttpFilter;
|
||||
use ReflectionException;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
|
||||
@@ -5,11 +5,11 @@ namespace Annotation\Route;
|
||||
|
||||
|
||||
use Annotation\Attribute;
|
||||
use HttpServer\Route\MiddlewareManager;
|
||||
use Http\Route\MiddlewareManager;
|
||||
use ReflectionException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
use Http\IInterface\Middleware as IMiddleware;
|
||||
|
||||
/**
|
||||
* Class Middleware
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Annotation\Route;
|
||||
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\Route\Router;
|
||||
use Http\Route\Router;
|
||||
use Kiri\Kiri;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)] class Route extends Attribute
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Annotation\Route;
|
||||
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\Route\Router;
|
||||
use Http\Route\Router;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Command
|
||||
* @package HttpServer
|
||||
* @package Http
|
||||
*/
|
||||
class Command extends \Console\Command
|
||||
{
|
||||
|
||||
@@ -73,9 +73,9 @@ use Annotation\Route\Middleware;
|
||||
use Annotation\Route\Route;
|
||||
use Kiri\Core\Str;
|
||||
use Kiri\Core\Json;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\Controller;
|
||||
use Http\Http\Request;
|
||||
use Http\Http\Response;
|
||||
use Http\Controller;
|
||||
use JetBrains\PhpStorm\ArrayShape;
|
||||
use {$model_namespace}\\{$managerName};
|
||||
";
|
||||
|
||||
@@ -47,8 +47,8 @@ namespace App\Http\Interceptor;
|
||||
} else {
|
||||
$html .= '
|
||||
use Closure;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\IInterface\Interceptor;
|
||||
use Http\Http\Request;
|
||||
use Http\IInterface\Interceptor;
|
||||
';
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ class GiiLimits extends GiiBase
|
||||
namespace App\Http\Limits;
|
||||
|
||||
use Closure;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\IInterface\Limits;
|
||||
use Http\Http\Request;
|
||||
use Http\IInterface\Limits;
|
||||
|
||||
|
||||
';
|
||||
|
||||
@@ -33,8 +33,8 @@ class GiiMiddleware extends GiiBase
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
use Http\Http\Request;
|
||||
use Http\IInterface\Middleware;
|
||||
|
||||
';
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ namespace App\Http\Rpc;
|
||||
use Annotation\Route\RpcProducer;
|
||||
use Annotation\Target;
|
||||
use Exception;
|
||||
use HttpServer\Controller;
|
||||
use HttpServer\Exception\RequestException;
|
||||
use Http\Controller;
|
||||
use Http\Exception\RequestException;
|
||||
use Kiri\Core\Json;
|
||||
|
||||
';
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ class GiiTask extends GiiBase
|
||||
|
||||
namespace App\Async;
|
||||
|
||||
use HttpServer\IInterface\Task;
|
||||
use Http\IInterface\Task;
|
||||
|
||||
';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Kafka;
|
||||
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Server;
|
||||
use Http\Server;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Abstracts\Config as SConfig;
|
||||
use Kiri\Abstracts\Providers;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Server\Abstracts;
|
||||
|
||||
use Annotation\Inject;
|
||||
use HttpServer\Route\Router;
|
||||
use Http\Route\Router;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace Server\Constrict;
|
||||
|
||||
use HttpServer\Http\Context;
|
||||
use HttpServer\Http\Request as HttpResponse;
|
||||
use HttpServer\Http\Response;
|
||||
use Http\Http\Context;
|
||||
use Http\Http\Request as HttpResponse;
|
||||
use Http\Http\Response;
|
||||
use ReflectionException;
|
||||
use Server\RequestInterface;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
namespace Server\Constrict;
|
||||
|
||||
|
||||
use HttpServer\Http\Context;
|
||||
use HttpServer\Http\Response as HttpResponse;
|
||||
use Http\Http\Context;
|
||||
use Http\Http\Response as HttpResponse;
|
||||
use Server\ResponseInterface;
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Server\Constrict;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Http\Formatter\FileFormatter;
|
||||
use Http\Http\Formatter\FileFormatter;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use ReflectionException;
|
||||
use Server\ResponseInterface;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Server\Constrict;
|
||||
|
||||
use HttpServer\Http\Formatter\FileFormatter;
|
||||
use Http\Http\Formatter\FileFormatter;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Server\ResponseInterface;
|
||||
use Swoole\Server;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Server;
|
||||
|
||||
|
||||
use HttpServer\Http\Request;
|
||||
use Http\Http\Request;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Server;
|
||||
|
||||
|
||||
use HttpServer\Http\Response;
|
||||
use Http\Http\Response;
|
||||
|
||||
/**
|
||||
* @mixin Response
|
||||
|
||||
@@ -22,7 +22,7 @@ use Swoole\WebSocket\Server as WServer;
|
||||
|
||||
/**
|
||||
* Class OnServerManager
|
||||
* @package HttpServer\Service
|
||||
* @package Http\Service
|
||||
*/
|
||||
class ServerManager
|
||||
{
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace Server\Service;
|
||||
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Exception\RequestException;
|
||||
use HttpServer\Route\Node;
|
||||
use Http\Exception\RequestException;
|
||||
use Http\Route\Node;
|
||||
use Server\Events\OnAfterRequest;
|
||||
use Server\ResponseInterface;
|
||||
use Server\SInterface\OnClose;
|
||||
|
||||
@@ -13,13 +13,13 @@ namespace Kiri\Abstracts;
|
||||
use Annotation\Annotation as SAnnotation;
|
||||
use Database\Connection;
|
||||
use Exception;
|
||||
use HttpServer\Http\HttpHeaders;
|
||||
use HttpServer\Http\HttpParams;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\Route\Router;
|
||||
use HttpServer\Server;
|
||||
use HttpServer\Shutdown;
|
||||
use Http\Http\HttpHeaders;
|
||||
use Http\Http\HttpParams;
|
||||
use Http\Http\Request;
|
||||
use Http\Http\Response;
|
||||
use Http\Route\Router;
|
||||
use Http\Server;
|
||||
use Http\Shutdown;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Kafka\KafkaProvider;
|
||||
use Kiri\Aop;
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Kiri\Abstracts;
|
||||
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Exception\ExitException;
|
||||
use Http\Exception\ExitException;
|
||||
use Kiri\Core\Json;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,14 +6,14 @@ namespace Kiri\Abstracts;
|
||||
|
||||
use Annotation\Annotation as SAnnotation;
|
||||
use Database\DatabasesProviders;
|
||||
use HttpServer\Client\Client;
|
||||
use HttpServer\Client\Curl;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\HttpFilter;
|
||||
use HttpServer\Route\Router;
|
||||
use HttpServer\Server;
|
||||
use HttpServer\Shutdown;
|
||||
use Http\Client\Client;
|
||||
use Http\Client\Curl;
|
||||
use Http\Http\Request;
|
||||
use Http\Http\Response;
|
||||
use Http\HttpFilter;
|
||||
use Http\Route\Router;
|
||||
use Http\Server;
|
||||
use Http\Shutdown;
|
||||
use Kiri\Crontab\Producer;
|
||||
use Kiri\Async;
|
||||
use Kiri\Cache\Redis;
|
||||
|
||||
@@ -15,9 +15,9 @@ use Console\Console;
|
||||
use Console\ConsoleProviders;
|
||||
use Database\DatabasesProviders;
|
||||
use Exception;
|
||||
use HttpServer\Command;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\ServerProviders;
|
||||
use Http\Command;
|
||||
use Http\Http\Response;
|
||||
use Http\ServerProviders;
|
||||
use Kiri\Abstracts\BaseApplication;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Abstracts\Input;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ namespace Kiri;
|
||||
|
||||
|
||||
use Exception;
|
||||
use HttpServer\IInterface\Task;
|
||||
use Http\IInterface\Task;
|
||||
use ReflectionException;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Server\ServerManager;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Kiri\Cache\Base;
|
||||
|
||||
use HttpServer\Http\Context;
|
||||
use Http\Http\Context;
|
||||
use Kiri\Events\EventProvider;
|
||||
use Kiri\Exception\RedisConnectException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
@@ -10,7 +10,7 @@ declare(strict_types=1);
|
||||
namespace Kiri\Error;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
use Http\IInterface\IFormatter;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Events\EventDispatch;
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Kiri\Jwt;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
use Http\Http\Request;
|
||||
use Http\IInterface\Middleware;
|
||||
use Server\RequestInterface;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Kiri\Pool;
|
||||
use Closure;
|
||||
use Database\Mysql\PDO;
|
||||
use Exception;
|
||||
use HttpServer\Http\Context;
|
||||
use Http\Http\Context;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Error;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Kiri\Pool;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use HttpServer\Http\Context;
|
||||
use Http\Http\Context;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Exception\RedisConnectException;
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Kiri\\": "System/",
|
||||
"HttpServer\\": "HttpServer/",
|
||||
"Http\\": "http-helper/",
|
||||
"Server\\": "Server/",
|
||||
"Console\\": "Console/",
|
||||
"Gii\\": "Gii/",
|
||||
|
||||
+4
-4
@@ -4,10 +4,10 @@ defined('APP_PATH') or define('APP_PATH', realpath(__DIR__ . '/../../'));
|
||||
|
||||
|
||||
use Annotation\Annotation;
|
||||
use HttpServer\Http\Context;
|
||||
use HttpServer\Http\HttpParams;
|
||||
use HttpServer\Http\Response as HttpResponse;
|
||||
use HttpServer\Route\Router;
|
||||
use Http\Http\Context;
|
||||
use Http\Http\HttpParams;
|
||||
use Http\Http\Response as HttpResponse;
|
||||
use Http\Route\Router;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Aop;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Abstracts;
|
||||
namespace Http\Abstracts;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Abstracts;
|
||||
namespace Http\Abstracts;
|
||||
|
||||
|
||||
use Exception;
|
||||
@@ -11,7 +11,7 @@ use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class HttpService
|
||||
* @package HttpServer\Abstracts
|
||||
* @package Http\Abstracts
|
||||
*/
|
||||
abstract class HttpService extends Component
|
||||
{
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Client;
|
||||
namespace Http\Client;
|
||||
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace HttpServer\Client;
|
||||
namespace Http\Client;
|
||||
|
||||
|
||||
use Closure;
|
||||
@@ -15,7 +15,7 @@ defined('SPLIT_URL') or define('SPLIT_URL', '/(http[s]?:\/\/)?(([\w\-_]+\.)+\w+(
|
||||
|
||||
/**
|
||||
* Class ClientAbstracts
|
||||
* @package HttpServer\Client
|
||||
* @package Http\Client
|
||||
*/
|
||||
abstract class ClientAbstracts extends Component implements IClient
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Client;
|
||||
namespace Http\Client;
|
||||
|
||||
|
||||
use CurlHandle;
|
||||
@@ -11,7 +11,7 @@ use JetBrains\PhpStorm\Pure;
|
||||
|
||||
/**
|
||||
* Class Curl
|
||||
* @package HttpServer\Client
|
||||
* @package Http\Client
|
||||
*/
|
||||
class Curl extends ClientAbstracts
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace HttpServer\Client;
|
||||
namespace Http\Client;
|
||||
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
@@ -11,7 +11,7 @@ use Swoole\Coroutine;
|
||||
|
||||
/**
|
||||
* Class ClientDriver
|
||||
* @package HttpServer\Client
|
||||
* @package Http\Client
|
||||
* @mixin Client
|
||||
*/
|
||||
class HttpClient extends Component
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Client;
|
||||
namespace Http\Client;
|
||||
|
||||
use Exception;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace HttpServer\Client;
|
||||
namespace Http\Client;
|
||||
|
||||
|
||||
use Closure;
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Client;
|
||||
namespace Http\Client;
|
||||
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer;
|
||||
namespace Http;
|
||||
|
||||
|
||||
use Exception;
|
||||
@@ -11,7 +11,7 @@ use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Command
|
||||
* @package HttpServer
|
||||
* @package Http
|
||||
*/
|
||||
class Command extends \Console\Command
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer;
|
||||
namespace Http;
|
||||
|
||||
|
||||
use Annotation\Inject;
|
||||
@@ -6,7 +6,7 @@
|
||||
* Time: 10:14
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace HttpServer\Exception;
|
||||
namespace Http\Exception;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Exception;
|
||||
namespace Http\Exception;
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class ExitException
|
||||
* @package HttpServer\Exception
|
||||
* @package Http\Exception
|
||||
*/
|
||||
class ExitException extends \Exception
|
||||
{
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Exception;
|
||||
namespace Http\Exception;
|
||||
|
||||
|
||||
/**
|
||||
* Class RequestException
|
||||
* @package HttpServer\Exception
|
||||
* @package Http\Exception
|
||||
*/
|
||||
class RequestException extends \Exception
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace HttpServer\Http;
|
||||
namespace Http\Http;
|
||||
|
||||
use HttpServer\Abstracts\BaseContext;
|
||||
use Http\Abstracts\BaseContext;
|
||||
use Swoole\Coroutine;
|
||||
|
||||
/**
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Http;
|
||||
namespace Http\Http;
|
||||
|
||||
use Exception;
|
||||
use Kiri\Kiri;
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace HttpServer\Http\Formatter;
|
||||
namespace Http\Http\Formatter;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
use Http\Abstracts\HttpService;
|
||||
use Http\IInterface\IFormatter;
|
||||
use Swoole\Http\Response;
|
||||
|
||||
|
||||
+3
-3
@@ -7,14 +7,14 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Http\Formatter;
|
||||
namespace Http\Http\Formatter;
|
||||
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use Http\Abstracts\HttpService;
|
||||
use Kiri\Core\Json;
|
||||
use Swoole\Http\Response;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
use Http\IInterface\IFormatter;
|
||||
|
||||
/**
|
||||
* Class HtmlFormatter
|
||||
+3
-3
@@ -7,10 +7,10 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Http\Formatter;
|
||||
namespace Http\Http\Formatter;
|
||||
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
use Http\Abstracts\HttpService;
|
||||
use Http\IInterface\IFormatter;
|
||||
|
||||
/**
|
||||
* Class JsonFormatter
|
||||
+3
-3
@@ -7,14 +7,14 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Http\Formatter;
|
||||
namespace Http\Http\Formatter;
|
||||
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use Http\Abstracts\HttpService;
|
||||
use SimpleXMLElement;
|
||||
use Swoole\Http\Response;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
use Http\IInterface\IFormatter;
|
||||
|
||||
|
||||
/**
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Http;
|
||||
namespace Http\Http;
|
||||
|
||||
/**
|
||||
* Class HttpHeaders
|
||||
@@ -7,10 +7,10 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Http;
|
||||
namespace Http\Http;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Exception\RequestException;
|
||||
use Http\Exception\RequestException;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Core\Xml;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Http;
|
||||
namespace Http\Http;
|
||||
|
||||
use Annotation\Inject;
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use HttpServer\IInterface\AuthIdentity;
|
||||
use Http\Abstracts\HttpService;
|
||||
use Http\IInterface\AuthIdentity;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Server\RequestInterface;
|
||||
use Server\ServerManager;
|
||||
@@ -7,15 +7,15 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Http;
|
||||
namespace Http\Http;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use HttpServer\Http\Formatter\FileFormatter;
|
||||
use HttpServer\Http\Formatter\HtmlFormatter;
|
||||
use HttpServer\Http\Formatter\JsonFormatter;
|
||||
use HttpServer\Http\Formatter\XmlFormatter;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
use Http\Abstracts\HttpService;
|
||||
use Http\Http\Formatter\FileFormatter;
|
||||
use Http\Http\Formatter\HtmlFormatter;
|
||||
use Http\Http\Formatter\JsonFormatter;
|
||||
use Http\Http\Formatter\XmlFormatter;
|
||||
use Http\IInterface\IFormatter;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Server\ResponseInterface;
|
||||
use Server\ServerManager;
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace HttpServer;
|
||||
namespace Http;
|
||||
|
||||
|
||||
use Exception;
|
||||
@@ -10,7 +10,7 @@ use validator\Validator;
|
||||
|
||||
/**
|
||||
* Class HttpFilter
|
||||
* @package HttpServer\Http
|
||||
* @package Http\Http
|
||||
*/
|
||||
class HttpFilter extends BaseObject
|
||||
{
|
||||
@@ -35,20 +35,19 @@ class HttpFilter extends BaseObject
|
||||
/**
|
||||
* @param string $className
|
||||
* @param string $method
|
||||
* @return array|mixed
|
||||
* @return array
|
||||
*/
|
||||
public function getRules(string $className, string $method)
|
||||
public function getRules(string $className, string $method): array
|
||||
{
|
||||
return $this->hash[$className . '::' . $method] ?? [];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
* @param string $method
|
||||
* @return bool|Validator
|
||||
* @throws Exception
|
||||
*/
|
||||
/**
|
||||
* @param array $rules
|
||||
* @return bool|Validator
|
||||
* @throws Exception
|
||||
*/
|
||||
public function check(array $rules): bool|Validator
|
||||
{
|
||||
if (empty($rules)) {
|
||||
@@ -2,11 +2,11 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
use Closure;
|
||||
use HttpServer\Http\Request;
|
||||
use Http\Http\Request;
|
||||
|
||||
interface After
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
/**
|
||||
@@ -7,7 +7,7 @@ declare(strict_types=1);
|
||||
* Time: 17:29
|
||||
*/
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
/**
|
||||
@@ -2,10 +2,10 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
use HttpServer\Http\Request;
|
||||
use Http\Http\Request;
|
||||
use Closure;
|
||||
|
||||
interface Interceptor
|
||||
@@ -2,10 +2,10 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
use HttpServer\Http\Request;
|
||||
use Http\Http\Request;
|
||||
use Closure;
|
||||
|
||||
interface Limits
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
use Closure;
|
||||
use HttpServer\Http\Request;
|
||||
use Http\Http\Request;
|
||||
|
||||
/**
|
||||
* Interface IMiddleware
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
interface RouterInterface
|
||||
@@ -2,7 +2,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
interface Service
|
||||
@@ -2,7 +2,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\IInterface;
|
||||
namespace Http\IInterface;
|
||||
|
||||
|
||||
interface Task
|
||||
@@ -2,7 +2,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\Route;
|
||||
namespace Http\Route;
|
||||
|
||||
|
||||
/**
|
||||
@@ -2,15 +2,15 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\Route;
|
||||
namespace Http\Route;
|
||||
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use HttpServer\Http\Context;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
use Http\Http\Context;
|
||||
use Http\Http\Request;
|
||||
use Http\Http\Response;
|
||||
use Http\IInterface\Middleware;
|
||||
use Server\RequestInterface;
|
||||
use Kiri\Kiri;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace HttpServer\Route;
|
||||
namespace Http\Route;
|
||||
|
||||
use Kiri\Abstracts\BaseObject;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace HttpServer\Route;
|
||||
namespace Http\Route;
|
||||
|
||||
|
||||
use Closure;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
use Http\IInterface\Middleware;
|
||||
use Kiri\Abstracts\BaseObject;
|
||||
|
||||
|
||||
/**
|
||||
* Class MiddlewareManager
|
||||
* @package HttpServer\Route
|
||||
* @package Http\Route
|
||||
*/
|
||||
class MiddlewareManager extends BaseObject
|
||||
{
|
||||
@@ -2,14 +2,14 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace HttpServer\Route;
|
||||
namespace Http\Route;
|
||||
|
||||
|
||||
use Annotation\Aspect;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use HttpServer\Exception\RequestException;
|
||||
use HttpServer\Http\Request;
|
||||
use Http\Exception\RequestException;
|
||||
use Http\Http\Request;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use ReflectionException;
|
||||
use Server\Events\OnAfterWorkerStart;
|
||||
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Route;
|
||||
namespace Http\Route;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use HttpServer\Controller;
|
||||
use HttpServer\Exception\RequestException;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
use HttpServer\IInterface\RouterInterface;
|
||||
use Http\Abstracts\HttpService;
|
||||
use Http\Controller;
|
||||
use Http\Exception\RequestException;
|
||||
use Http\Http\Request;
|
||||
use Http\Http\Response;
|
||||
use Http\IInterface\Middleware;
|
||||
use Http\IInterface\RouterInterface;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use ReflectionException;
|
||||
use Server\RequestInterface;
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace HttpServer;
|
||||
namespace Http;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use Http\Abstracts\HttpService;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use ReflectionException;
|
||||
use Rpc\Service;
|
||||
@@ -23,7 +23,7 @@ defined('PID_PATH') or define('PID_PATH', APP_PATH . 'storage/server.pid');
|
||||
|
||||
/**
|
||||
* Class Server
|
||||
* @package HttpServer
|
||||
* @package Http
|
||||
*/
|
||||
class Server extends HttpService
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HttpServer;
|
||||
namespace Http;
|
||||
|
||||
|
||||
use Console\Console;
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace HttpServer;
|
||||
namespace Http;
|
||||
|
||||
|
||||
use Exception;
|
||||
@@ -11,7 +11,7 @@ use Kiri\Abstracts\Component;
|
||||
|
||||
/**
|
||||
* Class Shutdown
|
||||
* @package HttpServer
|
||||
* @package Http
|
||||
*/
|
||||
class Shutdown extends Component
|
||||
{
|
||||
@@ -1,220 +1,22 @@
|
||||
<?php
|
||||
$A_DEFAULT = [
|
||||
'Source' => '',
|
||||
'Package' => '',
|
||||
'Path' => '',
|
||||
'Content-Type' => '',
|
||||
'Method' => ''
|
||||
];
|
||||
$A_DEFAULT_1 = [
|
||||
'REQUEST tcp/other.protocol v1.0',
|
||||
'Source' => '127.0.0.1, 134.43.54.64',
|
||||
'Package' => 'qat',
|
||||
'Path' => 'getUserDetail',
|
||||
'Content-Type' => 'application/json',
|
||||
'Method' => 'rpcRequest',
|
||||
'Meth21131od' => 'rpcRequest',
|
||||
'Met231hod' => 'rpcRequest',
|
||||
'Meth1231od' => 'rpcRequest',
|
||||
'Meth12312od' => 'rpcRequest',
|
||||
];
|
||||
|
||||
//
|
||||
//ini_set('memory_limit', '3096M');
|
||||
//
|
||||
//use Snowflake\Application;
|
||||
//
|
||||
//require_once __DIR__ . '/vendor/autoload.php';
|
||||
//
|
||||
//\Swoole\Coroutine\run(function (){
|
||||
// $client = HttpServer\Client\Client::NewRequest();
|
||||
// $client->setHost('47.92.194.207');
|
||||
// $client->setPort(9528);
|
||||
// $client->setErrorField('code');
|
||||
// $client->setErrorMsgField('message');
|
||||
// var_dump($client->sendTo('', [],SWOOLE_UDP));
|
||||
//
|
||||
// $client = HttpServer\Client\Client::NewRequest();
|
||||
// $client->setHost('47.92.194.207');
|
||||
// $client->setPort(9529);
|
||||
// $client->setErrorField('code');
|
||||
// $client->setErrorMsgField('message');
|
||||
// var_dump($client->sendTo('', [],SWOOLE_TCP));
|
||||
//
|
||||
// $client = HttpServer\Client\Client::NewRequest();
|
||||
// $client->setHost('47.92.194.207');
|
||||
// $client->setPort(9529);
|
||||
// $client->setTimeout(1);
|
||||
// $client->setUseSwoole(1);
|
||||
// $client->setErrorField('code');
|
||||
// $client->setErrorMsgField('message');
|
||||
// var_dump($client->send('', []));
|
||||
//});
|
||||
//$mail = new \PHPMailer\PHPMailer\PHPMailer(true);
|
||||
|
||||
//try {
|
||||
// //Server settings
|
||||
// $mail->SMTPDebug = \PHPMailer\PHPMailer\SMTP::DEBUG_SERVER; // Enable verbose debug output
|
||||
// $mail->isSMTP(); // Send using SMTP
|
||||
// $mail->Host = 'smtp1.example.com'; // Set the SMTP server to send through
|
||||
// $mail->SMTPAuth = true; // Enable SMTP authentication
|
||||
// $mail->Username = 'user@example.com'; // SMTP username
|
||||
// $mail->Password = 'secret'; // SMTP password
|
||||
// $mail->SMTPSecure = \PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
|
||||
// $mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
|
||||
//
|
||||
// //Recipients
|
||||
// $mail->setFrom('from@example.com', 'Mailer');
|
||||
// $mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
|
||||
// $mail->addAddress('ellen@example.com'); // Name is optional
|
||||
// $mail->addReplyTo('info@example.com', 'Information');
|
||||
// $mail->addCC('cc@example.com');
|
||||
// $mail->addBCC('bcc@example.com');
|
||||
//
|
||||
// // Attachments
|
||||
// $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
|
||||
// $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
|
||||
//
|
||||
// // Content
|
||||
// $mail->isHTML(true); // Set email format to HTML
|
||||
// $mail->Subject = 'Here is the subject';
|
||||
// $mail->Body = 'This is the HTML message body <b>in bold!</b>';
|
||||
// $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
|
||||
//
|
||||
// $mail->send();
|
||||
// echo 'Message has been sent';
|
||||
//} catch (Exception $e) {
|
||||
// echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
//}
|
||||
|
||||
|
||||
//var_dump((bool)null);
|
||||
//var_dump((bool)0);
|
||||
//var_dump((bool)1);
|
||||
//var_dump((bool)false);
|
||||
//var_dump((bool)true);
|
||||
//var_dump((bool)"true");
|
||||
//var_dump((bool)"false");
|
||||
//var_dump((bool)"0");
|
||||
//var_dump((bool)"1");
|
||||
//var_dump((bool)"健康好几个地方就");
|
||||
//var_dump((bool)"lkdjfkgjdflk");
|
||||
|
||||
|
||||
//class Qa
|
||||
//{
|
||||
// public $method = 'aad';
|
||||
//
|
||||
//
|
||||
// public function clone()
|
||||
// {
|
||||
// return new static();
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
//
|
||||
//$qa = new Qa();
|
||||
//var_dump($qa->method);
|
||||
//$qa->method = 'bbd';
|
||||
//var_dump($qa->method);
|
||||
//
|
||||
//$new = $qa->clone();
|
||||
//var_dump($new);
|
||||
//$new->method = 'ttd';
|
||||
//var_dump($new, $qa);
|
||||
//
|
||||
|
||||
//$explode = explode('/', '/header/<cate:\d+>/<page:\d+>/<size:\d+>/<index:\d+>');
|
||||
//
|
||||
//$match = preg_replace_callback('/\d+/', function ($match) {
|
||||
// return '<*:\d+>';
|
||||
//}, '/header/123/3242353/435345435/123123');
|
||||
//
|
||||
//var_dump($match);
|
||||
//
|
||||
//
|
||||
//
|
||||
//class Arrays extends ArrayIterator
|
||||
//{
|
||||
//
|
||||
//
|
||||
// public function __construct($array = array(), $flags = 0)
|
||||
// {
|
||||
// parent::__construct($array, $flags);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public function current()
|
||||
// {
|
||||
// $parent = parent::current();
|
||||
// $class = new stdClass();
|
||||
// $class->value = $parent;
|
||||
// $class->key = $this->key();
|
||||
//
|
||||
// return $class;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public function next()
|
||||
// {
|
||||
// $this->offsetSet($this->key(), new stdClass());
|
||||
//
|
||||
//
|
||||
// parent::next();
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
//
|
||||
//
|
||||
//class ETa implements \IteratorAggregate
|
||||
//{
|
||||
//
|
||||
// public $array = [];
|
||||
//
|
||||
//
|
||||
// public function getIterator()
|
||||
// {
|
||||
// return new Arrays($this->array);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
//
|
||||
//
|
||||
//$eta = new ETa();
|
||||
//$eta->array = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
|
||||
//
|
||||
//
|
||||
//foreach ($eta as $value) {
|
||||
// var_dump($value);
|
||||
//}
|
||||
|
||||
//exec('ps -ef 15132 | grep 15132', $output);
|
||||
//var_dump($output);
|
||||
|
||||
//
|
||||
//Swoole\Coroutine::create(function () {
|
||||
// var_dump(\Swoole\Coroutine::getCid());
|
||||
////
|
||||
//// Swoole\Coroutine::create(function () {
|
||||
//// var_dump(\Swoole\Coroutine::getPcid());
|
||||
//// Swoole\Coroutine::create(function () {
|
||||
//// var_dump(\Swoole\Coroutine::getPcid());
|
||||
//// Swoole\Coroutine::create(function () {
|
||||
//// var_dump(\Swoole\Coroutine::getPcid());
|
||||
//// Swoole\Coroutine::create(function () {
|
||||
//// var_dump(\Swoole\Coroutine::getPcid());
|
||||
//// });
|
||||
//// });
|
||||
//// });
|
||||
//// });
|
||||
// Swoole\Coroutine::create(function () {
|
||||
// var_dump(\Swoole\Coroutine::getPcid());
|
||||
// });
|
||||
// Swoole\Coroutine::create(function () {
|
||||
// var_dump(\Swoole\Coroutine::getPcid());
|
||||
// });
|
||||
// Swoole\Coroutine::create(function () {
|
||||
// var_dump(\Swoole\Coroutine::getPcid());
|
||||
// });
|
||||
//});
|
||||
|
||||
|
||||
Swoole\Coroutine::create(function () {
|
||||
|
||||
class b
|
||||
{
|
||||
public function et()
|
||||
{
|
||||
var_dump(\Swoole\Coroutine::getPcid(), microtime(true));
|
||||
\Swoole\Coroutine::sleep(0.01);
|
||||
}
|
||||
}
|
||||
|
||||
for ($a = 0; $a < 10; $a++) {
|
||||
Swoole\Coroutine::create([new b(), 'et']);
|
||||
}
|
||||
});
|
||||
var_dump(array_diff_key($A_DEFAULT, $A_DEFAULT_1));
|
||||
|
||||
+3
-1
@@ -39,13 +39,15 @@
|
||||
}
|
||||
|
||||
function connect() {
|
||||
sock = new WebSocket('ws://47.92.194.207:9530?token=de5cfdf897-e2f-65de-b5686aca2-5575fe&access_token='+encodeURIComponent('ZgHcxCzVuV7kKQsf/j07N5J7BnC1VE5sS32/07utoibiLHLBXLa9htX3LMsik2DY2w0n+MUibQayG0diedcD8g==')+'&iv=iv340f0be2Fx0VvP');
|
||||
sock = new WebSocket('ws://47.92.194.207:9528/socket?auth='+encodeURIComponent('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJhcHBsaWNhdGlvbjFfNjEwMzc2ZTU2MTRhMTkuNTk0ODM5NzEiLCJpYXQiOjE2Mjc2MTY5OTcsIm5iZiI6MTYyNzYxNjk5NywiZXhwIjoxODg2ODE2OTk3LCJ1aWQiOjUxMCwibmlja25hbWUiOiJvcGVuaWQiLCJqd3Rfc2NlbmUiOiJhcHBsaWNhdGlvbjEifQ.B7zqH0WJklZVN0acER3tmc9S08WoK-aucJ1MghnunuE'),
|
||||
['test', 'asdasdkjfgghdfgjdfgdfg12343', 'm-chat']);
|
||||
sock.onopen = function () {
|
||||
if (tick) {
|
||||
clearInterval(tick)
|
||||
}
|
||||
tick = setInterval(function () {
|
||||
sock.send(JSON.stringify({'route': 'getUserPosition', 'tick': new Date().getTime()}));
|
||||
// sock.close(4000);
|
||||
}, 3000)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
|
||||
$str = '{"datacenter":"tencent-datacenter","data_dir":"/root/consul/data","log_file":"/root/consul/log/","log_level":"INFO","bind_addr":"0.0.0.0","client_addr":"0.0.0.0","node_name":"tencent-node","ui":true,"bootstrap_expect":1,"server":true,"acl":{"enabled":true,"default_policy":"deny","enable_token_persistence":true,"enable_key_list_policy":true}}';
|
||||
|
||||
//ini_set('memory_limit','3096M');
|
||||
//
|
||||
//use Snowflake\Application;
|
||||
@@ -8,7 +10,7 @@
|
||||
//require_once __DIR__ . '/vendor/autoload.php';
|
||||
//$config = array_merge(
|
||||
// require_once __DIR__ . '/System/Process/config.php',
|
||||
// require_once __DIR__ . '/HttpServer/config.php'
|
||||
// require_once __DIR__ . '/Http/config.php'
|
||||
//);
|
||||
//
|
||||
//$application = new Application($config);
|
||||
@@ -25,12 +27,12 @@
|
||||
|
||||
|
||||
//require_once __DIR__ . '/function.php';
|
||||
//require_once __DIR__ . '/HttpServer/Client/Result.php';
|
||||
//require_once __DIR__ . '/HttpServer/Client/HttpParse.php';
|
||||
//require_once __DIR__ . '/HttpServer/Client/Curl.php';
|
||||
//require_once __DIR__ . '/Http/Client/Result.php';
|
||||
//require_once __DIR__ . '/Http/Client/HttpParse.php';
|
||||
//require_once __DIR__ . '/Http/Client/Curl.php';
|
||||
//
|
||||
//\Swoole\Coroutine::create(function () {
|
||||
// $curl = \HttpServer\Client\Curl::NewRequest();
|
||||
// $curl = \Http\Client\Curl::NewRequest();
|
||||
//// $curl->setCallback(function ($body) {
|
||||
//// return $body;
|
||||
//// });
|
||||
@@ -121,18 +123,49 @@
|
||||
// unset($class);
|
||||
// }
|
||||
//);
|
||||
////
|
||||
////
|
||||
//
|
||||
//
|
||||
//error_reporting(E_ALL);
|
||||
//
|
||||
//$a['hello'] = base64_encode(random_bytes(1000));
|
||||
//$a['world'] = 'hello';
|
||||
//$a['int'] = rand(1, 999999);
|
||||
//$a['list'] = ['a,', 'b', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'];
|
||||
//
|
||||
//$val = serialize($a);
|
||||
//$str = pack('N', strlen($val)) . $val . "\r\n";
|
||||
//
|
||||
//var_dump(swoole_substr_unserialize($val, strlen($val)));
|
||||
//
|
||||
//var_dump($str, unpack('N', pack('N', strlen($val))));
|
||||
|
||||
//var_dump( openssl_get_cipher_methods());
|
||||
foreach (openssl_get_cipher_methods() as $openssl_get_cipher_method) {
|
||||
|
||||
$iv = '';
|
||||
|
||||
if (openssl_cipher_iv_length($openssl_get_cipher_method) > 0) {
|
||||
continue;
|
||||
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($openssl_get_cipher_method));
|
||||
}
|
||||
|
||||
$tag = '';
|
||||
|
||||
$result = openssl_encrypt(json_encode([
|
||||
'time' => microtime(),
|
||||
'scene' => 'application',
|
||||
'ot' => 1
|
||||
]), $openssl_get_cipher_method, "xl.zhuangb123.com", 0, $iv, $tag);
|
||||
|
||||
|
||||
error_reporting(E_ALL);
|
||||
echo $openssl_get_cipher_method . ',';
|
||||
|
||||
$a['hello'] = base64_encode(random_bytes(1000));
|
||||
$a['world'] = 'hello';
|
||||
$a['int'] = rand(1, 999999);
|
||||
$a['list'] = ['a,', 'b', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'];
|
||||
// if ($result != false) {
|
||||
// echo str_pad($openssl_get_cipher_method, 30, ' ', STR_PAD_RIGHT) . '=> ' . str_replace('=', '', $result) . PHP_EOL;
|
||||
// echo str_pad($openssl_get_cipher_method, 30, ' ', STR_PAD_RIGHT) . '=> ' . openssl_decrypt(str_replace('=', '', $result),
|
||||
// $openssl_get_cipher_method, "xl.zhuangb123.com", 0, $iv, $tag) . PHP_EOL;
|
||||
// }
|
||||
}
|
||||
|
||||
$val = serialize($a);
|
||||
$str = pack('N', strlen($val)) . $val . "\r\n";
|
||||
|
||||
var_dump($str, pack('N', strlen($val)));
|
||||
|
||||
Reference in New Issue
Block a user