diff --git a/composer.json b/composer.json index 61be2b0..93cf80d 100644 --- a/composer.json +++ b/composer.json @@ -3,16 +3,22 @@ "authors": [ { "name": "候学杰", - "email": "houxuejie@xpai.tv" + "email": "houxuejie@hawumc.com.tv" } ], "autoload": { "psr-4": { - "PdAuth\\": "src/PdAuth" + "PdAuth\\": "src/" } }, "require": { "illuminate/support": "^5.5", - "guzzlehttp/guzzle": "^6.3" + "paidian/json-rpc": "dev-master" + }, + "repositories": { + "php-json-rpc": { + "type": "vcs", + "url": "git@git.int.haowumc.com:composer/php-json-rpc.git" + } } } diff --git a/composer.lock b/composer.lock index 01eafa4..dc325b8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,24 +4,24 @@ "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": "ca4171a23bcb5fdd4cee12f9002972f7", + "content-hash": "8e53603859d4bca84428fc68d118f682", "packages": [ { "name": "doctrine/inflector", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462" + "reference": "5527a48b7313d15261292c149e55e26eae771b0a" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/doctrine/inflector/e11d84c6e018beedd929cff5220969a3c6d1d462.zip", - "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a", + "reference": "5527a48b7313d15261292c149e55e26eae771b0a", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { "phpunit/phpunit": "^6.2" @@ -29,7 +29,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -71,20 +71,20 @@ "singularize", "string" ], - "time": "2017-07-22T12:18:28+00:00" + "time": "2018-01-09T20:05:19+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "version": "6.3.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/guzzle/guzzle/f4db5a78a5ea468d4831de7f0bf9d9415e348699.zip", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "shasum": "" }, "require": { @@ -94,7 +94,7 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", "psr/log": "^1.0" }, "suggest": { @@ -103,7 +103,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -136,7 +136,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2018-04-22T15:46:56+00:00" }, { "name": "guzzlehttp/promises", @@ -148,7 +148,7 @@ }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/guzzle/promises/a59da6cf61d80060647ff4d3eb2c03a2bc694646.zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "shasum": "" }, @@ -191,32 +191,33 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.4.2", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + "reference": "9f83dded91781a01c63574e387eaa769be769115" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/guzzle/psr7/f5b8a8512e2b58b0071a7280e39f14f72e05d87c.zip", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -246,37 +247,38 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2018-12-04T20:46:45+00:00" }, { "name": "illuminate/contracts", - "version": "v5.5.28", + "version": "v5.7.21", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "03e9014d2091a30b025c895aa6d39c2755576ea5" + "reference": "3d67e2d7c9087ae3a2a53d9b102697e5f482d6d0" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/illuminate/contracts/03e9014d2091a30b025c895aa6d39c2755576ea5.zip", - "reference": "03e9014d2091a30b025c895aa6d39c2755576ea5", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/3d67e2d7c9087ae3a2a53d9b102697e5f482d6d0", + "reference": "3d67e2d7c9087ae3a2a53d9b102697e5f482d6d0", "shasum": "" }, "require": { - "php": ">=7.0", - "psr/container": "~1.0", - "psr/simple-cache": "~1.0" + "php": "^7.1.3", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.7-dev" } }, "autoload": { @@ -296,41 +298,191 @@ ], "description": "The Illuminate Contracts package.", "homepage": "https://laravel.com", - "time": "2017-11-22T19:01:14+00:00" + "time": "2019-01-09T10:34:49+00:00" }, { - "name": "illuminate/support", - "version": "v5.5.28", + "name": "illuminate/filesystem", + "version": "v5.7.21", "source": { "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "4db3cc82b483172b1b25d9dfcec684927f5c8cf9" + "url": "https://github.com/illuminate/filesystem.git", + "reference": "19ba2ac5f85b7505d7c2bf6307d10633f9f3c6b0" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/illuminate/support/4db3cc82b483172b1b25d9dfcec684927f5c8cf9.zip", - "reference": "4db3cc82b483172b1b25d9dfcec684927f5c8cf9", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/19ba2ac5f85b7505d7c2bf6307d10633f9f3c6b0", + "reference": "19ba2ac5f85b7505d7c2bf6307d10633f9f3c6b0", "shasum": "" }, "require": { - "doctrine/inflector": "~1.1", - "ext-mbstring": "*", - "illuminate/contracts": "5.5.*", - "nesbot/carbon": "^1.20", - "php": ">=7.0" - }, - "replace": { - "tightenco/collect": "self.version" + "illuminate/contracts": "5.7.*", + "illuminate/support": "5.7.*", + "php": "^7.1.3", + "symfony/finder": "^4.1" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (5.2.*).", - "symfony/process": "Required to use the composer class (~3.3).", - "symfony/var-dumper": "Required to use the dd function (~3.3)." + "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.0).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", + "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", + "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (^1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.7-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Filesystem package.", + "homepage": "https://laravel.com", + "time": "2018-12-28T14:33:29+00:00" + }, + { + "name": "illuminate/http", + "version": "v5.7.21", + "source": { + "type": "git", + "url": "https://github.com/illuminate/http.git", + "reference": "28f7a7ffa944d49b63023e99c1fda2e5fb56df0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/http/zipball/28f7a7ffa944d49b63023e99c1fda2e5fb56df0e", + "reference": "28f7a7ffa944d49b63023e99c1fda2e5fb56df0e", + "shasum": "" + }, + "require": { + "illuminate/session": "5.7.*", + "illuminate/support": "5.7.*", + "php": "^7.1.3", + "symfony/http-foundation": "^4.1", + "symfony/http-kernel": "^4.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Http\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Http package.", + "homepage": "https://laravel.com", + "time": "2019-01-12T14:14:21+00:00" + }, + { + "name": "illuminate/session", + "version": "v5.7.21", + "source": { + "type": "git", + "url": "https://github.com/illuminate/session.git", + "reference": "7e2a7bcf01a16e03c2f97bffccc7e7f0fd0ed9da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/session/zipball/7e2a7bcf01a16e03c2f97bffccc7e7f0fd0ed9da", + "reference": "7e2a7bcf01a16e03c2f97bffccc7e7f0fd0ed9da", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.7.*", + "illuminate/filesystem": "5.7.*", + "illuminate/support": "5.7.*", + "php": "^7.1.3", + "symfony/finder": "^4.1", + "symfony/http-foundation": "^4.1" + }, + "suggest": { + "illuminate/console": "Required to use the session:table command (5.7.*)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Session\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Session package.", + "homepage": "https://laravel.com", + "time": "2019-01-01T13:45:22+00:00" + }, + { + "name": "illuminate/support", + "version": "v5.7.20", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "ea3f30dd824bba52bcff4290dc7431b0ffb478e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/ea3f30dd824bba52bcff4290dc7431b0ffb478e1", + "reference": "ea3f30dd824bba52bcff4290dc7431b0ffb478e1", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.1", + "ext-mbstring": "*", + "illuminate/contracts": "5.7.*", + "nesbot/carbon": "^1.26.3", + "php": "^7.1.3" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (5.7.*).", + "moontoast/math": "Required to use ordered UUIDs (^1.1).", + "ramsey/uuid": "Required to use Str::uuid() (^3.7).", + "symfony/process": "Required to use the composer class (^4.1).", + "symfony/var-dumper": "Required to use the dd function (^4.1)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.7-dev" } }, "autoload": { @@ -353,39 +505,158 @@ ], "description": "The Illuminate Support package.", "homepage": "https://laravel.com", - "time": "2017-12-24T20:02:59+00:00" + "time": "2019-01-07T13:39:07+00:00" }, { - "name": "nesbot/carbon", - "version": "1.22.1", + "name": "itxq/api-doc-php", + "version": "v1.1.1", "source": { "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc" + "url": "https://github.com/itxq/api-doc-php.git", + "reference": "79ac71cf09da49491cfb92722d6f6e13ad8f6482" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/briannesbitt/Carbon/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc.zip", - "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc", + "url": "https://api.github.com/repos/itxq/api-doc-php/zipball/79ac71cf09da49491cfb92722d6f6e13ad8f6482", + "reference": "79ac71cf09da49491cfb92722d6f6e13ad8f6482", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "itxq\\apidoc\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "IT小强xqitw.cn", + "email": "360237521@qq.com" + } + ], + "description": "api-doc-php", + "time": "2018-06-24T04:20:25+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.24.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { "php": ">=5.3.0", - "symfony/translation": "~2.6 || ~3.0" + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "~4.0 || ~5.0" + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.23-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { - "Carbon\\": "src/Carbon/" + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2018-11-05T09:00:11+00:00" + }, + { + "name": "nesbot/carbon", + "version": "1.36.2", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9", + "reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/translation": "~2.6 || ~3.0 || ~4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7" + }, + "suggest": { + "friendsofphp/php-cs-fixer": "Needed for the `composer phpcs` command. Allow to automatically fix code style.", + "phpstan/phpstan": "Needed for the `composer phpstan` command. Allow to detect potential errors." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -406,7 +677,31 @@ "datetime", "time" ], - "time": "2017-01-16T07:55:07+00:00" + "time": "2018-12-28T10:07:33+00:00" + }, + { + "name": "paidian/json-rpc", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@git.int.haowumc.com:composer/php-json-rpc.git", + "reference": "ac874a3198ab544d8b9dae5daee2c9b50e3bf19d" + }, + "require": { + "guzzlehttp/guzzle": "^6.3", + "illuminate/http": "^5.5", + "illuminate/support": "^5.5", + "itxq/api-doc-php": "^1.1", + "monolog/monolog": "^1.24" + }, + "type": "library", + "autoload": { + "psr-4": { + "JsonRpc\\": "src/" + } + }, + "description": "json rpc server/client.", + "time": "2019-01-22T08:04:05+00:00" }, { "name": "psr/container", @@ -418,7 +713,7 @@ }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/php-fig/container/b7ce3b176482dbbc1245ebf52b181af44c2cf55f.zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, @@ -467,7 +762,7 @@ }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/php-fig/http-message/f6561bf28d520154e4b0ec72be95418abe6d9363.zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, @@ -508,17 +803,64 @@ "time": "2016-08-06T14:39:51+00:00" }, { - "name": "psr/simple-cache", - "version": "1.0.0", + "name": "psr/log", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24" + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/php-fig/simple-cache/753fa598e8f3b9966c886fe13f370baa45ef0e24.zip", - "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2018-11-20T15:27:04+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { @@ -553,20 +895,498 @@ "psr-16", "simple-cache" ], - "time": "2017-01-02T13:31:39+00:00" + "time": "2017-10-23T01:57:42+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.6.0", + "name": "ralouphie/getallheaders", + "version": "2.0.5", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/polyfill-mbstring/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296.zip", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, + { + "name": "symfony/contracts", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "exclude-from-classmap": [ + "**/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" + }, + { + "name": "symfony/debug", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "64cb33c81e37d19b7715d4a6a4d49c1c382066dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/64cb33c81e37d19b7715d4a6a4d49c1c382066dd", + "reference": "64cb33c81e37d19b7715d4a6a4d49c1c382066dd", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "~3.4|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "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 Debug Component", + "homepage": "https://symfony.com", + "time": "2019-01-03T09:07:35+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "887de6d34c86cf0cb6cbf910afb170cdb743cb5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/887de6d34c86cf0cb6cbf910afb170cdb743cb5e", + "reference": "887de6d34c86cf0cb6cbf910afb170cdb743cb5e", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/contracts": "^1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "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 EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2019-01-05T16:37:49+00:00" + }, + { + "name": "symfony/finder", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "9094d69e8c6ee3fe186a0ec5a4f1401e506071ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/9094d69e8c6ee3fe186a0ec5a4f1401e506071ce", + "reference": "9094d69e8c6ee3fe186a0ec5a4f1401e506071ce", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "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 Finder Component", + "homepage": "https://symfony.com", + "time": "2019-01-03T09:07:35+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "a633d422a09242064ba24e44a6e1494c5126de86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a633d422a09242064ba24e44a6e1494c5126de86", + "reference": "a633d422a09242064ba24e44a6e1494c5126de86", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.1" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/expression-language": "~3.4|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "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 HttpFoundation Component", + "homepage": "https://symfony.com", + "time": "2019-01-05T16:37:49+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v4.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "83de6543328917c18d5498eeb6bb6d36f7aab31b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/83de6543328917c18d5498eeb6bb6d36f7aab31b", + "reference": "83de6543328917c18d5498eeb6bb6d36f7aab31b", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "~1.0", + "symfony/contracts": "^1.0.2", + "symfony/debug": "~3.4|~4.0", + "symfony/event-dispatcher": "~4.1", + "symfony/http-foundation": "^4.1.1", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/config": "<3.4", + "symfony/dependency-injection": "<4.2", + "symfony/translation": "<4.2", + "symfony/var-dumper": "<4.1.1", + "twig/twig": "<1.34|<2.4,>=2" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/cache": "~1.0", + "symfony/browser-kit": "~3.4|~4.0", + "symfony/config": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", + "symfony/css-selector": "~3.4|~4.0", + "symfony/dependency-injection": "^4.2", + "symfony/dom-crawler": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0", + "symfony/templating": "~3.4|~4.0", + "symfony/translation": "~4.2", + "symfony/var-dumper": "^4.1.1" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/var-dumper": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "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 HttpKernel Component", + "homepage": "https://symfony.com", + "time": "2019-01-06T16:19:23+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "backendtea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -578,7 +1398,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -612,48 +1432,53 @@ "portable", "shim" ], - "time": "2017-10-11T12:05:26+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/translation", - "version": "v3.4.2", + "version": "v4.2.2", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4c5d5582baf2829751a5207659329c1f52eedeb6" + "reference": "939fb792d73f2ce80e6ae9019d205fc480f1c9a0" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/translation/4c5d5582baf2829751a5207659329c1f52eedeb6.zip", - "reference": "4c5d5582baf2829751a5207659329c1f52eedeb6", + "url": "https://api.github.com/repos/symfony/translation/zipball/939fb792d73f2ce80e6ae9019d205fc480f1c9a0", + "reference": "939fb792d73f2ce80e6ae9019d205fc480f1c9a0", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", + "symfony/contracts": "^1.0.2", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/config": "<2.8", + "symfony/config": "<3.4", "symfony/dependency-injection": "<3.4", "symfony/yaml": "<3.4" }, + "provide": { + "symfony/translation-contracts-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", + "symfony/config": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/intl": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { - "psr/log": "To use logging capability in translator", + "psr/log-implementation": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -680,13 +1505,15 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-12-12T08:27:14+00:00" + "time": "2019-01-03T09:07:35+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "paidian/json-rpc": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/config/auth.php b/config/auth.php new file mode 100644 index 0000000..c09e8b1 --- /dev/null +++ b/config/auth.php @@ -0,0 +1,14 @@ + [ + 'erp' => [ + 'id' => '100002', + 'secret' => '123456', + ], + + ], +]; \ No newline at end of file diff --git a/src/Auth.php b/src/Auth.php new file mode 100644 index 0000000..58fe2ad --- /dev/null +++ b/src/Auth.php @@ -0,0 +1,141 @@ +config = $config; + $this->configure(); + } + + /** + * @throws \Exception + */ + protected function configure() + { + switch (env('APP_ENV')) { + case 'local': + case 'develop': + $this->host = 'http://auth.lo.haowumc.com'; + break; + case 'production': + $this->host = 'https://auth.int.haowumc.com'; + break; + default: + throw new \Exception('"APP_ENV" is not defined or not allow'); + } + + //为了公司内部调用的统一,更换协议为 JSON RPC + if (function_exists('app')) { + $this->rpc = app('rpc.auth'); + } else { + $this->rpc = new Client([ + 'client' => [ + 'auth' => [ + 'local' => true, + 'base_uri' => env('RPC_AUTH_URI'), + ], + ], + ]); + } + } + + /** + * 指定 app + * @param $key + */ + public function choose($key) + { + $this->id = $this->config['apps'][$key]['id']; + $this->secret = $this->config['apps'][$key]['secret']; + } + + /** + * 生成web授权的链接 + * @param $redirect + * @return string + */ + public function connect($redirect) + { + $id = $this->id; + $redirect = urlencode($redirect); + return "{$this->host}/connect?appid={$id}&redirect=$redirect"; + } + + /** + * @param $code + * @return array + * @throws \JsonRpc\Exception\RpcServerException + */ + public function getAccessToken($code) + { + $token = $this->rpc->call('oauth.get_access_token', [$this->id, $this->secret, $code]); + return $token; + } + + /** + * 根据用户token获取用户信息 + * @param $token + * @return array|null + * @throws \JsonRpc\Exception\RpcServerException + */ + public function getUserInfo($token) + { + $info = $this->rpc->call('user.info',[$token]); + return $info; + } + + /** + * 获取用户组 + * @param null $token + * @return null + */ + public function getGroupUsers($token = null) + { + if ($token == null) { + $token = $_COOKIE[Authenticate::CookieName]; + } + $token = urlencode($token); + $resp = $this->get("$this->host/api/group/users?access_token=$token"); + if ($resp['code'] == 0) { + return $resp['data']; + } + return null; + } + + + /** + * @绑定好物平台用户 + * + * @param int $user_id + * @param int $hwuser_id + * @return null + */ + public function bindHwUser(int $user_id, int $hwuser_id) + { + if ($user_id <= 0 || $hwuser_id <= 0) { + return null; + } + $resp = $this->post("$this->host/api/bind/hwuser", [ + 'id' => $user_id, + 'hwmc_id' => $hwuser_id, + ]); + return $resp; + } +} \ No newline at end of file diff --git a/src/PdAuth/OAuth.php b/src/PdAuth/OAuth.php index 8b1ee2d..7c28ccc 100644 --- a/src/PdAuth/OAuth.php +++ b/src/PdAuth/OAuth.php @@ -35,8 +35,6 @@ class OAuth * @param $redirect * @return string */ - - public function connect($redirect) { $redirect = urlencode($redirect); diff --git a/src/config/pdauth.php b/src/config/pdauth.php deleted file mode 100644 index 8ed7d3e..0000000 --- a/src/config/pdauth.php +++ /dev/null @@ -1,7 +0,0 @@ - env('PDAUTH_APP_ID', '100002'), - 'secret' => env('PDAUTH_SECRET', '123456'), - 'host' => env('PDAUTH_HOST', 'http://auth.dev.haowumc.com'), -]; \ No newline at end of file diff --git a/tests/1.php b/tests/1.php new file mode 100644 index 0000000..4db0abc --- /dev/null +++ b/tests/1.php @@ -0,0 +1,8 @@ +choose('erp'); +exec('open '.$auth->connect('/')); \ No newline at end of file