作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

上传wechat

正在显示 47 个修改的文件 包含 4772 行增加0 行删除

要显示太多修改。

为保证性能只显示 47 of 47+ 个文件。

此 diff 太大无法显示。
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b8343514cebea18e015f5ef5226cb3fe",
"packages": [
{
"name": "easywechat-composer/easywechat-composer",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/mingyoung/easywechat-composer.git",
"reference": "bebd2fee768c5e47449d0317067f43bab10fe1eb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mingyoung/easywechat-composer/zipball/bebd2fee768c5e47449d0317067f43bab10fe1eb",
"reference": "bebd2fee768c5e47449d0317067f43bab10fe1eb",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0",
"php": ">=7.0"
},
"require-dev": {
"composer/composer": "^1.0",
"phpunit/phpunit": "^6.5 || ^7.0"
},
"type": "composer-plugin",
"extra": {
"class": "EasyWeChatComposer\\Plugin"
},
"autoload": {
"psr-4": {
"EasyWeChatComposer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "张铭阳",
"email": "mingyoungcheung@gmail.com"
}
],
"description": "The composer plugin for EasyWeChat",
"time": "2019-09-19T13:39:05+00:00"
},
{
"name": "endroid/qr-code",
"version": "1.9.3",
"source": {
"type": "git",
"url": "https://github.com/endroid/qr-code.git",
"reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93",
"reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93",
"shasum": ""
},
"require": {
"ext-gd": "*",
"php": ">=5.4",
"symfony/options-resolver": "^2.3|^3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.0",
"sensio/framework-extra-bundle": "^3.0",
"symfony/browser-kit": "^2.3|^3.0",
"symfony/framework-bundle": "^2.3|^3.0",
"symfony/http-kernel": "^2.3|^3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Endroid\\QrCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jeroen van den Enden",
"email": "info@endroid.nl",
"homepage": "http://endroid.nl/"
}
],
"description": "Endroid QR Code",
"homepage": "https://github.com/endroid/QrCode",
"keywords": [
"bundle",
"code",
"endroid",
"qr",
"qrcode",
"symfony"
],
"time": "2017-04-08T09:13:59+00:00"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.4.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "0895c932405407fd3a7368b6910c09a24d26db11"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11",
"reference": "0895c932405407fd3a7368b6910c09a24d26db11",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.6.1",
"php": ">=5.5"
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.1"
},
"suggest": {
"psr/log": "Required for using the Log middleware"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.3-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2019-10-23T15:58:00+00:00"
},
{
"name": "guzzlehttp/promises",
"version": "v1.3.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
"time": "2016-12-20T10:07:11+00:00"
},
{
"name": "guzzlehttp/psr7",
"version": "1.6.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "239400de7a173fe9901b9ac7c06497751f00727a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a",
"reference": "239400de7a173fe9901b9ac7c06497751f00727a",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0",
"ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"ext-zlib": "*",
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
},
"suggest": {
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Schultze",
"homepage": "https://github.com/Tobion"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
"psr-7",
"request",
"response",
"stream",
"uri",
"url"
],
"time": "2019-07-01T23:21:34+00:00"
},
{
"name": "karsonzhang/fastadmin-addons",
"version": "1.1.9",
"source": {
"type": "git",
"url": "https://github.com/karsonzhang/fastadmin-addons.git",
"reference": "c539b1c4aa99ea8c453cbd3a838f523136bc118a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/karsonzhang/fastadmin-addons/zipball/c539b1c4aa99ea8c453cbd3a838f523136bc118a",
"reference": "c539b1c4aa99ea8c453cbd3a838f523136bc118a",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"topthink/think-helper": ">=1.0.4",
"topthink/think-installer": ">=1.0.10"
},
"type": "library",
"extra": {
"think-config": {
"addons": "src/config.php"
}
},
"autoload": {
"psr-4": {
"think\\": "src/"
},
"files": [
"src/common.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "xiaobo.sun",
"email": "xiaobo.sun@qq.com"
},
{
"name": "karsonzhang",
"email": "karsonzhang@163.com"
}
],
"description": "addons package for fastadmin",
"homepage": "https://github.com/karsonzhang/fastadmin-addons",
"time": "2019-06-11T09:05:52+00:00"
},
{
"name": "markbaker/complex",
"version": "1.4.7",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
"reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
"shasum": ""
},
"require": {
"php": "^5.6.0|^7.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
"phpcompatibility/php-compatibility": "^8.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "2.*",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^4.8.35|^5.4.0",
"sebastian/phpcpd": "2.*",
"squizlabs/php_codesniffer": "^3.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
},
"files": [
"classes/src/functions/abs.php",
"classes/src/functions/acos.php",
"classes/src/functions/acosh.php",
"classes/src/functions/acot.php",
"classes/src/functions/acoth.php",
"classes/src/functions/acsc.php",
"classes/src/functions/acsch.php",
"classes/src/functions/argument.php",
"classes/src/functions/asec.php",
"classes/src/functions/asech.php",
"classes/src/functions/asin.php",
"classes/src/functions/asinh.php",
"classes/src/functions/atan.php",
"classes/src/functions/atanh.php",
"classes/src/functions/conjugate.php",
"classes/src/functions/cos.php",
"classes/src/functions/cosh.php",
"classes/src/functions/cot.php",
"classes/src/functions/coth.php",
"classes/src/functions/csc.php",
"classes/src/functions/csch.php",
"classes/src/functions/exp.php",
"classes/src/functions/inverse.php",
"classes/src/functions/ln.php",
"classes/src/functions/log2.php",
"classes/src/functions/log10.php",
"classes/src/functions/negative.php",
"classes/src/functions/pow.php",
"classes/src/functions/rho.php",
"classes/src/functions/sec.php",
"classes/src/functions/sech.php",
"classes/src/functions/sin.php",
"classes/src/functions/sinh.php",
"classes/src/functions/sqrt.php",
"classes/src/functions/tan.php",
"classes/src/functions/tanh.php",
"classes/src/functions/theta.php",
"classes/src/operations/add.php",
"classes/src/operations/subtract.php",
"classes/src/operations/multiply.php",
"classes/src/operations/divideby.php",
"classes/src/operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"time": "2018-10-13T23:28:42+00:00"
},
{
"name": "markbaker/matrix",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "6ea97472b5baf12119b4f31f802835b820dd6d64"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/6ea97472b5baf12119b4f31f802835b820dd6d64",
"reference": "6ea97472b5baf12119b4f31f802835b820dd6d64",
"shasum": ""
},
"require": {
"php": "^5.6.0|^7.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
"phpcompatibility/php-compatibility": "^8.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "2.*",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^4.8.35|^5.4.0",
"sebastian/phpcpd": "2.*",
"squizlabs/php_codesniffer": "^3.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
},
"files": [
"classes/src/functions/adjoint.php",
"classes/src/functions/antidiagonal.php",
"classes/src/functions/cofactors.php",
"classes/src/functions/determinant.php",
"classes/src/functions/diagonal.php",
"classes/src/functions/identity.php",
"classes/src/functions/inverse.php",
"classes/src/functions/minors.php",
"classes/src/functions/trace.php",
"classes/src/functions/transpose.php",
"classes/src/operations/add.php",
"classes/src/operations/directsum.php",
"classes/src/operations/subtract.php",
"classes/src/operations/multiply.php",
"classes/src/operations/divideby.php",
"classes/src/operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"time": "2018-11-04T22:12:12+00:00"
},
{
"name": "monolog/monolog",
"version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "f9d56fd2f5533322caccdfcddbb56aedd622ef1c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f9d56fd2f5533322caccdfcddbb56aedd622ef1c",
"reference": "f9d56fd2f5533322caccdfcddbb56aedd622ef1c",
"shasum": ""
},
"require": {
"php": "^7.2",
"psr/log": "^1.0.1"
},
"provide": {
"psr/log-implementation": "1.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^6.0",
"graylog2/gelf-php": "^1.4.2",
"jakub-onderka/php-parallel-lint": "^0.9",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"phpspec/prophecy": "^1.6.1",
"phpunit/phpunit": "^8.3",
"predis/predis": "^1.1",
"rollbar/rollbar": "^1.3",
"ruflin/elastica": ">=0.90 <3.0",
"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",
"elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mbstring": "Allow to work properly with unicode symbols",
"ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)",
"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"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"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": "2019-11-13T10:27:43+00:00"
},
{
"name": "mtdowling/cron-expression",
"version": "v1.2.1",
"source": {
"type": "git",
"url": "https://github.com/mtdowling/cron-expression.git",
"reference": "9504fa9ea681b586028adaaa0877db4aecf32bad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad",
"reference": "9504fa9ea681b586028adaaa0877db4aecf32bad",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Cron\\": "src/Cron/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due",
"keywords": [
"cron",
"schedule"
],
"time": "2017-01-23T04:29:33+00:00"
},
{
"name": "overtrue/pinyin",
"version": "3.0.6",
"source": {
"type": "git",
"url": "https://github.com/overtrue/pinyin.git",
"reference": "3b781d267197b74752daa32814d3a2cf5d140779"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/overtrue/pinyin/zipball/3b781d267197b74752daa32814d3a2cf5d140779",
"reference": "3b781d267197b74752daa32814d3a2cf5d140779",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "~4.8"
},
"type": "library",
"autoload": {
"psr-4": {
"Overtrue\\Pinyin\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Carlos",
"homepage": "http://github.com/overtrue"
}
],
"description": "Chinese to pinyin translator.",
"homepage": "https://github.com/overtrue/pinyin",
"keywords": [
"Chinese",
"Pinyin",
"cn2pinyin"
],
"time": "2017-07-10T07:20:01+00:00"
},
{
"name": "overtrue/socialite",
"version": "2.0.12",
"source": {
"type": "git",
"url": "https://github.com/overtrue/socialite.git",
"reference": "f182ae99bf85e191982b68fcd02e464acaa72888"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/overtrue/socialite/zipball/f182ae99bf85e191982b68fcd02e464acaa72888",
"reference": "f182ae99bf85e191982b68fcd02e464acaa72888",
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "~5.0|~6.0",
"php": ">=7.0",
"symfony/http-foundation": "^2.7|^3.0|^4.0"
},
"conflict": {
"socialiteproviders/weixin": "*"
},
"require-dev": {
"mockery/mockery": "~1.2",
"phpunit/phpunit": "~6"
},
"type": "library",
"autoload": {
"psr-4": {
"Overtrue\\Socialite\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "overtrue",
"email": "anzhengchao@gmail.com"
}
],
"description": "A collection of OAuth 2 packages that extracts from laravel/socialite.",
"keywords": [
"login",
"oauth",
"qq",
"social",
"wechat",
"weibo"
],
"time": "2019-10-24T11:12:17+00:00"
},
{
"name": "overtrue/wechat",
"version": "4.2.8",
"source": {
"type": "git",
"url": "https://github.com/overtrue/wechat.git",
"reference": "d8d68636d02d1c51d0edd7aaa854813f6747bf8d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/overtrue/wechat/zipball/d8d68636d02d1c51d0edd7aaa854813f6747bf8d",
"reference": "d8d68636d02d1c51d0edd7aaa854813f6747bf8d",
"shasum": ""
},
"require": {
"easywechat-composer/easywechat-composer": "^1.1",
"ext-fileinfo": "*",
"ext-openssl": "*",
"ext-simplexml": "*",
"guzzlehttp/guzzle": "^6.2",
"monolog/monolog": "^1.22 || ^2.0",
"overtrue/socialite": "~2.0",
"php": ">=7.1",
"pimple/pimple": "^3.0",
"psr/simple-cache": "^1.0",
"symfony/cache": "^3.3 || ^4.3",
"symfony/event-dispatcher": "^4.3",
"symfony/http-foundation": "^2.7 || ^3.0 || ^4.0",
"symfony/psr-http-message-bridge": "^0.3 || ^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15",
"mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.2.3",
"phpstan/phpstan": "^0.11.12",
"phpunit/phpunit": "^7.5"
},
"type": "library",
"autoload": {
"psr-4": {
"EasyWeChat\\": "src/"
},
"files": [
"src/Kernel/Support/Helpers.php",
"src/Kernel/Helpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "overtrue",
"email": "anzhengchao@gmail.com"
}
],
"description": "微信SDK",
"keywords": [
"sdk",
"wechat",
"weixin",
"weixin-sdk"
],
"time": "2019-11-08T10:32:21+00:00"
},
{
"name": "phpmailer/phpmailer",
"version": "v5.2.27",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "dde1db116511aa4956389d75546c5be4c2beb2a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/dde1db116511aa4956389d75546c5be4c2beb2a6",
"reference": "dde1db116511aa4956389d75546c5be4c2beb2a6",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"php": ">=5.0.0"
},
"require-dev": {
"doctrine/annotations": "1.2.*",
"jms/serializer": "0.16.*",
"phpdocumentor/phpdocumentor": "2.*",
"phpunit/phpunit": "4.8.*",
"symfony/debug": "2.8.*",
"symfony/filesystem": "2.8.*",
"symfony/translation": "2.8.*",
"symfony/yaml": "2.8.*",
"zendframework/zend-cache": "2.5.1",
"zendframework/zend-config": "2.5.1",
"zendframework/zend-eventmanager": "2.5.1",
"zendframework/zend-filter": "2.5.1",
"zendframework/zend-i18n": "2.5.1",
"zendframework/zend-json": "2.5.1",
"zendframework/zend-math": "2.5.1",
"zendframework/zend-serializer": "2.5.*",
"zendframework/zend-servicemanager": "2.5.*",
"zendframework/zend-stdlib": "2.5.1"
},
"suggest": {
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
},
"type": "library",
"autoload": {
"classmap": [
"class.phpmailer.php",
"class.phpmaileroauth.php",
"class.phpmaileroauthgoogle.php",
"class.smtp.php",
"class.pop3.php",
"extras/EasyPeasyICS.php",
"extras/ntlm_sasl_client.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "Jim Jagielski",
"email": "jimjag@gmail.com"
},
{
"name": "Marcus Bointon",
"email": "phpmailer@synchromedia.co.uk"
},
{
"name": "Andy Prevost",
"email": "codeworxtech@users.sourceforge.net"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2018-11-15T22:32:31+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.8.1",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "352c7002fefe4e4037d02654d853a1b09520946f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/352c7002fefe4e4037d02654d853a1b09520946f",
"reference": "352c7002fefe4e4037d02654d853a1b09520946f",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"markbaker/complex": "^1.4",
"markbaker/matrix": "^1.1",
"php": "^5.6|^7.0",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"doctrine/instantiator": "^1.0.0",
"dompdf/dompdf": "^0.8.0",
"friendsofphp/php-cs-fixer": "@stable",
"jpgraph/jpgraph": "^4.0",
"mpdf/mpdf": "^7.0.0",
"phpcompatibility/php-compatibility": "^8.0",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3.3",
"tecnickcom/tcpdf": "^6.2"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
},
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"time": "2019-07-01T20:46:51+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": ""
},
"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/cache",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/cache.git",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Cache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for caching libraries",
"keywords": [
"cache",
"psr",
"psr-6"
],
"time": "2016-08-06T20:24:11+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"time": "2017-02-14T16:28:37+00:00"
},
{
"name": "psr/http-message",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06T14:39:51+00:00"
},
{
"name": "psr/log",
"version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801",
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.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": "2019-11-01T11:05:21+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": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
],
"time": "2017-10-23T01:57:42+00:00"
},
{
"name": "ralouphie/getallheaders",
"version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/ralouphie/getallheaders.git",
"reference": "120b605dfeb996808c31b6477290a714d356e822"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
"reference": "120b605dfeb996808c31b6477290a714d356e822",
"shasum": ""
},
"require": {
"php": ">=5.6"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.1",
"phpunit/phpunit": "^5 || ^6.5"
},
"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": "2019-03-08T08:55:37+00:00"
},
{
"name": "symfony/cache",
"version": "v4.3.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
"reference": "83dca34362a0aba2b93aa1226dac6ef7cfea1262"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/83dca34362a0aba2b93aa1226dac6ef7cfea1262",
"reference": "83dca34362a0aba2b93aa1226dac6ef7cfea1262",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/cache": "~1.0",
"psr/log": "~1.0",
"symfony/cache-contracts": "^1.1",
"symfony/service-contracts": "^1.1",
"symfony/var-exporter": "^4.2"
},
"conflict": {
"doctrine/dbal": "<2.5",
"symfony/dependency-injection": "<3.4",
"symfony/var-dumper": "<3.4"
},
"provide": {
"psr/cache-implementation": "1.0",
"psr/simple-cache-implementation": "1.0",
"symfony/cache-implementation": "1.0"
},
"require-dev": {
"cache/integration-tests": "dev-master",
"doctrine/cache": "~1.6",
"doctrine/dbal": "~2.5",
"predis/predis": "~1.1",
"psr/simple-cache": "^1.0",
"symfony/config": "~4.2",
"symfony/dependency-injection": "~3.4|~4.1",
"symfony/var-dumper": "^4.1.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Cache\\": ""
},
"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": "Symfony Cache component with PSR-6, PSR-16, and tags",
"homepage": "https://symfony.com",
"keywords": [
"caching",
"psr6"
],
"time": "2019-11-12T13:07:20+00:00"
},
{
"name": "symfony/cache-contracts",
"version": "v1.1.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache-contracts.git",
"reference": "af50d14ada9e4e82cfabfabdc502d144f89be0a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/cache-contracts/zipball/af50d14ada9e4e82cfabfabdc502d144f89be0a1",
"reference": "af50d14ada9e4e82cfabfabdc502d144f89be0a1",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/cache": "^1.0"
},
"suggest": {
"symfony/cache-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Cache\\": ""
}
},
"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": "Generic abstractions related to caching",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"time": "2019-10-04T21:43:27+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v4.3.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "0df002fd4f500392eabd243c2947061a50937287"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0df002fd4f500392eabd243c2947061a50937287",
"reference": "0df002fd4f500392eabd243c2947061a50937287",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/event-dispatcher-contracts": "^1.1"
},
"conflict": {
"symfony/dependency-injection": "<3.4"
},
"provide": {
"psr/event-dispatcher-implementation": "1.0",
"symfony/event-dispatcher-implementation": "1.1"
},
"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/http-foundation": "^3.4|^4.0",
"symfony/service-contracts": "^1.1",
"symfony/stopwatch": "~3.4|~4.0"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-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-11-03T09:04:05+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
"version": "v1.1.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
"reference": "c43ab685673fb6c8d84220c77897b1d6cdbe1d18"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c43ab685673fb6c8d84220c77897b1d6cdbe1d18",
"reference": "c43ab685673fb6c8d84220c77897b1d6cdbe1d18",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"suggest": {
"psr/event-dispatcher": "",
"symfony/event-dispatcher-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\EventDispatcher\\": ""
}
},
"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": "Generic abstractions related to dispatching event",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"time": "2019-09-17T09:54:03+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v4.3.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "cabe67275034e173350e158f3b1803d023880227"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/cabe67275034e173350e158f3b1803d023880227",
"reference": "cabe67275034e173350e158f3b1803d023880227",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/mime": "^4.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.3-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-11-12T13:07:20+00:00"
},
{
"name": "symfony/mime",
"version": "v4.3.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "22aecf6b11638ef378fab25d6c5a2da8a31a1448"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/22aecf6b11638ef378fab25d6c5a2da8a31a1448",
"reference": "22aecf6b11638ef378fab25d6c5a2da8a31a1448",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-intl-idn": "^1.10",
"symfony/polyfill-mbstring": "^1.0"
},
"require-dev": {
"egulias/email-validator": "^2.1.10",
"symfony/dependency-injection": "~3.4|^4.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Mime\\": ""
},
"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": "A library to manipulate MIME messages",
"homepage": "https://symfony.com",
"keywords": [
"mime",
"mime-type"
],
"time": "2019-11-12T13:10:02+00:00"
},
{
"name": "symfony/options-resolver",
"version": "v3.4.29",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "ed3b397f9c07c8ca388b2a1ef744403b4d4ecc44"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/ed3b397f9c07c8ca388b2a1ef744403b4d4ecc44",
"reference": "ed3b397f9c07c8ca388b2a1ef744403b4d4ecc44",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\OptionsResolver\\": ""
},
"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 OptionsResolver Component",
"homepage": "https://symfony.com",
"keywords": [
"config",
"configuration",
"options"
],
"time": "2019-04-10T16:00:48+00:00"
},
{
"name": "symfony/polyfill-intl-idn",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6af626ae6fa37d396dc90a399c0ff08e5cfc45b2",
"reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php72": "^1.9"
},
"suggest": {
"ext-intl": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Intl\\Idn\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Laurent Bassin",
"email": "laurent@bassin.info"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"idn",
"intl",
"polyfill",
"portable",
"shim"
],
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"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": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.12.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "04ce3335667451138df4307d6a9b61565560199e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e",
"reference": "04ce3335667451138df4307d6a9b61565560199e",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php72\\": ""
},
"files": [
"bootstrap.php"
]
},
"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": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2019-08-06T08:03:45+00:00"
},
{
"name": "symfony/psr-http-message-bridge",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/psr-http-message-bridge.git",
"reference": "9ab9d71f97d5c7d35a121a7fb69f74fee95cd0ad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/9ab9d71f97d5c7d35a121a7fb69f74fee95cd0ad",
"reference": "9ab9d71f97d5c7d35a121a7fb69f74fee95cd0ad",
"shasum": ""
},
"require": {
"php": "^7.1",
"psr/http-message": "^1.0",
"symfony/http-foundation": "^3.4 || ^4.0"
},
"require-dev": {
"nyholm/psr7": "^1.1",
"symfony/phpunit-bridge": "^3.4.20 || ^4.0",
"zendframework/zend-diactoros": "^1.4.1 || ^2.0"
},
"suggest": {
"nyholm/psr7": "For a super lightweight PSR-7/17 implementation"
},
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Bridge\\PsrHttpMessage\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "PSR HTTP message bridge",
"homepage": "http://symfony.com",
"keywords": [
"http",
"http-message",
"psr-17",
"psr-7"
],
"time": "2019-03-11T18:22:33+00:00"
},
{
"name": "symfony/service-contracts",
"version": "v1.1.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf",
"reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/container": "^1.0"
},
"suggest": {
"symfony/service-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Service\\": ""
}
},
"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": "Generic abstractions related to writing services",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"time": "2019-10-14T12:27:06+00:00"
},
{
"name": "symfony/var-exporter",
"version": "v4.3.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
"reference": "097aa4c02954dabe9d508229be86213723973ac0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/097aa4c02954dabe9d508229be86213723973ac0",
"reference": "097aa4c02954dabe9d508229be86213723973ac0",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"require-dev": {
"symfony/var-dumper": "^4.1.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\VarExporter\\": ""
},
"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 blend of var_export() + serialize() to turn any serializable data structure to plain PHP code",
"homepage": "https://symfony.com",
"keywords": [
"clone",
"construct",
"export",
"hydrate",
"instantiate",
"serialize"
],
"time": "2019-11-11T12:48:54+00:00"
},
{
"name": "topthink/framework",
"version": "v5.0.24",
"source": {
"type": "git",
"url": "https://github.com/top-think/framework.git",
"reference": "c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be",
"reference": "c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"topthink/think-installer": "~1.0"
},
"require-dev": {
"johnkary/phpunit-speedtrap": "^1.0",
"mikey179/vfsstream": "~1.6",
"phpdocumentor/reflection-docblock": "^2.0",
"phploc/phploc": "2.*",
"phpunit/phpunit": "4.8.*",
"sebastian/phpcpd": "2.*"
},
"type": "think-framework",
"autoload": {
"psr-4": {
"think\\": "library/think"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "liu21st",
"email": "liu21st@gmail.com"
}
],
"description": "the new thinkphp framework",
"homepage": "http://thinkphp.cn/",
"keywords": [
"framework",
"orm",
"thinkphp"
],
"time": "2019-01-11T08:04:58+00:00"
},
{
"name": "topthink/think-captcha",
"version": "v1.0.8",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-captcha.git",
"reference": "1d64363c814c92f6086c4fa5e3223fe7e23db09d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-captcha/zipball/1d64363c814c92f6086c4fa5e3223fe7e23db09d",
"reference": "1d64363c814c92f6086c4fa5e3223fe7e23db09d",
"shasum": ""
},
"require": {
"topthink/framework": "~5.0.0",
"topthink/think-installer": ">=1.0.10"
},
"type": "library",
"autoload": {
"psr-4": {
"think\\captcha\\": "src/"
},
"files": [
"src/helper.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "yunwuxin",
"email": "448901948@qq.com"
}
],
"description": "captcha package for thinkphp5",
"time": "2019-01-28T04:48:36+00:00"
},
{
"name": "topthink/think-helper",
"version": "v3.0.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-helper.git",
"reference": "8ba5f66e68106369fcc3211e7d2dbaf7bc9ce455"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-helper/zipball/8ba5f66e68106369fcc3211e7d2dbaf7bc9ce455",
"reference": "8ba5f66e68106369fcc3211e7d2dbaf7bc9ce455",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-4": {
"think\\helper\\": "src"
},
"files": [
"src/helper.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "yunwuxin",
"email": "448901948@qq.com"
}
],
"description": "The ThinkPHP5 Helper Package",
"time": "2019-03-14T09:28:59+00:00"
},
{
"name": "topthink/think-installer",
"version": "v1.0.12",
"source": {
"type": "git",
"url": "https://github.com/top-think/think-installer.git",
"reference": "1be326e68f63de4e95977ed50f46ae75f017556d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-installer/zipball/1be326e68f63de4e95977ed50f46ae75f017556d",
"reference": "1be326e68f63de4e95977ed50f46ae75f017556d",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0"
},
"require-dev": {
"composer/composer": "1.0.*@dev"
},
"type": "composer-plugin",
"extra": {
"class": "think\\composer\\Plugin"
},
"autoload": {
"psr-4": {
"think\\composer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "yunwuxin",
"email": "448901948@qq.com"
}
],
"time": "2017-05-27T06:58:09+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.6.0"
},
"platform-dev": []
}
... ...
.idea/
/vendor
composer.lock
extensions.php
.php_cs.cache
... ...
<?php
$header = <<<EOF
This file is part of the EasyWeChatComposer.
(c) 张铭阳 <mingyoungcheung@gmail.com>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'header_comment' => ['header' => $header],
'declare_strict_types' => true,
'ordered_imports' => true,
'strict_comparison' => true,
'no_empty_comment' => false,
'yoda_style' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->notPath('src/Laravel/config.php', 'src/Laravel/routes.php')
->in(__DIR__)
)
;
... ...
language: php
php:
- 7.0
- 7.1
- 7.2
- 7.3
install:
- travis_retry composer install --no-interaction --no-suggest
script: ./vendor/bin/phpunit
... ...
MIT License
Copyright (c) 张铭阳
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
... ...
<p align="center">
<h1 align="center">EasyWeChat Composer Plugin</h1>
</p>
<p align="center">
<a href="https://travis-ci.org/mingyoung/easywechat-composer"><img src="https://travis-ci.org/mingyoung/easywechat-composer.svg" alt="Build Status"></a>
<a href="https://scrutinizer-ci.com/g/mingyoung/easywechat-composer/?branch=master"><img src="https://scrutinizer-ci.com/g/mingyoung/easywechat-composer/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality"></a>
<a href="https://packagist.org/packages/easywechat-composer/easywechat-composer"><img src="https://poser.pugx.org/easywechat-composer/easywechat-composer/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/easywechat-composer/easywechat-composer"><img src="https://poser.pugx.org/easywechat-composer/easywechat-composer/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/easywechat-composer/easywechat-composer"><img src="https://poser.pugx.org/easywechat-composer/easywechat-composer/license.svg" alt="License"></a>
</p>
Usage
---
Set the `type` to be `easywechat-extension` in your package composer.json file:
```json
{
"name": "your/package",
"type": "easywechat-extension"
}
```
Specify server observer classes in the extra section:
```json
{
"name": "your/package",
"type": "easywechat-extension",
"extra": {
"observers": [
"Acme\\Observers\\Handler"
]
}
}
```
Examples
---
* [easywechat-composer/open-platform-testcase](https://github.com/mingyoung/open-platform-testcase)
Server Delegation
---
> 目前仅支持 Laravel
1.`config/app.php` 中添加 `EasyWeChatComposer\Laravel\ServiceProvider::class`
2.**本地项目**`.env` 文件中添加如下配置:
```
EASYWECHAT_DELEGATION=true # false 则不启用
EASYWECHAT_DELEGATION_HOST=https://example.com # 线上域名
```
... ...
{
"name": "easywechat-composer/easywechat-composer",
"description": "The composer plugin for EasyWeChat",
"type": "composer-plugin",
"license": "MIT",
"authors": [
{
"name": "张铭阳",
"email": "mingyoungcheung@gmail.com"
}
],
"require": {
"php": ">=7.0",
"composer-plugin-api": "^1.0"
},
"require-dev": {
"composer/composer": "^1.0",
"phpunit/phpunit": "^6.5 || ^7.0"
},
"autoload": {
"psr-4": {
"EasyWeChatComposer\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"EasyWeChatComposer\\Tests\\": "tests/"
}
},
"extra": {
"class": "EasyWeChatComposer\\Plugin"
},
"minimum-stability": "dev",
"prefer-stable": true
}
... ...
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuite name="EasyWeChatComposer Test">
<directory suffix="Test.php">tests</directory>
</testsuite>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Commands;
use Composer\Command\BaseCommand;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ExtensionsCommand extends BaseCommand
{
/**
* Configures the current command.
*/
protected function configure()
{
$this->setName('easywechat:extensions')
->setDescription('Lists all installed extensions.');
}
/**
* Executes the current command.
*
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$extensions = require __DIR__.'/../../extensions.php';
if (empty($extensions) || !is_array($extensions)) {
return $output->writeln('<info>No extension installed.</info>');
}
$table = new Table($output);
$table->setHeaders(['Name', 'Observers'])
->setRows(
array_map([$this, 'getRows'], array_keys($extensions), $extensions)
)->render();
}
/**
* @param string $name
* @param array $extension
*
* @return array
*/
protected function getRows($name, $extension)
{
return [$name, implode("\n", $extension['observers'] ?? [])];
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Commands;
use Composer\Plugin\Capability\CommandProvider;
class Provider implements CommandProvider
{
/**
* Retrieves an array of commands.
*
* @return \Composer\Command\BaseCommand[]
*/
public function getCommands()
{
return [
new ExtensionsCommand(),
];
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Contracts;
interface Encrypter
{
/**
* Encrypt the given value.
*
* @param string $value
*
* @return string
*/
public function encrypt($value);
/**
* Decrypt the given value.
*
* @param string $payload
*
* @return string
*/
public function decrypt($payload);
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Delegation;
use EasyWeChatComposer\EasyWeChat;
class DelegationOptions
{
/**
* @var array
*/
protected $config = [
'enabled' => false,
];
/**
* @return $this
*/
public function enable()
{
$this->config['enabled'] = true;
return $this;
}
/**
* @return $this
*/
public function disable()
{
$this->config['enabled'] = false;
return $this;
}
/**
* @param bool $ability
*
* @return $this
*/
public function ability($ability)
{
$this->config['enabled'] = (bool) $ability;
return $this;
}
/**
* @param string $host
*
* @return $this
*/
public function toHost($host)
{
$this->config['host'] = $host;
return $this;
}
/**
* Destructor.
*/
public function __destruct()
{
EasyWeChat::mergeConfig([
'delegation' => $this->config,
]);
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Delegation;
use EasyWeChatComposer\Traits\MakesHttpRequests;
class DelegationTo
{
use MakesHttpRequests;
/**
* @var \EasyWeChat\Kernel\ServiceContainer
*/
protected $app;
/**
* @var array
*/
protected $identifiers = [];
/**
* @param \EasyWeChat\Kernel\ServiceContainer $app
* @param string $identifier
*/
public function __construct($app, $identifier)
{
$this->app = $app;
$this->push($identifier);
}
/**
* @param string $identifier
*/
public function push($identifier)
{
$this->identifiers[] = $identifier;
}
/**
* @param string $identifier
*
* @return $this
*/
public function __get($identifier)
{
$this->push($identifier);
return $this;
}
/**
* @param string $method
* @param array $arguments
*
* @return mixed
*/
public function __call($method, $arguments)
{
$config = array_intersect_key($this->app->getConfig(), array_flip(['app_id', 'secret', 'token', 'aes_key', 'response_type', 'component_app_id', 'refresh_token']));
$data = [
'config' => $config,
'application' => get_class($this->app),
'identifiers' => $this->identifiers,
'method' => $method,
'arguments' => $arguments,
];
return $this->request('easywechat-composer/delegate', $data);
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Delegation;
use EasyWeChat;
use EasyWeChatComposer\Http\DelegationResponse;
class Hydrate
{
/**
* @var array
*/
protected $attributes;
/**
* @param array $attributes
*/
public function __construct(array $attributes)
{
$this->attributes = $attributes;
}
/**
* @return array
*/
public function handle()
{
$app = $this->createsApplication()->shouldntDelegate();
foreach ($this->attributes['identifiers'] as $identifier) {
$app = $app->$identifier;
}
return call_user_func_array([$app, $this->attributes['method']], $this->attributes['arguments']);
}
/**
* @return \EasyWeChat\Kernel\ServiceContainer
*/
protected function createsApplication()
{
$application = $this->attributes['application'];
if ($application === EasyWeChat\OpenPlatform\Authorizer\OfficialAccount\Application::class) {
return $this->createsOpenPlatformApplication('officialAccount');
}
if ($application === EasyWeChat\OpenPlatform\Authorizer\MiniProgram\Application::class) {
return $this->createsOpenPlatformApplication('miniProgram');
}
return new $application($this->buildConfig($this->attributes['config']));
}
protected function createsOpenPlatformApplication($type)
{
$config = $this->attributes['config'];
$authorizerAppId = $config['app_id'];
$config['app_id'] = $config['component_app_id'];
return EasyWeChat\Factory::openPlatform($this->buildConfig($config))->$type($authorizerAppId, $config['refresh_token']);
}
protected function buildConfig(array $config)
{
$config['response_type'] = DelegationResponse::class;
return $config;
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer;
use EasyWeChatComposer\Delegation\DelegationOptions;
class EasyWeChat
{
/**
* @var array
*/
protected static $config = [];
/**
* Encryption key.
*
* @var string
*/
protected static $encryptionKey;
/**
* @param array $config
*/
public static function mergeConfig(array $config)
{
static::$config = array_merge(static::$config, $config);
}
/**
* @return array
*/
public static function config()
{
return static::$config;
}
/**
* Set encryption key.
*
* @param string $key
*
* @return static
*/
public static function setEncryptionKey(string $key)
{
static::$encryptionKey = $key;
return new static();
}
/**
* Get encryption key.
*
* @return string
*/
public static function getEncryptionKey(): string
{
return static::$encryptionKey;
}
/**
* @return \EasyWeChatComposer\Delegation\DelegationOptions
*/
public static function withDelegation()
{
return new DelegationOptions();
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Encryption;
use EasyWeChatComposer\Contracts\Encrypter;
use EasyWeChatComposer\Exceptions\DecryptException;
use EasyWeChatComposer\Exceptions\EncryptException;
class DefaultEncrypter implements Encrypter
{
/**
* @var string
*/
protected $key;
/**
* @var string
*/
protected $cipher;
/**
* @param string $key
* @param string $cipher
*/
public function __construct($key, $cipher = 'AES-256-CBC')
{
$this->key = $key;
$this->cipher = $cipher;
}
/**
* Encrypt the given value.
*
* @param string $value
*
* @return string
*
* @throws \EasyWeChatComposer\Exceptions\EncryptException
*/
public function encrypt($value)
{
$iv = random_bytes(openssl_cipher_iv_length($this->cipher));
$value = openssl_encrypt($value, $this->cipher, $this->key, 0, $iv);
if ($value === false) {
throw new EncryptException('Could not encrypt the data.');
}
$iv = base64_encode($iv);
return base64_encode(json_encode(compact('iv', 'value')));
}
/**
* Decrypt the given value.
*
* @param string $payload
*
* @return string
*
* @throws \EasyWeChatComposer\Exceptions\DecryptException
*/
public function decrypt($payload)
{
$payload = json_decode(base64_decode($payload), true);
$iv = base64_decode($payload['iv']);
$decrypted = openssl_decrypt($payload['value'], $this->cipher, $this->key, 0, $iv);
if ($decrypted === false) {
throw new DecryptException('Could not decrypt the data.');
}
return $decrypted;
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Exceptions;
use Exception;
class DecryptException extends Exception
{
//
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Exceptions;
use Exception;
class DelegationException extends Exception
{
/**
* @var string
*/
protected $exception;
/**
* @param string $exception
*/
public function setException($exception)
{
$this->exception = $exception;
return $this;
}
/**
* @return string
*/
public function getException()
{
return $this->exception;
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Exceptions;
use Exception;
class EncryptException extends Exception
{
//
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer;
use EasyWeChat\Kernel\Contracts\EventHandlerInterface;
use Pimple\Container;
use ReflectionClass;
class Extension
{
/**
* @var \Pimple\Container
*/
protected $app;
/**
* @var string
*/
protected $manifestPath;
/**
* @var array|null
*/
protected $manifest;
/**
* @param \Pimple\Container $app
*/
public function __construct(Container $app)
{
$this->app = $app;
$this->manifestPath = __DIR__.'/../extensions.php';
}
/**
* Get observers.
*
* @return array
*/
public function observers(): array
{
if ($this->shouldIgnore()) {
return [];
}
$observers = [];
foreach ($this->getManifest() as $name => $extra) {
$observers = array_merge($observers, $extra['observers'] ?? []);
}
return array_map([$this, 'listObserver'], array_filter($observers, [$this, 'validateObserver']));
}
/**
* @param mixed $observer
*
* @return bool
*/
protected function isDisable($observer): bool
{
return in_array($observer, $this->app->config->get('disable_observers', []));
}
/**
* Get the observers should be ignore.
*
* @return bool
*/
protected function shouldIgnore(): bool
{
return !file_exists($this->manifestPath) || $this->isDisable('*');
}
/**
* Validate the given observer.
*
* @param mixed $observer
*
* @return bool
*
* @throws \ReflectionException
*/
protected function validateObserver($observer): bool
{
return !$this->isDisable($observer)
&& (new ReflectionClass($observer))->implementsInterface(EventHandlerInterface::class)
&& $this->accessible($observer);
}
/**
* Determine whether the given observer is accessible.
*
* @param string $observer
*
* @return bool
*/
protected function accessible($observer): bool
{
if (!method_exists($observer, 'getAccessor')) {
return true;
}
return in_array(get_class($this->app), (array) $observer::getAccessor());
}
/**
* @param mixed $observer
*
* @return array
*/
protected function listObserver($observer): array
{
$condition = method_exists($observer, 'onCondition') ? $observer::onCondition() : '*';
return [$observer, $condition];
}
/**
* Get the easywechat manifest.
*
* @return array
*/
protected function getManifest(): array
{
if (!is_null($this->manifest)) {
return $this->manifest;
}
return $this->manifest = file_exists($this->manifestPath) ? require $this->manifestPath : [];
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Http;
class DelegationResponse extends Response
{
/**
* @return string
*/
public function getBodyContents()
{
return $this->response->getBodyContents();
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Http;
use EasyWeChat\Kernel\Contracts\Arrayable;
use EasyWeChat\Kernel\Http\Response as HttpResponse;
use JsonSerializable;
class Response implements Arrayable, JsonSerializable
{
/**
* @var \EasyWeChat\Kernel\Http\Response
*/
protected $response;
/**
* @var array
*/
protected $array;
/**
* @param \EasyWeChat\Kernel\Http\Response $response
*/
public function __construct(HttpResponse $response)
{
$this->response = $response;
}
/**
* @see \ArrayAccess::offsetExists
*
* @param string $offset
*
* @return bool
*/
public function offsetExists($offset)
{
return isset($this->toArray()[$offset]);
}
/**
* @see \ArrayAccess::offsetGet
*
* @param string $offset
*
* @return mixed
*/
public function offsetGet($offset)
{
return $this->toArray()[$offset] ?? null;
}
/**
* @see \ArrayAccess::offsetSet
*
* @param string $offset
* @param mixed $value
*/
public function offsetSet($offset, $value)
{
//
}
/**
* @see \ArrayAccess::offsetUnset
*
* @param string $offset
*/
public function offsetUnset($offset)
{
//
}
/**
* Get the instance as an array.
*
* @return array
*/
public function toArray()
{
return $this->array ?: $this->array = $this->response->toArray();
}
/**
* Convert the object into something JSON serializable.
*
* @return array
*/
public function jsonSerialize()
{
return $this->toArray();
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Laravel\Http\Controllers;
use EasyWeChatComposer\Delegation\Hydrate;
use EasyWeChatComposer\Encryption\DefaultEncrypter;
use Illuminate\Http\Request;
use Throwable;
class DelegatesController
{
/**
* @param \Illuminate\Http\Request $request
* @param \EasyWeChatComposer\Encryption\DefaultEncrypter $encrypter
*
* @return \Illuminate\Http\Response
*/
public function __invoke(Request $request, DefaultEncrypter $encrypter)
{
try {
$data = json_decode($encrypter->decrypt($request->get('encrypted')), true);
$hydrate = new Hydrate($data);
$response = $hydrate->handle();
return response()->json([
'response_type' => get_class($response),
'response' => $encrypter->encrypt($response->getBodyContents()),
]);
} catch (Throwable $t) {
return [
'exception' => get_class($t),
'message' => $t->getMessage(),
];
}
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Laravel;
use EasyWeChatComposer\EasyWeChat;
use Illuminate\Support\Arr;
use EasyWeChatComposer\Encryption\DefaultEncrypter;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
use RuntimeException;
class ServiceProvider extends LaravelServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot()
{
$this->registerRoutes();
$this->publishes([
__DIR__.'/config.php' => config_path('easywechat-composer.php'),
]);
EasyWeChat::setEncryptionKey(
$defaultKey = $this->getKey()
);
EasyWeChat::withDelegation()
->toHost($this->config('delegation.host'))
->ability($this->config('delegation.enabled'));
$this->app->when(DefaultEncrypter::class)->needs('$key')->give($defaultKey);
}
/**
* Register routes.
*/
protected function registerRoutes()
{
Route::prefix('easywechat-composer')->namespace('EasyWeChatComposer\Laravel\Http\Controllers')->group(function () {
$this->loadRoutesFrom(__DIR__.'/routes.php');
});
}
/**
* Register any application services.
*/
public function register()
{
$this->configure();
}
/**
* Register config.
*/
protected function configure()
{
$this->mergeConfigFrom(
__DIR__.'/config.php', 'easywechat-composer'
);
}
/**
* Get the specified configuration value.
*
* @param string|null $key
* @param mixed $default
*
* @return mixed
*/
protected function config($key = null, $default = null)
{
$config = $this->app['config']->get('easywechat-composer');
if (is_null($key)) {
return $config;
}
return Arr::get($config, $key, $default);
}
/**
* @return string
*/
protected function getKey()
{
return $this->config('encryption.key') ?: $this->getMd5Key();
}
/**
* @return string
*/
protected function getMd5Key()
{
return Cache::remember('easywechat-composer.encryption_key', 30, function () {
throw_unless(file_exists($path = base_path('composer.lock')), RuntimeException::class, 'No encryption key provided.');
return md5_file($path);
});
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) mingyoung <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
return [
'encryption' => [
'key' => env('EASYWECHAT_KEY'),
],
'delegation' => [
'enabled' => env('EASYWECHAT_DELEGATION', false),
'host' => env('EASYWECHAT_DELEGATION_HOST'),
],
];
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
use Illuminate\Support\Facades\Route;
Route::post('delegate', 'DelegatesController');
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer;
class ManifestManager
{
const PACKAGE_TYPE = 'easywechat-extension';
const EXTRA_OBSERVER = 'observers';
/**
* The vendor path.
*
* @var string
*/
protected $vendorPath;
/**
* The manifest path.
*
* @var string
*/
protected $manifestPath;
/**
* @param string $vendorPath
* @param string|null $manifestPath
*/
public function __construct(string $vendorPath, string $manifestPath = null)
{
$this->vendorPath = $vendorPath;
$this->manifestPath = $manifestPath ?: $vendorPath.'/easywechat-composer/easywechat-composer/extensions.php';
}
/**
* Remove manifest file.
*
* @return $this
*/
public function unlink()
{
if (file_exists($this->manifestPath)) {
@unlink($this->manifestPath);
}
return $this;
}
/**
* Build the manifest file.
*/
public function build()
{
$packages = [];
if (file_exists($installed = $this->vendorPath.'/composer/installed.json')) {
$packages = json_decode(file_get_contents($installed), true);
}
$this->write($this->map($packages));
}
/**
* @param array $packages
*
* @return array
*/
protected function map(array $packages): array
{
$manifest = [];
$packages = array_filter($packages, function ($package) {
return $package['type'] === self::PACKAGE_TYPE;
});
foreach ($packages as $package) {
$manifest[$package['name']] = [self::EXTRA_OBSERVER => $package['extra'][self::EXTRA_OBSERVER] ?? []];
}
return $manifest;
}
/**
* Write the manifest array to a file.
*
* @param array $manifest
*/
protected function write(array $manifest)
{
file_put_contents(
$this->manifestPath,
'<?php return '.var_export($manifest, true).';'
);
$this->invalidate($this->manifestPath);
}
/**
* Invalidate the given file.
*
* @param string $file
*/
protected function invalidate($file)
{
if (function_exists('opcache_invalidate')) {
@opcache_invalidate($file, true);
}
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer;
use Composer\Composer;
use Composer\EventDispatcher\EventSubscriberInterface;
use Composer\Installer\PackageEvent;
use Composer\Installer\PackageEvents;
use Composer\IO\IOInterface;
use Composer\Plugin\Capable;
use Composer\Plugin\PluginInterface;
use Composer\Script\Event;
use Composer\Script\ScriptEvents;
class Plugin implements PluginInterface, EventSubscriberInterface, Capable
{
/**
* @var bool
*/
protected $activated = true;
/**
* Apply plugin modifications to Composer.
*
* @param \Composer\Composer $composer
* @param \Composer\IO\IOInterface $io
*/
public function activate(Composer $composer, IOInterface $io)
{
//
}
/**
* @return array
*/
public function getCapabilities()
{
return [
'Composer\Plugin\Capability\CommandProvider' => 'EasyWeChatComposer\Commands\Provider',
];
}
/**
* Listen events.
*
* @return array
*/
public static function getSubscribedEvents()
{
return [
PackageEvents::PRE_PACKAGE_UNINSTALL => 'prePackageUninstall',
ScriptEvents::POST_AUTOLOAD_DUMP => 'postAutoloadDump',
];
}
/**
* @param \Composer\Installer\PackageEvent
*/
public function prePackageUninstall(PackageEvent $event)
{
if ($event->getOperation()->getPackage()->getName() === 'overtrue/wechat') {
$this->activated = false;
}
}
/**
* @param \Composer\Script\Event $event
*/
public function postAutoloadDump(Event $event)
{
if (!$this->activated) {
return;
}
$manifest = new ManifestManager(
rtrim($event->getComposer()->getConfig()->get('vendor-dir'), '/')
);
$manifest->unlink()->build();
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Traits;
use EasyWeChat\Kernel\Http\StreamResponse;
use EasyWeChat\Kernel\Traits\ResponseCastable;
use EasyWeChatComposer\Contracts\Encrypter;
use EasyWeChatComposer\EasyWeChat;
use EasyWeChatComposer\Encryption\DefaultEncrypter;
use EasyWeChatComposer\Exceptions\DelegationException;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
trait MakesHttpRequests
{
use ResponseCastable;
/**
* @var \GuzzleHttp\ClientInterface
*/
protected $httpClient;
/**
* @var \EasyWeChatComposer\Contracts\Encrypter
*/
protected $encrypter;
/**
* @param string $endpoint
* @param array $payload
*
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
*
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
* @throws \GuzzleHttp\Exception\GuzzleException
*/
protected function request($endpoint, array $payload)
{
$response = $this->getHttpClient()->request('POST', $endpoint, [
'form_params' => $this->buildFormParams($payload),
]);
$parsed = $this->parseResponse($response);
return $this->detectAndCastResponseToType(
$this->getEncrypter()->decrypt($parsed['response']),
($parsed['response_type'] === StreamResponse::class) ? 'raw' : $this->app['config']['response_type']
);
}
/**
* @param array $payload
*
* @return array
*/
protected function buildFormParams($payload)
{
return [
'encrypted' => $this->getEncrypter()->encrypt(json_encode($payload)),
];
}
/**
* @param \Psr\Http\Message\ResponseInterface $response
*
* @return array
*/
protected function parseResponse($response)
{
$result = json_decode((string) $response->getBody(), true);
if (isset($result['exception'])) {
throw (new DelegationException($result['message']))->setException($result['exception']);
}
return $result;
}
/**
* @return \GuzzleHttp\ClientInterface
*/
protected function getHttpClient(): ClientInterface
{
return $this->httpClient ?: $this->httpClient = new Client([
'base_uri' => $this->app['config']['delegation']['host'],
]);
}
/**
* @return \EasyWeChatComposer\Contracts\Encrypter
*/
protected function getEncrypter(): Encrypter
{
return $this->encrypter ?: $this->encrypter = new DefaultEncrypter(
EasyWeChat::getEncryptionKey()
);
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Traits;
use EasyWeChat\Kernel\BaseClient;
use EasyWeChatComposer\Delegation\DelegationTo;
use EasyWeChatComposer\EasyWeChat;
trait WithAggregator
{
/**
* Aggregate.
*/
protected function aggregate()
{
foreach (EasyWeChat::config() as $key => $value) {
$this['config']->set($key, $value);
}
}
/**
* @return bool
*/
public function shouldDelegate($id)
{
return $this['config']->get('delegation.enabled')
&& $this->offsetGet($id) instanceof BaseClient;
}
/**
* @return $this
*/
public function shouldntDelegate()
{
$this['config']->set('delegation.enabled', false);
return $this;
}
/**
* @param string $id
*
* @return \EasyWeChatComposer\Delegation
*/
public function delegateTo($id)
{
return new DelegationTo($this, $id);
}
}
... ...
<?php
declare(strict_types=1);
/*
* This file is part of the EasyWeChatComposer.
*
* (c) 张铭阳 <mingyoungcheung@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace EasyWeChatComposer\Tests;
use EasyWeChatComposer\ManifestManager;
use PHPUnit\Framework\TestCase;
class ManifestManagerTest extends TestCase
{
private $vendorPath;
private $manifestPath;
protected function getManifestManager()
{
return new ManifestManager(
$this->vendorPath = __DIR__.'/__fixtures__/vendor/',
$this->manifestPath = __DIR__.'/__fixtures__/extensions.php'
);
}
public function testUnlink()
{
$this->assertInstanceOf(ManifestManager::class, $this->getManifestManager()->unlink());
$this->assertFalse(file_exists($this->manifestPath));
}
}
... ...
<?php
$config = PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'declare_strict_types' => false,
'concat_space' => ['spacing'=>'one'],
// 'ordered_imports' => true,
// 'phpdoc_align' => ['align'=>'vertical'],
// 'native_function_invocation' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->name('*.php')
)
;
return $config;
... ...
FROM composer:latest as setup
RUN mkdir /guzzle
WORKDIR /guzzle
RUN set -xe \
&& composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár <mark.sagikazar@gmail.com>" --no-interaction \
&& composer require guzzlehttp/guzzle
FROM php:7.3
RUN mkdir /guzzle
WORKDIR /guzzle
COPY --from=setup /guzzle /guzzle
... ...
parameters:
level: 1
paths:
- src
ignoreErrors:
-
message: '#Function uri_template not found#'
path: %currentWorkingDirectory%/src/functions.php
... ...
<?php
namespace GuzzleHttp\Exception;
final class InvalidArgumentException extends \InvalidArgumentException implements GuzzleException
{
}
... ...
### 2.0.0
- `Monolog\Logger::API` can be used to distinguish between a Monolog `1` and `2`
install of Monolog when writing integration code.
- Removed non-PSR-3 methods to add records, all the `add*` (e.g. `addWarning`)
methods as well as `emerg`, `crit`, `err` and `warn`.
- DateTime are now formatted with a timezone and microseconds (unless disabled).
Various formatters and log output might be affected, which may mess with log parsing
in some cases.
- The `datetime` in every record array is now a DateTimeImmutable, not that you
should have been modifying these anyway.
- The timezone is now set per Logger instance and not statically, either
via ->setTimezone or passed in the constructor. Calls to Logger::setTimezone
should be converted.
- `HandlerInterface` has been split off and two new interfaces now exist for
more granular controls: `ProcessableHandlerInterface` and
`FormattableHandlerInterface`. Handlers not extending `AbstractHandler`
should make sure to implement the relevant interfaces.
- `HandlerInterface` now requires the `close` method to be implemented. This
only impacts you if you implement the interface yourself, but you can extend
the new `Monolog\Handler\Handler` base class too.
- There is no more default handler configured on empty Logger instances, if
you were relying on that you will not get any output anymore, make sure to
configure the handler you need.
#### LogglyFormatter
- The records' `datetime` is not sent anymore. Only `timestamp` is sent to Loggly.
#### AmqpHandler
- Log levels are not shortened to 4 characters anymore. e.g. a warning record
will be sent using the `warning.channel` routing key instead of `warn.channel`
as in 1.x.
- The exchange name does not default to 'log' anymore, and it is completely ignored
now for the AMQP extension users. Only PHPAmqpLib uses it if provided.
#### RotatingFileHandler
- The file name format must now contain `{date}` and the date format must be set
to one of the predefined FILE_PER_* constants to avoid issues with file rotation.
See `setFilenameFormat`.
#### LogstashFormatter
- Removed Logstash V0 support
- Context/extra prefix has been removed in favor of letting users configure the exact key being sent
- Context/extra data are now sent as an object instead of single keys
#### HipChatHandler
- Removed deprecated HipChat handler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead
#### SlackbotHandler
- Removed deprecated SlackbotHandler handler, use SlackWebhookHandler or SlackHandler instead
#### RavenHandler
- Removed deprecated RavenHandler handler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead
#### ElasticSearchHandler
- As support for the official Elasticsearch library was added, the former ElasticSearchHandler has been
renamed to ElasticaHandler and the new one added as ElasticsearchHandler.
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog;
use DateTimeZone;
/**
* Overrides default json encoding of date time objects
*
* @author Menno Holtkamp
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
{
/**
* @var bool
*/
private $useMicroseconds;
public function __construct(bool $useMicroseconds, ?DateTimeZone $timezone = null)
{
$this->useMicroseconds = $useMicroseconds;
parent::__construct('now', $timezone);
}
public function jsonSerialize(): string
{
if ($this->useMicroseconds) {
return $this->format('Y-m-d\TH:i:s.uP');
}
return $this->format('Y-m-d\TH:i:sP');
}
public function __toString(): string
{
return $this->jsonSerialize();
}
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use DateTime;
/**
* Format a log message into an Elasticsearch record
*
* @author Avtandil Kikabidze <akalongman@gmail.com>
*/
class ElasticsearchFormatter extends NormalizerFormatter
{
/**
* @var string Elasticsearch index name
*/
protected $index;
/**
* @var string Elasticsearch record type
*/
protected $type;
/**
* @param string $index Elasticsearch index name
* @param string $type Elasticsearch record type
*/
public function __construct(string $index, string $type)
{
// Elasticsearch requires an ISO 8601 format date with optional millisecond precision.
parent::__construct(DateTime::ISO8601);
$this->index = $index;
$this->type = $type;
}
/**
* {@inheritdoc}
*/
public function format(array $record)
{
$record = parent::format($record);
return $this->getDocument($record);
}
/**
* Getter index
*
* @return string
*/
public function getIndex(): string
{
return $this->index;
}
/**
* Getter type
*
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* Convert a log message into an Elasticsearch record
*
* @param array $record Log message
* @return array
*/
protected function getDocument(array $record): array
{
$record['_index'] = $this->index;
$record['_type'] = $this->type;
return $record;
}
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
/**
* Encodes message information into JSON in a format compatible with Logmatic.
*
* @author Julien Breux <julien.breux@gmail.com>
*/
class LogmaticFormatter extends JsonFormatter
{
protected const MARKERS = ["sourcecode", "php"];
/**
* @var string
*/
protected $hostname = '';
/**
* @var string
*/
protected $appname = '';
public function setHostname(string $hostname): self
{
$this->hostname = $hostname;
return $this;
}
public function setAppname(string $appname): self
{
$this->appname = $appname;
return $this;
}
/**
* Appends the 'hostname' and 'appname' parameter for indexing by Logmatic.
*
* @see http://doc.logmatic.io/docs/basics-to-send-data
* @see \Monolog\Formatter\JsonFormatter::format()
*/
public function format(array $record): string
{
if (!empty($this->hostname)) {
$record["hostname"] = $this->hostname;
}
if (!empty($this->appname)) {
$record["appname"] = $this->appname;
}
$record["@marker"] = static::MARKERS;
return parent::format($record);
}
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\Formatter\FormatterInterface;
use Monolog\Formatter\ElasticaFormatter;
use Monolog\Logger;
use Elastica\Client;
use Elastica\Exception\ExceptionInterface;
/**
* Elastic Search handler
*
* Usage example:
*
* $client = new \Elastica\Client();
* $options = array(
* 'index' => 'elastic_index_name',
* 'type' => 'elastic_doc_type',
* );
* $handler = new ElasticaHandler($client, $options);
* $log = new Logger('application');
* $log->pushHandler($handler);
*
* @author Jelle Vink <jelle.vink@gmail.com>
*/
class ElasticaHandler extends AbstractProcessingHandler
{
/**
* @var Client
*/
protected $client;
/**
* @var array Handler config options
*/
protected $options = [];
/**
* @param Client $client Elastica Client object
* @param array $options Handler configuration
* @param int|string $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/
public function __construct(Client $client, array $options = [], $level = Logger::DEBUG, bool $bubble = true)
{
parent::__construct($level, $bubble);
$this->client = $client;
$this->options = array_merge(
[
'index' => 'monolog', // Elastic index name
'type' => 'record', // Elastic document type
'ignore_error' => false, // Suppress Elastica exceptions
],
$options
);
}
/**
* {@inheritDoc}
*/
protected function write(array $record): void
{
$this->bulkSend([$record['formatted']]);
}
/**
* {@inheritdoc}
*/
public function setFormatter(FormatterInterface $formatter): HandlerInterface
{
if ($formatter instanceof ElasticaFormatter) {
return parent::setFormatter($formatter);
}
throw new \InvalidArgumentException('ElasticaHandler is only compatible with ElasticaFormatter');
}
public function getOptions(): array
{
return $this->options;
}
/**
* {@inheritDoc}
*/
protected function getDefaultFormatter(): FormatterInterface
{
return new ElasticaFormatter($this->options['index'], $this->options['type']);
}
/**
* {@inheritdoc}
*/
public function handleBatch(array $records): void
{
$documents = $this->getFormatter()->formatBatch($records);
$this->bulkSend($documents);
}
/**
* Use Elasticsearch bulk API to send list of documents
* @throws \RuntimeException
*/
protected function bulkSend(array $documents): void
{
try {
$this->client->addDocuments($documents);
} catch (ExceptionInterface $e) {
if (!$this->options['ignore_error']) {
throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e);
}
}
}
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Throwable;
class FallbackGroupHandler extends GroupHandler
{
/**
* {@inheritdoc}
*/
public function handle(array $record): bool
{
if ($this->processors) {
$record = $this->processRecord($record);
}
foreach ($this->handlers as $handler) {
try {
$handler->handle($record);
break;
} catch (Throwable $e) {
// What throwable?
}
}
return false === $this->bubble;
}
/**
* {@inheritdoc}
*/
public function handleBatch(array $records): void
{
if ($this->processors) {
$processed = [];
foreach ($records as $record) {
$processed[] = $this->processRecord($record);
}
$records = $processed;
}
foreach ($this->handlers as $handler) {
try {
$handler->handleBatch($records);
break;
} catch (Throwable $e) {
// What throwable?
}
}
}
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\Formatter\FormatterInterface;
/**
* Interface to describe loggers that have a formatter
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
interface FormattableHandlerInterface
{
/**
* Sets the formatter.
*
* @param FormatterInterface $formatter
* @return HandlerInterface self
*/
public function setFormatter(FormatterInterface $formatter): HandlerInterface;
/**
* Gets the formatter.
*
* @return FormatterInterface
*/
public function getFormatter(): FormatterInterface;
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\Formatter\FormatterInterface;
use Monolog\Formatter\LineFormatter;
/**
* Helper trait for implementing FormattableInterface
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
trait FormattableHandlerTrait
{
/**
* @var FormatterInterface
*/
protected $formatter;
/**
* {@inheritdoc}
* @suppress PhanTypeMismatchReturn
*/
public function setFormatter(FormatterInterface $formatter): HandlerInterface
{
$this->formatter = $formatter;
return $this;
}
/**
* {@inheritdoc}
*/
public function getFormatter(): FormatterInterface
{
if (!$this->formatter) {
$this->formatter = $this->getDefaultFormatter();
}
return $this->formatter;
}
/**
* Gets the default formatter.
*
* Overwrite this if the LineFormatter is not a good default for your handler.
*/
protected function getDefaultFormatter(): FormatterInterface
{
return new LineFormatter();
}
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
/**
* Base Handler class providing basic close() support as well as handleBatch
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
abstract class Handler implements HandlerInterface
{
/**
* {@inheritdoc}
*/
public function handleBatch(array $records): void
{
foreach ($records as $record) {
$this->handle($record);
}
}
/**
* {@inheritdoc}
*/
public function close(): void
{
}
public function __destruct()
{
try {
$this->close();
} catch (\Throwable $e) {
// do nothing
}
}
public function __sleep()
{
$this->close();
return array_keys(get_object_vars($this));
}
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\Logger;
use Monolog\Formatter\FormatterInterface;
use Monolog\Formatter\LogmaticFormatter;
/**
* @author Julien Breux <julien.breux@gmail.com>
*/
class LogmaticHandler extends SocketHandler
{
/**
* @var string
*/
private $logToken;
/**
* @var string
*/
private $hostname;
/**
* @var string
*/
private $appname;
/**
* @param string $token Log token supplied by Logmatic.
* @param string $hostname Host name supplied by Logmatic.
* @param string $appname Application name supplied by Logmatic.
* @param bool $useSSL Whether or not SSL encryption should be used.
* @param int|string $level The minimum logging level to trigger this handler.
* @param bool $bubble Whether or not messages that are handled should bubble up the stack.
*
* @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
*/
public function __construct(string $token, string $hostname = '', string $appname = '', bool $useSSL = true, $level = Logger::DEBUG, bool $bubble = true)
{
if ($useSSL && !extension_loaded('openssl')) {
throw new MissingExtensionException('The OpenSSL PHP extension is required to use SSL encrypted connection for LogmaticHandler');
}
$endpoint = $useSSL ? 'ssl://api.logmatic.io:10515' : 'api.logmatic.io:10514';
$endpoint .= '/v1/';
parent::__construct($endpoint, $level, $bubble);
$this->logToken = $token;
$this->hostname = $hostname;
$this->appname = $appname;
}
/**
* {@inheritdoc}
*/
protected function generateDataStream(array $record): string
{
return $this->logToken . ' ' . $record['formatted'];
}
/**
* {@inheritdoc}
*/
protected function getDefaultFormatter(): FormatterInterface
{
$formatter = new LogmaticFormatter();
if (!empty($this->hostname)) {
$formatter->setHostname($this->hostname);
}
if (!empty($this->appname)) {
$formatter->setAppname($this->appname);
}
return $formatter;
}
}
... ...
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
/**
* No-op
*
* This handler handles anything, but does nothing, and does not stop bubbling to the rest of the stack.
* This can be used for testing, or to disable a handler when overriding a configuration without
* influencing the rest of the stack.
*
* @author Roel Harbers <roelharbers@gmail.com>
*/
class NoopHandler extends Handler
{
/**
* {@inheritdoc}
*/
public function isHandling(array $record): bool
{
return true;
}
/**
* {@inheritdoc}
*/
public function handle(array $record): bool
{
return false;
}
}
... ...