diff --git a/app/controller/UserController.php b/app/controller/UserController.php index 8f07477..6e7df7a 100644 --- a/app/controller/UserController.php +++ b/app/controller/UserController.php @@ -14,7 +14,11 @@ use Core\http\Response; use Core\init\MyDB; use Core\init\RedisHelper; use DI\Attribute\Inject; - +use Hyperf\Database\Connection; +use Mockery; +use \PDO; +use Hyperf\Database\Query\Grammars\MySqlGrammar; +use Core\BeanFactory; /** * @Bean() */ @@ -38,6 +42,11 @@ class UserController */ public function test() { + ///$connection = new Connection(PDO::class); + ///$connection = $connection->setQueryGrammar(new MySqlGrammar()); + ///$sql = $connection->table('eb_user')->toSql(); + // var_dump($connection->query($sql)); + //var_dump($user); //$this->db->select('select sleep(1)'); //User::query('select sleep(3)'); $user = User::first(); @@ -49,6 +58,7 @@ class UserController */ public function user(int $uid, Request $request, Response $response) { + //BeanFactory::getBean(''); //$user = $this->db->select('select * from eb_user where id = 1'); return ['code' => 1, 'uid' => $uid]; } diff --git a/boot.php b/boot.php index 896aee1..ab12c9f 100644 --- a/boot.php +++ b/boot.php @@ -2,13 +2,13 @@ require_once __DIR__ . '/vendor/autoload.php'; require_once __DIR__ . "/app/config/define.php"; \Swoole\Runtime::enableCoroutine(true); - +// command swoole-cli boot.php start use Swoole\Process; - +use Core\server\HttpServer; if ($argc == 2) { $cmd = $argv[1]; if ($cmd == 'start') { - $http = new Core\server\HttpServer('first'); + $http = new HttpServer(); $http->run(); } else if ($cmd == 'stop') { $getpid = intval(file_get_contents("./Buddha.pid")); //获取上一次程序运行的 master_id @@ -21,7 +21,7 @@ if ($argc == 2) { if ($getpid && trim($getpid) != 0) { Process::kill($getpid); sleep(1); - $http = new Core\server\HttpServer('first'); + $http = new Core\server\HttpServer(); echo "restart done" . PHP_EOL; $http->run(); } else { diff --git a/common/functions.php b/common/functions.php new file mode 100644 index 0000000..64a7597 --- /dev/null +++ b/common/functions.php @@ -0,0 +1,14 @@ +=8.1" + }, + "suggest": { + "jean85/pretty-package-versions": "Required to use PrettyVersions. (^1.2|^2.0)", + "nikic/php-parser": "Required to use PhpParser. (^4.0)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\CodeParser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A code parser component for Hyperf.", + "homepage": "https://hyperf.io", + "keywords": [ + "code-parser", + "hyperf", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/codec", + "version": "v3.1.15", + "source": { + "type": "git", + "url": "https://github.com/hyperf/codec.git", + "reference": "198c364ad8eadda13f1a0decdbb9221ac9c4c260" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/codec/zipball/198c364ad8eadda13f1a0decdbb9221ac9c4c260", + "reference": "198c364ad8eadda13f1a0decdbb9221ac9c4c260", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-xml": "*", + "hyperf/contract": "~3.1.0", + "php": ">=8.1" + }, + "suggest": { + "ext-igbinary": "Required to use IgbinarySerializerPacker." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\Codec\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A codec component for Hyperf.", + "homepage": "https://hyperf.io", + "keywords": [ + "codec", + "hyperf", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/collection", + "version": "v3.1.22", + "source": { + "type": "git", + "url": "https://github.com/hyperf/collection.git", + "reference": "6695a970edb4c97694d9f885c4389da6c02a4972" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/collection/zipball/6695a970edb4c97694d9f885c4389da6c02a4972", + "reference": "6695a970edb4c97694d9f885c4389da6c02a4972", + "shasum": "" + }, + "require": { + "hyperf/contract": "~3.1.0", + "hyperf/macroable": "~3.1.0", + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Hyperf\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hyperf Collection package which come from illuminate/collections", + "homepage": "https://hyperf.io", + "keywords": [ + "collection", + "hyperf", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-05-15T02:56:30+00:00" + }, + { + "name": "hyperf/conditionable", + "version": "v3.1.15", + "source": { + "type": "git", + "url": "https://github.com/hyperf/conditionable.git", + "reference": "2c1555891d136904b890ba6d812d9ff50ca13ae3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/conditionable/zipball/2c1555891d136904b890ba6d812d9ff50ca13ae3", + "reference": "2c1555891d136904b890ba6d812d9ff50ca13ae3", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\Conditionable\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hyperf Macroable package which come from illuminate/conditionable", + "homepage": "https://hyperf.io", + "keywords": [ + "conditionable", + "hyperf", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/context", + "version": "v3.1.15", + "source": { + "type": "git", + "url": "https://github.com/hyperf/context.git", + "reference": "ad913fd50eb5f738c038e172c120bc6956c0da69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/context/zipball/ad913fd50eb5f738c038e172c120bc6956c0da69", + "reference": "ad913fd50eb5f738c038e172c120bc6956c0da69", + "shasum": "" + }, + "require": { + "hyperf/engine": "^2.0", + "php": ">=8.1" + }, + "suggest": { + "swow/psr7-plus": "Required to use RequestContext and ResponseContext" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\Context\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A coroutine/application context library.", + "homepage": "https://hyperf.io", + "keywords": [ + "Context", + "hyperf", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/contract", + "version": "v3.1.15", + "source": { + "type": "git", + "url": "https://github.com/hyperf/contract.git", + "reference": "9950abe963cc6b30c6d3506fa5b3adbd58cb1945" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/contract/zipball/9950abe963cc6b30c6d3506fa5b3adbd58cb1945", + "reference": "9950abe963cc6b30c6d3506fa5b3adbd58cb1945", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\Contract\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The contracts of Hyperf.", + "homepage": "https://hyperf.io", + "keywords": [ + "hyperf", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/coordinator", + "version": "v3.1.21", + "source": { + "type": "git", + "url": "https://github.com/hyperf/coordinator.git", + "reference": "caf5a70f96b7f22950e1caa3ba74f72c8382493c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/coordinator/zipball/caf5a70f96b7f22950e1caa3ba74f72c8382493c", + "reference": "caf5a70f96b7f22950e1caa3ba74f72c8382493c", + "shasum": "" + }, + "require": { + "hyperf/engine": "^2.0", + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Hyperf\\Coordinator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hyperf Coordinator", + "homepage": "https://hyperf.io", + "keywords": [ + "Coordinator", + "hyperf", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-05-09T02:35:08+00:00" + }, + { + "name": "hyperf/coroutine", + "version": "v3.1.15", + "source": { + "type": "git", + "url": "https://github.com/hyperf/coroutine.git", + "reference": "8f4c573a9457646db3e629dacabe064eebaf8cc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/coroutine/zipball/8f4c573a9457646db3e629dacabe064eebaf8cc1", + "reference": "8f4c573a9457646db3e629dacabe064eebaf8cc1", + "shasum": "" + }, + "require": { + "hyperf/context": "~3.1.0", + "hyperf/contract": "~3.1.0", + "hyperf/engine": "^2.0", + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Hyperf\\Coroutine\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hyperf Coroutine", + "homepage": "https://hyperf.io", + "keywords": [ + "coroutine", + "hyperf", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/database", + "version": "v3.1.22", + "source": { + "type": "git", + "url": "https://github.com/hyperf/database.git", + "reference": "27de4bfb9fa5eaf13550c0e48512813281efbe44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/database/zipball/27de4bfb9fa5eaf13550c0e48512813281efbe44", + "reference": "27de4bfb9fa5eaf13550c0e48512813281efbe44", + "shasum": "" + }, + "require": { + "hyperf/code-parser": "~3.1.0", + "hyperf/collection": "~3.1.0", + "hyperf/macroable": "~3.1.0", + "hyperf/support": "~3.1.0", + "hyperf/tappable": "~3.1.0", + "hyperf/utils": "~3.1.0", + "nesbot/carbon": "^2.0", + "php": ">=8.1", + "psr/container": "^1.0|^2.0", + "psr/event-dispatcher": "^1.0" + }, + "suggest": { + "doctrine/dbal": "Required to rename columns (^3.0).", + "nikic/php-parser": "Required to use ModelCommand. (^4.0)", + "php-di/phpdoc-reader": "Required to use ModelCommand. (^2.2)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\Database\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A flexible database library.", + "homepage": "https://hyperf.io", + "keywords": [ + "database", + "hyperf", + "php" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-05-15T06:32:41+00:00" + }, + { + "name": "hyperf/engine", + "version": "v2.11.0", + "source": { + "type": "git", + "url": "https://github.com/hyperf/engine.git", + "reference": "26e0b65fc2a63a00266e7124e221c6f3fb2c8e95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/engine/zipball/26e0b65fc2a63a00266e7124e221c6f3fb2c8e95", + "reference": "26e0b65fc2a63a00266e7124e221c6f3fb2c8e95", + "shasum": "" + }, + "require": { + "hyperf/engine-contract": "~1.10.0", + "php": ">=8.0" + }, + "conflict": { + "ext-swoole": "<5.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.0", + "hyperf/guzzle": "^3.0", + "hyperf/http-message": "^3.0", + "mockery/mockery": "^1.5", + "phpstan/phpstan": "^1.0", + "phpunit/phpunit": "^9.4", + "swoole/ide-helper": "5.*" + }, + "suggest": { + "ext-sockets": "*", + "ext-swoole": ">=5.0", + "hyperf/http-message": "Required to use ResponseEmitter.", + "psr/http-message": "Required to use WebSocket Frame." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.11-dev" + }, + "hyperf": { + "config": "Hyperf\\Engine\\ConfigProvider" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Hyperf\\Engine\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Coroutine engine provided by swoole.", + "keywords": [ + "engine", + "hyperf", + "php", + "swoole" + ], + "support": { + "issues": "https://github.com/hyperf/engine/issues", + "source": "https://github.com/hyperf/engine/tree/v2.11.0" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-04-17T13:36:28+00:00" + }, + { + "name": "hyperf/engine-contract", + "version": "v1.10.1", + "source": { + "type": "git", + "url": "https://github.com/hyperf/engine-contract.git", + "reference": "2714a8ba6d6b916e5bd373ff680df9569a4c9eef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/engine-contract/zipball/2714a8ba6d6b916e5bd373ff680df9569a4c9eef", + "reference": "2714a8ba6d6b916e5bd373ff680df9569a4c9eef", + "shasum": "" + }, + "require": { + "php": ">=8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.0", + "mockery/mockery": "^1.0", + "phpstan/phpstan": "^1.0", + "phpunit/phpunit": ">=7.0", + "psr/http-message": "^1.0", + "swoole/ide-helper": "^4.5" + }, + "suggest": { + "psr/http-message": "Required to use WebSocket Frame." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\Engine\\Contract\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Contract for Coroutine Engine", + "keywords": [ + "contract", + "coroutine", + "engine", + "hyperf", + "php" + ], + "support": { + "issues": "https://github.com/hyperf/engine-contract/issues", + "source": "https://github.com/hyperf/engine-contract/tree/v1.10.1" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-04-17T13:34:51+00:00" + }, + { + "name": "hyperf/macroable", + "version": "v3.1.15", + "source": { + "type": "git", + "url": "https://github.com/hyperf/macroable.git", + "reference": "8912b5de69d25451b8ca103e4e47f0935e81072b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/macroable/zipball/8912b5de69d25451b8ca103e4e47f0935e81072b", + "reference": "8912b5de69d25451b8ca103e4e47f0935e81072b", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\Macroable\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hyperf Macroable package which come from illuminate/macroable", + "homepage": "https://hyperf.io", + "keywords": [ + "hyperf", + "macroable", + "php", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/serializer", + "version": "v3.1.22", + "source": { + "type": "git", + "url": "https://github.com/hyperf/serializer.git", + "reference": "48cdd2ec51d95b813c9d6f83089525593f465546" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/serializer/zipball/48cdd2ec51d95b813c9d6f83089525593f465546", + "reference": "48cdd2ec51d95b813c9d6f83089525593f465546", + "shasum": "" + }, + "require": { + "hyperf/contract": "~3.1.0", + "php": ">=8.1" + }, + "suggest": { + "hyperf/di": "Required to use ExceptionNormalizer", + "symfony/property-access": "Required to use SymfonyNormalizer (^5.0|^6.0)", + "symfony/serializer": "Required to use SymfonyNormalizer (^5.0|^6.0)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + }, + "hyperf": { + "config": "Hyperf\\Serializer\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Hyperf\\Serializer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A serializer component for Hyperf.", + "homepage": "https://hyperf.io", + "keywords": [ + "hyperf", + "php", + "swoole", + "tappable" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-05-15T05:22:10+00:00" + }, + { + "name": "hyperf/stringable", + "version": "v3.1.20", + "source": { + "type": "git", + "url": "https://github.com/hyperf/stringable.git", + "reference": "71e5e5c2cb0cb4bb155805b581c93167211eb6b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/stringable/zipball/71e5e5c2cb0cb4bb155805b581c93167211eb6b2", + "reference": "71e5e5c2cb0cb4bb155805b581c93167211eb6b2", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "hyperf/collection": "~3.1.0", + "hyperf/conditionable": "~3.1.0", + "hyperf/macroable": "~3.1.0", + "hyperf/tappable": "~3.1.0", + "php": ">=8.1" + }, + "suggest": { + "doctrine/inflector": "Required to use plural and singular methods.(^2.0|^3.0)", + "ramsey/uuid": "Required to use uuid and orderedUuid methods.(^4.7|^5.0)", + "symfony/uid": "Required to use ulid method.(^5.0|^6.0)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Hyperf\\Stringable\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hyperf Stringable package which come from illuminate/support", + "homepage": "https://hyperf.io", + "keywords": [ + "hyperf", + "php", + "stringable", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-04-19T02:30:51+00:00" + }, + { + "name": "hyperf/support", + "version": "v3.1.15", + "source": { + "type": "git", + "url": "https://github.com/hyperf/support.git", + "reference": "3fb5c6c5a4f795cb0304a032f6f5b85f62a5f872" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/support/zipball/3fb5c6c5a4f795cb0304a032f6f5b85f62a5f872", + "reference": "3fb5c6c5a4f795cb0304a032f6f5b85f62a5f872", + "shasum": "" + }, + "require": { + "hyperf/collection": "~3.1.0", + "hyperf/context": "~3.1.0", + "hyperf/contract": "~3.1.0", + "hyperf/coroutine": "~3.1.0", + "hyperf/macroable": "~3.1.0", + "hyperf/stringable": "~3.1.0", + "php": ">=8.1" + }, + "suggest": { + "nesbot/carbon": "Use Carbon as DateTime object.(^2.0)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Hyperf\\Support\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A support component for Hyperf.", + "homepage": "https://hyperf.io", + "keywords": [ + "hyperf", + "php", + "support", + "swoole" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/tappable", + "version": "v3.1.15", + "source": { + "type": "git", + "url": "https://github.com/hyperf/tappable.git", + "reference": "69f22bbc8ecb5b930cc95a49ae9bf0ca0efbfdf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/tappable/zipball/69f22bbc8ecb5b930cc95a49ae9bf0ca0efbfdf1", + "reference": "69f22bbc8ecb5b930cc95a49ae9bf0ca0efbfdf1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Hyperf\\Tappable\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hyperf Macroable package which come from illuminate/tappable", + "homepage": "https://hyperf.io", + "keywords": [ + "hyperf", + "php", + "swoole", + "tappable" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2024-03-23T11:28:51+00:00" + }, + { + "name": "hyperf/utils", + "version": "v3.1.0", + "source": { + "type": "git", + "url": "https://github.com/hyperf/utils.git", + "reference": "10522904195eb5af9090bbd072589fb387c91041" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hyperf/utils/zipball/10522904195eb5af9090bbd072589fb387c91041", + "reference": "10522904195eb5af9090bbd072589fb387c91041", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^2.0", + "hyperf/code-parser": "~3.1.0", + "hyperf/codec": "~3.1.0", + "hyperf/collection": "~3.1.0", + "hyperf/context": "~3.1.0", + "hyperf/contract": "~3.1.0", + "hyperf/coordinator": "~3.1.0", + "hyperf/coroutine": "~3.1.0", + "hyperf/engine": "^2.0", + "hyperf/macroable": "~3.1.0", + "hyperf/serializer": "~3.1.0", + "hyperf/stringable": "~3.1.0", + "hyperf/support": "~3.1.0", + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A tools package that could help developer solved the problem quickly.", + "homepage": "https://hyperf.io", + "keywords": [ + "hyperf", + "php", + "swoole", + "utils" + ], + "support": { + "docs": "https://hyperf.wiki", + "issues": "https://github.com/hyperf/hyperf/issues", + "pull-request": "https://github.com/hyperf/hyperf/pulls", + "source": "https://github.com/hyperf/hyperf" + }, + "funding": [ + { + "url": "https://hyperf.wiki/#/zh-cn/donate", + "type": "custom" + }, + { + "url": "https://opencollective.com/hyperf", + "type": "open_collective" + } + ], + "time": "2023-11-24T03:10:53+00:00" + }, { "name": "illuminate/collections", "version": "v10.48.10", @@ -1264,6 +2370,56 @@ }, "time": "2021-11-05T16:47:00+00:00" }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, { "name": "psr/simple-cache", "version": "3.0.0", diff --git a/config/databases.php b/config/databases.php new file mode 100644 index 0000000..3a64690 --- /dev/null +++ b/config/databases.php @@ -0,0 +1,22 @@ + [ + 'driver' => env('DB_DRIVER', 'mysql'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', 3306), + 'database' => env('DB_DATABASE', 'hyperf'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'collation' => env('DB_COLLATION', 'utf8_unicode_ci'), + 'prefix' => env('DB_PREFIX', ''), + 'pool' => [ + 'min_connections' => 1, + 'max_connections' => 10, + 'connect_timeout' => 10.0, + 'wait_timeout' => 3.0, + 'heartbeat' => -1, + 'max_idle_time' => (float)env('DB_MAX_IDLE_TIME', 60), + ] + ], +]; \ No newline at end of file diff --git a/core/BeanFactory.php b/core/BeanFactory.php index 6e34a81..6abaf5c 100644 --- a/core/BeanFactory.php +++ b/core/BeanFactory.php @@ -21,10 +21,9 @@ class BeanFactory //初始容器Builder $builder = new ContainerBuilder(); //启用注释 主要是用它的Inject注释 - $builder->useAttributes(true); + $builder->useAttributes(false); //容器初始化 self::$container = $builder->build(); - $handlers = glob(ROOT_PATH . "/core/annotationhandlers/*.php"); foreach ($handlers as $handler) { self::$handlers = array_merge(self::$handlers, require_once($handler)); @@ -86,6 +85,9 @@ class BeanFactory //AnnotationRegistry::loadAnnotationClass($class); //获取所有类的注释 $classAnnos = $reader->getClassAnnotations($refClass); + if ($refClass->getName() == 'Core\server\HttpServer') { + continue; + } $instance = self::$container->get($refClass->getName()); foreach ($classAnnos as $classAnno) { //根据注释的类型获取对应处理方法 diff --git a/core/server/HttpServer.php b/core/server/HttpServer.php index c87b073..47ab83f 100644 --- a/core/server/HttpServer.php +++ b/core/server/HttpServer.php @@ -4,15 +4,19 @@ namespace Core\server; use Swoole\Http\Server; use Core\init\TestProcess; +use Core\BeanFactory; +#[Injectable(lazy: true)] class HttpServer { private $server; private $dispatcher; - public function __construct($str = 'dd') + private $host = 'localhost'; + private $port = 8086; + public function __construct() { - if ($str == 'dd') return; - $this->server = new Server("0.0.0.0",8085); + $this->server = new Server($this->host,$this->port); + echo 'host: http://' . $this->host . ':' . $this->port . PHP_EOL; //配置参数 https://wiki.swoole.com/#/server/setting $this->server->set(array( 'worker_num' => 2, //设置启动的 Worker 进程数。【默认值:CPU 核数】 @@ -53,10 +57,12 @@ class HttpServer switch($routeInfo[0]) { case \FastRoute\Dispatcher::NOT_FOUND: $response->status(404); + $response->write(json_encode(['code' => 404, 'msg' => 'NOT_FOUND'])); $response->end(); break; case \FastRoute\Dispatcher::METHOD_NOT_ALLOWED: $response->status(405); + $response->write(json_encode(['code' => 405, 'msg' => 'METHOD_NOT_ALLOWED'])); $response->end(); break; case \FastRoute\Dispatcher::FOUND: diff --git a/daemon.php b/daemon.php deleted file mode 100644 index e5ba639..0000000 --- a/daemon.php +++ /dev/null @@ -1,35 +0,0 @@ -set(array( - 'worker_num'=>1, //设置启动的 Worker 进程数。【默认值:CPU 核数】 - 'daemonize'=>false // 使用docker 不需要设置守护进程 - )); - $http->on('request',function ($req,$res){ - - }); - - $http->on('Start',function (Server $server ){ - $mid = $server->master_pid; //返回当前服务器主进程的 PID。 - file_put_contents("./ttt.pid",$mid); //会覆盖 - }); - $http->start(); - - } elseif ($cmd=='stop'){ - $mid = intval(file_get_contents("./ttt.pid")); - if (trim($mid)){ - Process::kill($mid); - } - } else { - echo '无效命令'; - } -} else { - echo '无效命令'; -} \ No newline at end of file diff --git a/dbtest.php b/dbtest.php deleted file mode 100644 index 44f4a21..0000000 --- a/dbtest.php +++ /dev/null @@ -1,8 +0,0 @@ -table('user')->get(); -foreach ($users as $user){ - echo $user->nickname; -} \ No newline at end of file diff --git a/index.php b/index.php deleted file mode 100644 index 2c48282..0000000 --- a/index.php +++ /dev/null @@ -1,11 +0,0 @@ -getMessage(); -} finally { - var_dump('hahaha cuo la ba'); -} \ No newline at end of file diff --git a/pool.php b/pool.php deleted file mode 100644 index daf7b4d..0000000 --- a/pool.php +++ /dev/null @@ -1,24 +0,0 @@ -initPool(); - for ($i = 0; $i < 5; $i++) { - go(function () use($pool,$i) { - $conn = $pool->getConnection(); - defer(function () use ($pool,$conn){ - //defer写在前 是怕后面的执行语句不一定成功 - $pool->close($conn); // 放回链接 - //channel对connection进行了引用 - }); - $state = $conn->query(" select $i"); - - var_dump($state); - }); - } - while (true){ - echo "链接了\n"; - \Swoole\Coroutine::sleep(1); - } -}); \ No newline at end of file diff --git a/start.php b/start.php deleted file mode 100644 index 51d6a88..0000000 --- a/start.php +++ /dev/null @@ -1,8 +0,0 @@ -routes); diff --git a/swoole-cli.exe.stackdump b/swoole-cli.exe.stackdump deleted file mode 100644 index 3d76119..0000000 --- a/swoole-cli.exe.stackdump +++ /dev/null @@ -1,171 +0,0 @@ -Exception: STATUS_ACCESS_VIOLATION at rip=0001008C745A -rax=00000001008308E0 rbx=0000000A005440B0 rcx=0000000000000000 -rdx=0000000000000000 rsi=00000007FFFF8F10 rdi=0000000000000058 -r8 =0000000000000000 r9 =0000000A0012F108 r10=0000000800000000 -r11=00000003FF76D542 r12=0000000000000000 r13=00006FFFFFDD0008 -r14=00000007FFFF8FA0 r15=0000000100B7F110 -rbp=00000001015C881F rsp=00000007FFFF8E20 -program=D:\software\swoole-cli\bin\swoole-cli.exe, pid 514, thread main -cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B -Stack trace: -Frame Function Args -0001015C881F 0001008C745A (000000000050, 0001015C881F, 0001015C87F0, 6FFFFFDD0008) swoole-cli.exe+0x4C745A -0001015C881F 0001008CED83 (000A00000010, 0000000001D3, 000A0052E228, 000000000000) swoole-cli.exe+0x4CED83 -0001015C881F 00010090A9F4 (7FFDE0E60453, 000000000088, 000000002028, 000100911940) swoole-cli.exe+0x50A9F4 -00010171FBA0 000100922BC9 (000100922940, 00000000000C, 6FFFFFE134C0, 6FFFFF617C58) swoole-cli.exe+0x522BC9 -000000200308 0001009231A2 (000100B7F030, 000A003C4C30, 000100A6A343, 000A004169A8) swoole-cli.exe+0x5231A2 -000000200308 00010091AA75 (6FFFFFFB4710, 6FFFFFE132C0, 6FFFFFF04008, 6FFFFFE13350) swoole-cli.exe+0x51AA75 -000000200308 0001008A4A4A (0007FFFF9320, 000000000003, 000000000008, 6FFFFFE13330) swoole-cli.exe+0x4A4A4A -000000200308 000100A4BA74 (0001017238E0, 6FFFFFE77D00, 0001009F00C6, 000000000000) swoole-cli.exe+0x64BA74 -000000000000 000100A4DA72 (000700000008, 0007FFFFA630, 0007FFFFB8B0, 0007FFFFCC38) swoole-cli.exe+0x64DA72 -0007FFFF9320 0001009E2A2B (0001009CA40D, 000000000000, 000000000000, 0007FFFFB810) swoole-cli.exe+0x5E2A2B -0007FFFFA380 00010097E3E3 (00010097C6F0, 000100BBCEE8, 00010097C6E0, 000700000000) swoole-cli.exe+0x57E3E3 -000000000000 000100AC434D (0007FFFFCC30, 000000000025, 0000FF52424B, 0007FFFFCA84) swoole-cli.exe+0x6C434D -000000000000 000100BDD758 (0007FFFFCC30, 000000000000, 7FFD49F48035, 0007FFFFCC50) swoole-cli.exe+0x7DD758 -0007FFFFCD30 7FFD49F480A1 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x80A1 -0007FFFFFFF0 7FFD49F45C86 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x5C86 -0007FFFFFFF0 7FFD49F45D34 (000000000000, 000000000000, 000000000000, 000000000000) cygwin1.dll+0x5D34 -End of stack trace -Loaded modules: -000100400000 swoole-cli.exe -7FFDE0E50000 ntdll.dll -7FFDDF570000 KERNEL32.DLL -7FFDDE170000 KERNELBASE.dll -0003F3A30000 cygMagickCore-7.Q16HDRI-7.dll -0003F38F0000 cygMagickWand-7.Q16HDRI-7.dll -0003FFE60000 cygbrotlidec-1.dll -7FFDDF190000 ADVAPI32.dll -0003F3540000 cygbrotlienc-1.dll -7FFDE05C0000 msvcrt.dll -0003FFE40000 cygbz2-1.dll -7FFDDF410000 sechost.dll -0003F33C0000 cygcares-2.dll -7FFDDE520000 bcrypt.dll -7FFDDEB80000 RPCRT4.dll -0003FFAB0000 cygcurl-4.dll -7FFDE03D0000 GDI32.dll -7FFDDE550000 win32u.dll -7FFD49F40000 cygwin1.dll -0003FFB60000 cygcrypto-1.1.dll -0003F41C0000 cygexslt-0.dll -7FFDDE580000 gdi32full.dll -7FFDDE7C0000 msvcp_win.dll -0003FF580000 cyggmp-10.dll -7FFDDE6A0000 ucrtbase.dll -7FFDDEF30000 USER32.dll -0003F2980000 cygfreetype-6.dll -0003F20F0000 cygicui18n72.dll -0003F23D0000 cygiconv-2.dll -0003EEAE0000 cygjpeg-8.dll -0003F1F30000 cygicuuc72.dll -0003FF4F0000 cygicuio72.dll -0003EE7B0000 cygonig-5.dll -0003EE570000 cygpng16-16.dll -0003FE600000 cygreadline7.dll -0003FE470000 cygssl-1.1.dll -0003FDF20000 cygxml2-2.dll -0003F4180000 cygxslt-1.dll -0003F5940000 cygsqlite3-0.dll -0003EDC80000 cygyaml-0-2.dll -0003FDF00000 cygz.dll -0003ED690000 cygzip-5.dll -0003FF760000 cyggcc_s-seh-1.dll -0003FE290000 cygstdc++-6.dll -0003F37B0000 cygX11-6.dll -0003F3730000 cygXext-6.dll -0003FF540000 cyggomp-1.dll -0003F3420000 cygcairo-2.dll -0003F3380000 cygcgraph-6.dll -0003F3160000 cygdjvulibre-21.dll -0003F2B80000 cygfontconfig-1.dll -0003F2AE0000 cygfpx-1.dll -0003F2F20000 cygfftw3-3.dll -0003F2590000 cygglib-2.0-0.dll -0003F2520000 cyggobject-2.0-0.dll -0003EC0E0000 cyggs-9.dll -0003EEBA0000 cygjbig-2.dll -0003EEA80000 cyglcms2-2.dll -0003F0E70000 cyggvc-6.dll -0003EEA60000 cyglqr-1-0.dll -0003FED10000 cyglzma-5.dll -0003EE700000 cygpango-1.0-0.dll -0003EE6E0000 cygpangocairo-1.0-0.dll -0003EE240000 cygraqm-0.dll -0003EE020000 cygrsvg-2-2.dll -0003EDD80000 cygwebp-7.dll -0003FFE80000 cygbrotlicommon-1.dll -0003EE060000 cygraw_r-16.dll -0003EDE10000 cygtiff-6.dll -0003EDD30000 cygwebpdemux-2.dll -0003EDD10000 cygwebpmux-3.dll -0003FE750000 cygidn2-0.dll -0003FF4A0000 cyggssapi_krb5-2.dll -0003FF730000 cyggsasl-18.dll -0003FEF80000 cyglber-2.dll -0003FEE60000 cygldap-2.dll -0003FE710000 cygnghttp2-14.dll -0003FE6B0000 cygpsl-5.dll -0003FE500000 cygssh2-1.dll -0003FDE50000 cygzstd-1.dll -0003FF640000 cyggcrypt-20.dll -0003EA300000 cygicudata72.dll -0003FE9B0000 cygncursesw-10.dll -0003ED720000 cygcrypto-1.0.0.dll -0003EDCE0000 cygxcb-1.dll -0003EE5D0000 cygpixman-1-0.dll -0003EDCC0000 cygxcb-render-0.dll -0003EDCB0000 cygxcb-shm-0.dll -0003F3670000 cygXrender-1.dll -0003F33A0000 cygcdt-5.dll -0003FF810000 cygexpat-1.dll -0003FF2E0000 cygintl-8.dll -0003FE0A0000 cyguuid-1.dll -0003FE7B0000 cygpcre-1.dll -0003FF7A0000 cygffi-6.dll -0003F3610000 cygXt-6.dll -0003FF370000 cygidn-12.dll -0003EE6A0000 cygpaper-1.dll -0003F5E50000 cygtiff-7.dll -0003F3FE0000 cygltdl-7.dll -0003EE680000 cygpathplan-4.dll -0003EDE90000 cygthai-0.dll -0003EE6C0000 cygpangoft2-1.0-0.dll -0003F2960000 cygfribidi-0.dll -0003F5ED0000 cygharfbuzz-0.dll -0003F3330000 cygcroco-0.6-3.dll -0003F2820000 cyggdk_pixbuf-2.0-0.dll -0003F2690000 cyggio-2.0-0.dll -0003FEDB0000 cygsharpyuv-0.dll -0003EEBC0000 cygjasper-4.dll -0003F3300000 cygdeflate-0.dll -0003FF0D0000 cygk5crypto-3.dll -0003FF000000 cygkrb5-3.dll -0003FEFE0000 cygkrb5support-0.dll -0003FFE30000 cygcom_err-2.dll -0003FE960000 cygntlm-0.dll -0003FE590000 cygsasl2-3.dll -0003F1AF0000 cygunistring-5.dll -0003FF510000 cyggpg-error-0.dll -0003F3750000 cygXdmcp-6.dll -0003F37A0000 cygXau-6.dll -0003F3ED0000 cygICE-6.dll -0003F38E0000 cygSM-6.dll -0003F3320000 cygdatrie-1.dll -0003F24F0000 cyggraphite2-3.dll -0003F2580000 cyggmodule-2.0-0.dll -7FFDDD8A0000 CRYPTBASE.DLL -7FFDDE9D0000 bcryptPrimitives.dll -7FFDDF530000 IMM32.DLL -7FFDD5290000 netapi32.dll -7FFDD5270000 SAMCLI.DLL -7FFDD96A0000 SAMLIB.dll -7FFDDCBD0000 NETUTILS.DLL -7FFDDCD50000 authz.dll -7FFDDCBE0000 iphlpapi.dll -7FFDDCC10000 DNSAPI.dll -7FFDE03C0000 NSI.dll -7FFDD8360000 dhcpcsvc6.DLL -7FFDD8380000 dhcpcsvc.DLL -7FFDDB630000 WINNSI.DLL -7FFDDECA0000 ws2_32.dll -7FFDDD650000 mswsock.dll diff --git a/test.php b/test.php deleted file mode 100644 index 97cf355..0000000 --- a/test.php +++ /dev/null @@ -1,12 +0,0 @@ -getProperty("conn_url"); -var_dump($p); -$reader = new AnnotationReader(); -//获取变量的注释中@Value的name -$anno = $reader->getPropertyAnnotation($p,Value::class); -var_dump($anno); -echo $anno->name;*/ - - -$builder = new DI\ContainerBuilder(); -$builder->useAttributes(true); -$container = $builder->build(); -$myUser = $container->get(\baihand\test\MyUser2::class); -var_dump($myUser); -var_dump($myUser->getAllUsers()); -var_dump($myUser->myredis->getValue());