diff --git a/composer.json b/composer.json index 0754da7..8b3c1f3 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,8 @@ "illuminate/support": "^5.5", "illuminate/http": "^5.5", "monolog/monolog": "^1.24", - "itxq/api-doc-php": "^1.1" + "itxq/api-doc-php": "^1.1", + "sami/sami": "^4.1" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 17b7855..2e25bc7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,131 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c8f285c2463b3be4f6b2e70209334571", + "content-hash": "c79096021b9c579b6fd80d4bd050e77b", "packages": [ + { + "name": "blackfire/php-sdk", + "version": "v1.17.6", + "source": { + "type": "git", + "url": "https://github.com/blackfireio/php-sdk.git", + "reference": "fad1707b03c564baf61573bf8ac1e83ad59703eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/blackfireio/php-sdk/zipball/fad1707b03c564baf61573bf8ac1e83ad59703eb", + "reference": "fad1707b03c564baf61573bf8ac1e83ad59703eb", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "composer/ca-bundle": "^1.0", + "php": ">=5.2.0" + }, + "suggest": { + "ext-blackfire": "The C version of the Blackfire probe", + "ext-zlib": "To push config to remote profiling targets" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "files": [ + "src/autostart.php" + ], + "psr-4": { + "Blackfire\\": "src/Blackfire" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Blackfire.io", + "email": "support@blackfire.io" + } + ], + "description": "Blackfire.io PHP SDK", + "keywords": [ + "performance", + "profiler", + "uprofiler", + "xhprof" + ], + "time": "2018-12-17T11:03:35+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8afa52cd417f4ec417b4bfe86b68106538a87660", + "reference": "8afa52cd417f4ec417b4bfe86b68106538a87660", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2018-10-18T06:09:13+00:00" + }, { "name": "doctrine/inflector", "version": "v1.3.0", @@ -603,6 +726,58 @@ "description": "api-doc-php", "time": "2018-06-24T04:20:25+00:00" }, + { + "name": "michelf/php-markdown", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-markdown.git", + "reference": "01ab082b355bf188d907b9929cd99b2923053495" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/01ab082b355bf188d907b9929cd99b2923053495", + "reference": "01ab082b355bf188d907b9929cd99b2923053495", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Michelf\\": "Michelf/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "https://michelf.ca/", + "role": "Developer" + }, + { + "name": "John Gruber", + "homepage": "https://daringfireball.net/" + } + ], + "description": "PHP Markdown", + "homepage": "https://michelf.ca/projects/php-markdown/", + "keywords": [ + "markdown" + ], + "time": "2018-01-15T00:49:33+00:00" + }, { "name": "monolog/monolog", "version": "1.24.0", @@ -751,6 +926,174 @@ ], "time": "2018-12-28T10:07:33+00:00" }, + { + "name": "nikic/php-parser", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.0|~5.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2018-02-28T20:30:58+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-01-25T08:17:30+00:00" + }, + { + "name": "pimple/pimple", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.0", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2018-01-21T07:42:36+00:00" + }, { "name": "psr/container", "version": "1.0.0", @@ -1015,6 +1358,150 @@ "description": "A polyfill for getallheaders.", "time": "2016-02-11T07:05:27+00:00" }, + { + "name": "sami/sami", + "version": "v4.1.2", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Sami.git", + "reference": "19b8a82b858bd31544c468317c8307188ccb4022" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Sami/zipball/19b8a82b858bd31544c468317c8307188ccb4022", + "reference": "19b8a82b858bd31544c468317c8307188ccb4022", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "blackfire/php-sdk": "^1.5.18", + "michelf/php-markdown": "~1.3", + "nikic/php-parser": "~3.0", + "php": "^7.1.3", + "phpdocumentor/reflection-docblock": "~2.0", + "pimple/pimple": "~3.0", + "symfony/console": "~3.0|~4.0", + "symfony/filesystem": "~3.0|~4.0", + "symfony/finder": "~3.0|~4.0", + "symfony/process": "~3.0|~4.0", + "symfony/yaml": "~3.0|~4.0", + "twig/twig": "~2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "~4.0" + }, + "bin": [ + "sami.php" + ], + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Sami\\": "Sami/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Sami, an API documentation generator", + "homepage": "http://sami.sensiolabs.org", + "keywords": [ + "phpdoc" + ], + "abandoned": true, + "time": "2018-07-02T13:20:39+00:00" + }, + { + "name": "symfony/console", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "b0a03c1bb0fcbe288629956cf2f1dd3f1dc97522" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/b0a03c1bb0fcbe288629956cf2f1dd3f1dc97522", + "reference": "b0a03c1bb0fcbe288629956cf2f1dd3f1dc97522", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2019-01-04T15:13:53+00:00" + }, { "name": "symfony/contracts", "version": "v1.0.2", @@ -1221,6 +1708,62 @@ "homepage": "https://symfony.com", "time": "2019-01-05T16:37:49+00:00" }, + { + "name": "symfony/filesystem", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "c2ffd9a93f2d6c5be2f68a0aa7953cc229f871f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/c2ffd9a93f2d6c5be2f68a0aa7953cc229f871f8", + "reference": "c2ffd9a93f2d6c5be2f68a0aa7953cc229f871f8", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2019-01-03T09:07:35+00:00" + }, { "name": "symfony/finder", "version": "v4.2.2", @@ -1560,6 +2103,61 @@ ], "time": "2018-09-21T13:07:52+00:00" }, + { + "name": "symfony/process", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "ea043ab5d8ed13b467a9087d81cb876aee7f689a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/ea043ab5d8ed13b467a9087d81cb876aee7f689a", + "reference": "ea043ab5d8ed13b467a9087d81cb876aee7f689a", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2019-01-03T14:48:52+00:00" + }, { "name": "symfony/translation", "version": "v4.2.2", @@ -1638,6 +2236,144 @@ "description": "Symfony Translation Component", "homepage": "https://symfony.com", "time": "2019-01-03T09:07:35+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "d0aa6c0ea484087927b49fd513383a7d36190ca6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d0aa6c0ea484087927b49fd513383a7d36190ca6", + "reference": "d0aa6c0ea484087927b49fd513383a7d36190ca6", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2019-01-03T09:07:35+00:00" + }, + { + "name": "twig/twig", + "version": "v2.6.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "a11dd39f5b6589e14f0ff3b36675d06047c589b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a11dd39f5b6589e14f0ff3b36675d06047c589b1", + "reference": "a11dd39f5b6589e14f0ff3b36675d06047c589b1", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^7.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "^2.7", + "symfony/phpunit-bridge": "^3.4.19|^4.1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "https://twig.symfony.com/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "time": "2018-12-16T10:36:48+00:00" } ], "packages-dev": [], diff --git a/src/Sami/config.php b/src/Sami/config.php new file mode 100644 index 0000000..c1008b1 --- /dev/null +++ b/src/Sami/config.php @@ -0,0 +1,18 @@ +files()->name('*.php')->in($dir); + +return new \Sami\Sami($iterator,[ + 'theme' => 'default',//sami安装后默认的有一套文档页面风格模板,名称是default。位置在:vendor/sami/sami/Sami/Resources/themes/下。 + 'title' => 'Mysic',//项目名称 + 'build_dir' => __DIR__.'/document/',//设置文档生成后的保存路径 + 'cache_dir' => __DIR__.'/document/cache/',//设置文档生成时的缓存路径 + 'default_opened_level' => 2 +]); \ No newline at end of file diff --git a/src/Server/JsonRpcServer.php b/src/Server/JsonRpcServer.php index 6985d48..c51c107 100644 --- a/src/Server/JsonRpcServer.php +++ b/src/Server/JsonRpcServer.php @@ -85,6 +85,11 @@ class JsonRpcServer return isset($this->map[$method]) ? $this->map[$method] : ['', '']; } + /** + * thisis + * @param string $method 参数名称 + * @return array 返回结果 + */ protected function parseMethod($method) { $method = explode('.', $method); diff --git a/src/Server/JsonRpcServerDoc.php b/src/Server/JsonRpcServerDoc.php index ddc3dc8..b831421 100644 --- a/src/Server/JsonRpcServerDoc.php +++ b/src/Server/JsonRpcServerDoc.php @@ -29,17 +29,17 @@ class JsonRpcDoc public function render() { - - /** - * @var $view Factory - */ - $config = [ - 'class' => $this->methods(), - 'filter_method' => [], - ]; - $api = new BootstrapApiDoc($config); - $doc = $api->getHtml(); - exit($doc); +// /** +// * @var $view Factory +// */ +// $config = [ +// 'class' => $this->methods(), +// 'filter_method' => [], +// ]; +// $api = new BootstrapApiDoc($config); +// $doc = $api->getHtml(); +// exit($doc); + return view()->file(__DIR__."/../Sami/document/index.html"); } protected function desc($class, $method)