Commit 28f8c396 by 朱继来

监控告警

parent e6f0b724
Showing with 2935 additions and 1711 deletions
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
"justinrainbow/json-schema": "~1.3", "justinrainbow/json-schema": "~1.3",
"maatwebsite/excel": "~2.0.0", "maatwebsite/excel": "~2.0.0",
"guzzlehttp/guzzle": "^6.3", "guzzlehttp/guzzle": "^6.3",
"predis/predis": "^1.1" "predis/predis": "^1.1",
"redgo/monitor-ding": "0.2"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",
......
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "82292bc489e3c8df5d2e933e8dd8aefb", "content-hash": "eec84cd549060991f5bdb9293891bed2",
"packages": [ "packages": [
{ {
"name": "classpreloader/classpreloader", "name": "classpreloader/classpreloader",
...@@ -18,13 +18,7 @@ ...@@ -18,13 +18,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/4729e438e0ada350f91148e7d4bb9809342575ff", "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/4729e438e0ada350f91148e7d4bb9809342575ff",
"reference": "4729e438e0ada350f91148e7d4bb9809342575ff", "reference": "4729e438e0ada350f91148e7d4bb9809342575ff",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"nikic/php-parser": "^1.0|^2.0|^3.0", "nikic/php-parser": "^1.0|^2.0|^3.0",
...@@ -78,13 +72,7 @@ ...@@ -78,13 +72,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a",
"reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
...@@ -117,13 +105,7 @@ ...@@ -117,13 +105,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae", "reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
...@@ -190,13 +172,7 @@ ...@@ -190,13 +172,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"guzzlehttp/promises": "^1.0", "guzzlehttp/promises": "^1.0",
...@@ -261,13 +237,7 @@ ...@@ -261,13 +237,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.0" "php": ">=5.5.0"
...@@ -318,13 +288,7 @@ ...@@ -318,13 +288,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.4.0",
...@@ -389,13 +353,7 @@ ...@@ -389,13 +353,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191",
"reference": "d5deaecff52a0d61ccb613bb3804088da0307191", "reference": "d5deaecff52a0d61ccb613bb3804088da0307191",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0" "php": ">=5.4.0"
...@@ -437,13 +395,7 @@ ...@@ -437,13 +395,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5",
"reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"jakub-onderka/php-console-color": "~0.1", "jakub-onderka/php-console-color": "~0.1",
...@@ -487,13 +439,7 @@ ...@@ -487,13 +439,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/5707d5821b30b9a07acfb4d76949784aaa0e9ce9", "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/5707d5821b30b9a07acfb4d76949784aaa0e9ce9",
"reference": "5707d5821b30b9a07acfb4d76949784aaa0e9ce9", "reference": "5707d5821b30b9a07acfb4d76949784aaa0e9ce9",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"nikic/php-parser": "^1.2|^2.0|^3.0|^4.0", "nikic/php-parser": "^1.2|^2.0|^3.0|^4.0",
...@@ -551,13 +497,7 @@ ...@@ -551,13 +497,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341", "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341",
"reference": "cc84765fb7317f6b07bd8ac78364747f95b86341", "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.29" "php": ">=5.3.29"
...@@ -623,13 +563,7 @@ ...@@ -623,13 +563,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/2a79f920d5584ec6df7cf996d922a742d11095d1", "url": "https://api.github.com/repos/laravel/framework/zipball/2a79f920d5584ec6df7cf996d922a742d11095d1",
"reference": "2a79f920d5584ec6df7cf996d922a742d11095d1", "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"classpreloader/classpreloader": "~3.0", "classpreloader/classpreloader": "~3.0",
...@@ -749,32 +683,26 @@ ...@@ -749,32 +683,26 @@
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
"version": "1.0.47", "version": "1.0.46",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/flysystem.git", "url": "https://github.com/thephpleague/flysystem.git",
"reference": "a11e4a75f256bdacf99d20780ce42d3b8272975c" "reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a11e4a75f256bdacf99d20780ce42d3b8272975c", "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2",
"reference": "a11e4a75f256bdacf99d20780ce42d3b8272975c", "reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-fileinfo": "*",
"php": ">=5.5.9" "php": ">=5.5.9"
}, },
"conflict": { "conflict": {
"league/flysystem-sftp": "<1.0.6" "league/flysystem-sftp": "<1.0.6"
}, },
"require-dev": { "require-dev": {
"ext-fileinfo": "*",
"phpspec/phpspec": "^3.4", "phpspec/phpspec": "^3.4",
"phpunit/phpunit": "^5.7.10" "phpunit/phpunit": "^5.7.10"
}, },
...@@ -835,7 +763,7 @@ ...@@ -835,7 +763,7 @@
"sftp", "sftp",
"storage" "storage"
], ],
"time": "2018-09-14T15:30:29+00:00" "time": "2018-08-22T07:45:22+00:00"
}, },
{ {
"name": "maatwebsite/excel", "name": "maatwebsite/excel",
...@@ -849,13 +777,7 @@ ...@@ -849,13 +777,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/731487fda0e3e26c8701d8ee1aafc7b7429a95ce", "url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/731487fda0e3e26c8701d8ee1aafc7b7429a95ce",
"reference": "731487fda0e3e26c8701d8ee1aafc7b7429a95ce", "reference": "731487fda0e3e26c8701d8ee1aafc7b7429a95ce",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"illuminate/cache": "5.0.*|5.1.*|5.2.*", "illuminate/cache": "5.0.*|5.1.*|5.2.*",
...@@ -912,23 +834,17 @@ ...@@ -912,23 +834,17 @@
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "1.23.0", "version": "1.24.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Seldaek/monolog.git", "url": "https://github.com/Seldaek/monolog.git",
"reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266",
"reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0", "php": ">=5.3.0",
...@@ -992,7 +908,7 @@ ...@@ -992,7 +908,7 @@
"logging", "logging",
"psr-3" "psr-3"
], ],
"time": "2017-06-19T01:22:40+00:00" "time": "2018-11-05T09:00:11+00:00"
}, },
{ {
"name": "mtdowling/cron-expression", "name": "mtdowling/cron-expression",
...@@ -1006,13 +922,7 @@ ...@@ -1006,13 +922,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad", "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad",
"reference": "9504fa9ea681b586028adaaa0877db4aecf32bad", "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
...@@ -1046,32 +956,29 @@ ...@@ -1046,32 +956,29 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "1.34.0", "version": "1.34.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33" "reference": "b9a444d829c9a16735aceca1b173e765745bcc0c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33", "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/b9a444d829c9a16735aceca1b173e765745bcc0c",
"reference": "1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33", "reference": "b9a444d829c9a16735aceca1b173e765745bcc0c",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.9", "php": ">=5.3.9",
"symfony/translation": "~2.6 || ~3.0 || ~4.0" "symfony/translation": "~2.6 || ~3.0 || ~4.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "~2",
"phpunit/phpunit": "^4.8.35 || ^5.7" "phpunit/phpunit": "^4.8.35 || ^5.7"
}, },
"suggest": {
"friendsofphp/php-cs-fixer": "Needed for the `composer phpcs` command. Allow to automatically fix code style.",
"phpstan/phpstan": "Needed for the `composer phpstan` command. Allow to detect potential errors."
},
"type": "library", "type": "library",
"extra": { "extra": {
"laravel": { "laravel": {
...@@ -1103,7 +1010,7 @@ ...@@ -1103,7 +1010,7 @@
"datetime", "datetime",
"time" "time"
], ],
"time": "2018-09-20T19:36:25+00:00" "time": "2018-11-13T08:26:10+00:00"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
...@@ -1117,13 +1024,7 @@ ...@@ -1117,13 +1024,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4dd659edadffdc2143e4753df655d866dbfeedf0", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4dd659edadffdc2143e4753df655d866dbfeedf0",
"reference": "4dd659edadffdc2143e4753df655d866dbfeedf0", "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-tokenizer": "*", "ext-tokenizer": "*",
...@@ -1174,13 +1075,7 @@ ...@@ -1174,13 +1075,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/9b3899e3c3ddde89016f576edb8c489708ad64cd", "url": "https://api.github.com/repos/paragonie/random_compat/zipball/9b3899e3c3ddde89016f576edb8c489708ad64cd",
"reference": "9b3899e3c3ddde89016f576edb8c489708ad64cd", "reference": "9b3899e3c3ddde89016f576edb8c489708ad64cd",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.2.0" "php": ">=5.2.0"
...@@ -1228,13 +1123,7 @@ ...@@ -1228,13 +1123,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32", "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32", "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-xml": "*", "ext-xml": "*",
...@@ -1292,13 +1181,7 @@ ...@@ -1292,13 +1181,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1", "url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1",
"reference": "f0210e38881631afeafb56ab43405a92cafd9fd1", "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.9" "php": ">=5.3.9"
...@@ -1348,13 +1231,7 @@ ...@@ -1348,13 +1231,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=5.3.0"
...@@ -1404,13 +1281,7 @@ ...@@ -1404,13 +1281,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=5.3.0"
...@@ -1457,13 +1328,7 @@ ...@@ -1457,13 +1328,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/e64e10b20f8d229cac76399e1f3edddb57a0f280", "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e64e10b20f8d229cac76399e1f3edddb57a0f280",
"reference": "e64e10b20f8d229cac76399e1f3edddb57a0f280", "reference": "e64e10b20f8d229cac76399e1f3edddb57a0f280",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"dnoegel/php-xdg-base-dir": "0.1", "dnoegel/php-xdg-base-dir": "0.1",
...@@ -1524,6 +1389,42 @@ ...@@ -1524,6 +1389,42 @@
"time": "2016-03-09T05:03:14+00:00" "time": "2016-03-09T05:03:14+00:00"
}, },
{ {
"name": "redgo/monitor-ding",
"version": "0.2",
"source": {
"type": "git",
"url": "https://github.com/GreenLightt/monitorDing.git",
"reference": "c75a14a22c6308da89068a67bbd0e6caea05bfe2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GreenLightt/monitorDing/zipball/c75a14a22c6308da89068a67bbd0e6caea05bfe2",
"reference": "c75a14a22c6308da89068a67bbd0e6caea05bfe2",
"shasum": ""
},
"require": {
"laravel/framework": "^5.1"
},
"type": "library",
"autoload": {
"psr-4": {
"Redgo\\MonitorDing\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "redgo",
"email": "1223858310@qq.com"
}
],
"description": "用于给钉钉自定义机器人发送消息",
"time": "2018-07-09T09:21:34+00:00"
},
{
"name": "swiftmailer/swiftmailer", "name": "swiftmailer/swiftmailer",
"version": "v5.4.12", "version": "v5.4.12",
"source": { "source": {
...@@ -1535,13 +1436,7 @@ ...@@ -1535,13 +1436,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/181b89f18a90f8925ef805f950d47a7190e9b950", "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/181b89f18a90f8925ef805f950d47a7190e9b950",
"reference": "181b89f18a90f8925ef805f950d47a7190e9b950", "reference": "181b89f18a90f8925ef805f950d47a7190e9b950",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
...@@ -1595,13 +1490,7 @@ ...@@ -1595,13 +1490,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f", "url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f",
"reference": "926061e74229e935d3c5b4e9ba87237316c6693f", "reference": "926061e74229e935d3c5b4e9ba87237316c6693f",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -1661,13 +1550,7 @@ ...@@ -1661,13 +1550,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/b8999c1f33c224b2b66b38253f5e3a838d0d0115", "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8999c1f33c224b2b66b38253f5e3a838d0d0115",
"reference": "b8999c1f33c224b2b66b38253f5e3a838d0d0115", "reference": "b8999c1f33c224b2b66b38253f5e3a838d0d0115",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9"
...@@ -1720,13 +1603,7 @@ ...@@ -1720,13 +1603,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a",
"reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -1773,23 +1650,17 @@ ...@@ -1773,23 +1650,17 @@
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v3.4.17", "version": "v3.4.18",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
"reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14",
"reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.5.9|>=7.0.8" "php": "^5.5.9|>=7.0.8"
...@@ -1838,7 +1709,7 @@ ...@@ -1838,7 +1709,7 @@
], ],
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2018-07-26T09:06:28+00:00" "time": "2018-10-30T16:50:50+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
...@@ -1852,13 +1723,7 @@ ...@@ -1852,13 +1723,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9",
"reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9"
...@@ -1907,13 +1772,7 @@ ...@@ -1907,13 +1772,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82", "url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82",
"reference": "49ba00f8ede742169cb6b70abe33243f4d673f82", "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -1966,13 +1825,7 @@ ...@@ -1966,13 +1825,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3", "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3",
"reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3", "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -2044,23 +1897,17 @@ ...@@ -2044,23 +1897,17 @@
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.9.0", "version": "v1.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" "reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", "reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
...@@ -2105,27 +1952,21 @@ ...@@ -2105,27 +1952,21 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2018-08-06T14:22:27+00:00" "time": "2018-09-21T13:07:52+00:00"
}, },
{ {
"name": "symfony/polyfill-php56", "name": "symfony/polyfill-php56",
"version": "v1.9.0", "version": "v1.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php56.git", "url": "https://github.com/symfony/polyfill-php56.git",
"reference": "7b4fc009172cc0196535b0328bd1226284a28000" "reference": "ff208829fe1aa48ab9af356992bb7199fed551af"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/7b4fc009172cc0196535b0328bd1226284a28000", "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/ff208829fe1aa48ab9af356992bb7199fed551af",
"reference": "7b4fc009172cc0196535b0328bd1226284a28000", "reference": "ff208829fe1aa48ab9af356992bb7199fed551af",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
...@@ -2167,27 +2008,21 @@ ...@@ -2167,27 +2008,21 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2018-08-06T14:22:27+00:00" "time": "2018-09-21T06:26:08+00:00"
}, },
{ {
"name": "symfony/polyfill-util", "name": "symfony/polyfill-util",
"version": "v1.9.0", "version": "v1.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-util.git", "url": "https://github.com/symfony/polyfill-util.git",
"reference": "8e15d04ba3440984d23e7964b2ee1d25c8de1581" "reference": "3b58903eae668d348a7126f999b0da0f2f93611c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8e15d04ba3440984d23e7964b2ee1d25c8de1581", "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/3b58903eae668d348a7126f999b0da0f2f93611c",
"reference": "8e15d04ba3440984d23e7964b2ee1d25c8de1581", "reference": "3b58903eae668d348a7126f999b0da0f2f93611c",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
...@@ -2225,7 +2060,7 @@ ...@@ -2225,7 +2060,7 @@
"polyfill", "polyfill",
"shim" "shim"
], ],
"time": "2018-08-06T14:22:27+00:00" "time": "2018-09-30T16:36:12+00:00"
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
...@@ -2239,13 +2074,7 @@ ...@@ -2239,13 +2074,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505", "url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505",
"reference": "768debc5996f599c4372b322d9061dba2a4bf505", "reference": "768debc5996f599c4372b322d9061dba2a4bf505",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9"
...@@ -2294,13 +2123,7 @@ ...@@ -2294,13 +2123,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b",
"reference": "9038984bd9c05ab07280121e9e10f61a7231457b", "reference": "9038984bd9c05ab07280121e9e10f61a7231457b",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9"
...@@ -2375,13 +2198,7 @@ ...@@ -2375,13 +2198,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26",
"reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -2445,13 +2262,7 @@ ...@@ -2445,13 +2262,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377",
"reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377", "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -2514,13 +2325,7 @@ ...@@ -2514,13 +2325,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/9753fc340726e327e4d48b7c0604f85475ae0bc3", "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/9753fc340726e327e4d48b7c0604f85475ae0bc3",
"reference": "9753fc340726e327e4d48b7c0604f85475ae0bc3", "reference": "9753fc340726e327e4d48b7c0604f85475ae0bc3",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0", "php": ">=5.3.0",
...@@ -2567,13 +2372,7 @@ ...@@ -2567,13 +2372,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e", "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e",
"reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e", "reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.9" "php": ">=5.3.9"
......
...@@ -155,6 +155,7 @@ return [ ...@@ -155,6 +155,7 @@ return [
App\Providers\AuthServiceProvider::class, App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class, App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class, App\Providers\RouteServiceProvider::class,
Redgo\MonitorDing\MonitorDingServiceProvider::class,
], ],
/* /*
...@@ -201,6 +202,7 @@ return [ ...@@ -201,6 +202,7 @@ return [
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class, 'Excel' => Maatwebsite\Excel\Facades\Excel::class,
'MonitorDing' => Redgo\MonitorDing\Facades\MonitorDing::class,
], ],
......
<?php
return [
// 是否开启报错写入
'enabled' => true,
// curl证书验证, 线下环境不用开启
'curl_verify' => true,
// webhook的值
'webhook' => 'https://oapi.dingtalk.com/robot/send?access_token=a1ecbb3b7dc17660f0d8b833d79a16578b682e28b673dd024c4125ca974abadd',
];
\ No newline at end of file
...@@ -377,11 +377,11 @@ class ClassLoader ...@@ -377,11 +377,11 @@ class ClassLoader
$subPath = $class; $subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) { while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos); $subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\'; $search = $subPath.'\\';
if (isset($this->prefixDirsPsr4[$search])) { if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) { foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) { $length = $this->prefixLengthsPsr4[$first][$search];
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
return $file; return $file;
} }
} }
......
This diff could not be displayed because it is too large.
...@@ -11,11 +11,11 @@ return array( ...@@ -11,11 +11,11 @@ return array(
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
'2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php', '2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php',
'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php', 'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php', '5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
'e7223560d890eab89cda23685e711e2c' => $vendorDir . '/psy/psysh/src/Psy/functions.php', 'e7223560d890eab89cda23685e711e2c' => $vendorDir . '/psy/psysh/src/Psy/functions.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php', 'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
'58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php', '58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
); );
...@@ -27,6 +27,7 @@ return array( ...@@ -27,6 +27,7 @@ return array(
'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'), 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
'SuperClosure\\' => array($vendorDir . '/jeremeamia/SuperClosure/src'), 'SuperClosure\\' => array($vendorDir . '/jeremeamia/SuperClosure/src'),
'Redgo\\MonitorDing\\' => array($vendorDir . '/redgo/monitor-ding/src'),
'Psy\\' => array($vendorDir . '/psy/psysh/src/Psy'), 'Psy\\' => array($vendorDir . '/psy/psysh/src/Psy'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
......
This diff could not be displayed because it is too large.
...@@ -12,13 +12,7 @@ ...@@ -12,13 +12,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/4729e438e0ada350f91148e7d4bb9809342575ff", "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/4729e438e0ada350f91148e7d4bb9809342575ff",
"reference": "4729e438e0ada350f91148e7d4bb9809342575ff", "reference": "4729e438e0ada350f91148e7d4bb9809342575ff",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"nikic/php-parser": "^1.0|^2.0|^3.0", "nikic/php-parser": "^1.0|^2.0|^3.0",
...@@ -74,13 +68,7 @@ ...@@ -74,13 +68,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a",
"reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
...@@ -115,13 +103,7 @@ ...@@ -115,13 +103,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae", "reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
...@@ -190,13 +172,7 @@ ...@@ -190,13 +172,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3,<8.0-DEV" "php": ">=5.3,<8.0-DEV"
...@@ -252,13 +228,7 @@ ...@@ -252,13 +228,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de", "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de",
"reference": "f72816b43e74063c8b10357394b6bba8cb1c10de", "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0" "php": "^5.3.3 || ^7.0"
...@@ -310,13 +280,7 @@ ...@@ -310,13 +280,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"guzzlehttp/promises": "^1.0", "guzzlehttp/promises": "^1.0",
...@@ -383,13 +347,7 @@ ...@@ -383,13 +347,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.0" "php": ">=5.5.0"
...@@ -442,13 +400,7 @@ ...@@ -442,13 +400,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.4.0",
...@@ -515,13 +467,7 @@ ...@@ -515,13 +467,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c",
"reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
...@@ -568,13 +514,7 @@ ...@@ -568,13 +514,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191", "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191",
"reference": "d5deaecff52a0d61ccb613bb3804088da0307191", "reference": "d5deaecff52a0d61ccb613bb3804088da0307191",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.4.0" "php": ">=5.4.0"
...@@ -618,13 +558,7 @@ ...@@ -618,13 +558,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5",
"reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"jakub-onderka/php-console-color": "~0.1", "jakub-onderka/php-console-color": "~0.1",
...@@ -670,13 +604,7 @@ ...@@ -670,13 +604,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/5707d5821b30b9a07acfb4d76949784aaa0e9ce9", "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/5707d5821b30b9a07acfb4d76949784aaa0e9ce9",
"reference": "5707d5821b30b9a07acfb4d76949784aaa0e9ce9", "reference": "5707d5821b30b9a07acfb4d76949784aaa0e9ce9",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"nikic/php-parser": "^1.2|^2.0|^3.0|^4.0", "nikic/php-parser": "^1.2|^2.0|^3.0|^4.0",
...@@ -736,13 +664,7 @@ ...@@ -736,13 +664,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341", "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341",
"reference": "cc84765fb7317f6b07bd8ac78364747f95b86341", "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.29" "php": ">=5.3.29"
...@@ -810,13 +732,7 @@ ...@@ -810,13 +732,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/2a79f920d5584ec6df7cf996d922a742d11095d1", "url": "https://api.github.com/repos/laravel/framework/zipball/2a79f920d5584ec6df7cf996d922a742d11095d1",
"reference": "2a79f920d5584ec6df7cf996d922a742d11095d1", "reference": "2a79f920d5584ec6df7cf996d922a742d11095d1",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"classpreloader/classpreloader": "~3.0", "classpreloader/classpreloader": "~3.0",
...@@ -936,98 +852,6 @@ ...@@ -936,98 +852,6 @@
] ]
}, },
{ {
"name": "league/flysystem",
"version": "1.0.47",
"version_normalized": "1.0.47.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "a11e4a75f256bdacf99d20780ce42d3b8272975c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a11e4a75f256bdacf99d20780ce42d3b8272975c",
"reference": "a11e4a75f256bdacf99d20780ce42d3b8272975c",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-fileinfo": "*",
"php": ">=5.5.9"
},
"conflict": {
"league/flysystem-sftp": "<1.0.6"
},
"require-dev": {
"phpspec/phpspec": "^3.4",
"phpunit/phpunit": "^5.7.10"
},
"suggest": {
"ext-fileinfo": "Required for MimeType",
"ext-ftp": "Allows you to use FTP server storage",
"ext-openssl": "Allows you to use FTPS server storage",
"league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
"league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
"league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
"league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
"league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
"league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
"league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
"league/flysystem-webdav": "Allows you to use WebDAV storage",
"league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
"spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
"srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
},
"time": "2018-09-14T15:30:29+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"League\\Flysystem\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
"description": "Filesystem abstraction: Many filesystems, one API.",
"keywords": [
"Cloud Files",
"WebDAV",
"abstraction",
"aws",
"cloud",
"copy.com",
"dropbox",
"file systems",
"files",
"filesystem",
"filesystems",
"ftp",
"rackspace",
"remote",
"s3",
"sftp",
"storage"
]
},
{
"name": "maatwebsite/excel", "name": "maatwebsite/excel",
"version": "2.0.11", "version": "2.0.11",
"version_normalized": "2.0.11.0", "version_normalized": "2.0.11.0",
...@@ -1040,13 +864,7 @@ ...@@ -1040,13 +864,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/731487fda0e3e26c8701d8ee1aafc7b7429a95ce", "url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/731487fda0e3e26c8701d8ee1aafc7b7429a95ce",
"reference": "731487fda0e3e26c8701d8ee1aafc7b7429a95ce", "reference": "731487fda0e3e26c8701d8ee1aafc7b7429a95ce",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"illuminate/cache": "5.0.*|5.1.*|5.2.*", "illuminate/cache": "5.0.*|5.1.*|5.2.*",
...@@ -1115,13 +933,7 @@ ...@@ -1115,13 +933,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/mockery/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", "url": "https://api.github.com/repos/mockery/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856",
"reference": "6fdb61243844dc924071d3404bb23994ea0b6856", "reference": "6fdb61243844dc924071d3404bb23994ea0b6856",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"hamcrest/hamcrest-php": "~1.1", "hamcrest/hamcrest-php": "~1.1",
...@@ -1176,92 +988,6 @@ ...@@ -1176,92 +988,6 @@
] ]
}, },
{ {
"name": "monolog/monolog",
"version": "1.23.0",
"version_normalized": "1.23.0.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4",
"reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
"provide": {
"psr/log-implementation": "1.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
"jakub-onderka/php-parallel-lint": "0.9",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"phpunit/phpunit": "~4.5",
"phpunit/phpunit-mock-objects": "2.3.0",
"ruflin/elastica": ">=0.90 <3.0",
"sentry/sentry": "^0.13",
"swiftmailer/swiftmailer": "^5.3|^6.0"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
"sentry/sentry": "Allow sending log messages to a Sentry server"
},
"time": "2017-06-19T01:22:40+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"installation-source": "dist",
"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"
]
},
{
"name": "mtdowling/cron-expression", "name": "mtdowling/cron-expression",
"version": "v1.2.1", "version": "v1.2.1",
"version_normalized": "1.2.1.0", "version_normalized": "1.2.1.0",
...@@ -1274,13 +1000,7 @@ ...@@ -1274,13 +1000,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad", "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad",
"reference": "9504fa9ea681b586028adaaa0877db4aecf32bad", "reference": "9504fa9ea681b586028adaaa0877db4aecf32bad",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
...@@ -1314,69 +1034,6 @@ ...@@ -1314,69 +1034,6 @@
] ]
}, },
{ {
"name": "nesbot/carbon",
"version": "1.34.0",
"version_normalized": "1.34.0.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33",
"reference": "1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.9",
"symfony/translation": "~2.6 || ~3.0 || ~4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2",
"phpunit/phpunit": "^4.8.35 || ^5.7"
},
"time": "2018-09-20T19:36:25+00:00",
"type": "library",
"extra": {
"laravel": {
"providers": [
"Carbon\\Laravel\\ServiceProvider"
]
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Brian Nesbitt",
"email": "brian@nesbot.com",
"homepage": "http://nesbot.com"
}
],
"description": "A simple API extension for DateTime.",
"homepage": "http://carbon.nesbot.com",
"keywords": [
"date",
"datetime",
"time"
]
},
{
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v2.1.1", "version": "v2.1.1",
"version_normalized": "2.1.1.0", "version_normalized": "2.1.1.0",
...@@ -1389,13 +1046,7 @@ ...@@ -1389,13 +1046,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4dd659edadffdc2143e4753df655d866dbfeedf0", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4dd659edadffdc2143e4753df655d866dbfeedf0",
"reference": "4dd659edadffdc2143e4753df655d866dbfeedf0", "reference": "4dd659edadffdc2143e4753df655d866dbfeedf0",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-tokenizer": "*", "ext-tokenizer": "*",
...@@ -1448,13 +1099,7 @@ ...@@ -1448,13 +1099,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/9b3899e3c3ddde89016f576edb8c489708ad64cd", "url": "https://api.github.com/repos/paragonie/random_compat/zipball/9b3899e3c3ddde89016f576edb8c489708ad64cd",
"reference": "9b3899e3c3ddde89016f576edb8c489708ad64cd", "reference": "9b3899e3c3ddde89016f576edb8c489708ad64cd",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.2.0" "php": ">=5.2.0"
...@@ -1504,13 +1149,7 @@ ...@@ -1504,13 +1149,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5" "php": ">=5.5"
...@@ -1566,13 +1205,7 @@ ...@@ -1566,13 +1205,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2",
"reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.6 || ^7.0", "php": "^5.6 || ^7.0",
...@@ -1619,13 +1252,7 @@ ...@@ -1619,13 +1252,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
"reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.5 || ^7.0", "php": "^5.5 || ^7.0",
...@@ -1674,13 +1301,7 @@ ...@@ -1674,13 +1301,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32", "url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32", "reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-xml": "*", "ext-xml": "*",
...@@ -1740,13 +1361,7 @@ ...@@ -1740,13 +1361,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
"reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
...@@ -1811,13 +1426,7 @@ ...@@ -1811,13 +1426,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
...@@ -1881,13 +1490,7 @@ ...@@ -1881,13 +1490,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
"reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
...@@ -1936,13 +1539,7 @@ ...@@ -1936,13 +1539,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
...@@ -1985,13 +1582,7 @@ ...@@ -1985,13 +1582,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0" "php": "^5.3.3 || ^7.0"
...@@ -2042,13 +1633,7 @@ ...@@ -2042,13 +1633,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
"reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-tokenizer": "*", "ext-tokenizer": "*",
...@@ -2099,13 +1684,7 @@ ...@@ -2099,13 +1684,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517",
"reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "reference": "46023de9a91eec7dfb06cc56cb4e260017298517",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"ext-dom": "*", "ext-dom": "*",
...@@ -2179,13 +1758,7 @@ ...@@ -2179,13 +1758,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
...@@ -2243,13 +1816,7 @@ ...@@ -2243,13 +1816,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1", "url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1",
"reference": "f0210e38881631afeafb56ab43405a92cafd9fd1", "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.9" "php": ">=5.3.9"
...@@ -2301,13 +1868,7 @@ ...@@ -2301,13 +1868,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=5.3.0"
...@@ -2359,13 +1920,7 @@ ...@@ -2359,13 +1920,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=5.3.0"
...@@ -2414,13 +1969,7 @@ ...@@ -2414,13 +1969,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/e64e10b20f8d229cac76399e1f3edddb57a0f280", "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e64e10b20f8d229cac76399e1f3edddb57a0f280",
"reference": "e64e10b20f8d229cac76399e1f3edddb57a0f280", "reference": "e64e10b20f8d229cac76399e1f3edddb57a0f280",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"dnoegel/php-xdg-base-dir": "0.1", "dnoegel/php-xdg-base-dir": "0.1",
...@@ -2494,13 +2043,7 @@ ...@@ -2494,13 +2043,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
...@@ -2566,13 +2109,7 @@ ...@@ -2566,13 +2109,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0" "php": "^5.3.3 || ^7.0"
...@@ -2626,13 +2163,7 @@ ...@@ -2626,13 +2163,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0" "php": "^5.3.3 || ^7.0"
...@@ -2684,13 +2215,7 @@ ...@@ -2684,13 +2215,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
...@@ -2759,13 +2284,7 @@ ...@@ -2759,13 +2284,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
...@@ -2818,13 +2337,7 @@ ...@@ -2818,13 +2337,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
...@@ -2879,13 +2392,7 @@ ...@@ -2879,13 +2392,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"time": "2015-06-21T13:59:46+00:00", "time": "2015-06-21T13:59:46+00:00",
"type": "library", "type": "library",
...@@ -2922,13 +2429,7 @@ ...@@ -2922,13 +2429,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/181b89f18a90f8925ef805f950d47a7190e9b950", "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/181b89f18a90f8925ef805f950d47a7190e9b950",
"reference": "181b89f18a90f8925ef805f950d47a7190e9b950", "reference": "181b89f18a90f8925ef805f950d47a7190e9b950",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
...@@ -2984,13 +2485,7 @@ ...@@ -2984,13 +2485,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f", "url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f",
"reference": "926061e74229e935d3c5b4e9ba87237316c6693f", "reference": "926061e74229e935d3c5b4e9ba87237316c6693f",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -3052,13 +2547,7 @@ ...@@ -3052,13 +2547,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/b8999c1f33c224b2b66b38253f5e3a838d0d0115", "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8999c1f33c224b2b66b38253f5e3a838d0d0115",
"reference": "b8999c1f33c224b2b66b38253f5e3a838d0d0115", "reference": "b8999c1f33c224b2b66b38253f5e3a838d0d0115",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9"
...@@ -3113,13 +2602,7 @@ ...@@ -3113,13 +2602,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a",
"reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -3178,13 +2661,7 @@ ...@@ -3178,13 +2661,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/dff8fecf1f56990d88058e3a1885c2a5f1b8e970", "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/dff8fecf1f56990d88058e3a1885c2a5f1b8e970",
"reference": "dff8fecf1f56990d88058e3a1885c2a5f1b8e970", "reference": "dff8fecf1f56990d88058e3a1885c2a5f1b8e970",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -3230,80 +2707,9 @@ ...@@ -3230,80 +2707,9 @@
"homepage": "https://symfony.com" "homepage": "https://symfony.com"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/finder",
"version": "v3.4.17", "version": "v3.0.9",
"version_normalized": "3.4.17.0", "version_normalized": "3.0.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb",
"reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^5.5.9|>=7.0.8"
},
"conflict": {
"symfony/dependency-injection": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.8|~3.0|~4.0",
"symfony/dependency-injection": "~3.3|~4.0",
"symfony/expression-language": "~2.8|~3.0|~4.0",
"symfony/stopwatch": "~2.8|~3.0|~4.0"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"time": "2018-07-26T09:06:28+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"installation-source": "dist",
"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"
},
{
"name": "symfony/finder",
"version": "v3.0.9",
"version_normalized": "3.0.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
...@@ -3313,13 +2719,7 @@ ...@@ -3313,13 +2719,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9",
"reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9"
...@@ -3370,13 +2770,7 @@ ...@@ -3370,13 +2770,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82", "url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82",
"reference": "49ba00f8ede742169cb6b70abe33243f4d673f82", "reference": "49ba00f8ede742169cb6b70abe33243f4d673f82",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -3431,13 +2825,7 @@ ...@@ -3431,13 +2825,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3", "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3",
"reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3", "reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -3509,197 +2897,6 @@ ...@@ -3509,197 +2897,6 @@
"homepage": "https://symfony.com" "homepage": "https://symfony.com"
}, },
{ {
"name": "symfony/polyfill-mbstring",
"version": "v1.9.0",
"version_normalized": "1.9.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"time": "2018-08-06T14:22:27+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist",
"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"
]
},
{
"name": "symfony/polyfill-php56",
"version": "v1.9.0",
"version_normalized": "1.9.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php56.git",
"reference": "7b4fc009172cc0196535b0328bd1226284a28000"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/7b4fc009172cc0196535b0328bd1226284a28000",
"reference": "7b4fc009172cc0196535b0328bd1226284a28000",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3",
"symfony/polyfill-util": "~1.0"
},
"time": "2018-08-06T14:22:27+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php56\\": ""
},
"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 5.6+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
]
},
{
"name": "symfony/polyfill-util",
"version": "v1.9.0",
"version_normalized": "1.9.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-util.git",
"reference": "8e15d04ba3440984d23e7964b2ee1d25c8de1581"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8e15d04ba3440984d23e7964b2ee1d25c8de1581",
"reference": "8e15d04ba3440984d23e7964b2ee1d25c8de1581",
"shasum": "",
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3"
},
"time": "2018-08-06T14:22:27+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Util\\": ""
}
},
"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 utilities for portability of PHP codes",
"homepage": "https://symfony.com",
"keywords": [
"compat",
"compatibility",
"polyfill",
"shim"
]
},
{
"name": "symfony/process", "name": "symfony/process",
"version": "v3.0.9", "version": "v3.0.9",
"version_normalized": "3.0.9.0", "version_normalized": "3.0.9.0",
...@@ -3712,13 +2909,7 @@ ...@@ -3712,13 +2909,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505", "url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505",
"reference": "768debc5996f599c4372b322d9061dba2a4bf505", "reference": "768debc5996f599c4372b322d9061dba2a4bf505",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9"
...@@ -3769,13 +2960,7 @@ ...@@ -3769,13 +2960,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b",
"reference": "9038984bd9c05ab07280121e9e10f61a7231457b", "reference": "9038984bd9c05ab07280121e9e10f61a7231457b",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9"
...@@ -3852,13 +3037,7 @@ ...@@ -3852,13 +3037,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26", "url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26",
"reference": "eee6c664853fd0576f21ae25725cfffeafe83f26", "reference": "eee6c664853fd0576f21ae25725cfffeafe83f26",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -3924,13 +3103,7 @@ ...@@ -3924,13 +3103,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377",
"reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377", "reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9",
...@@ -3995,13 +3168,7 @@ ...@@ -3995,13 +3168,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/af615970e265543a26ee712c958404eb9b7ac93d", "url": "https://api.github.com/repos/symfony/yaml/zipball/af615970e265543a26ee712c958404eb9b7ac93d",
"reference": "af615970e265543a26ee712c958404eb9b7ac93d", "reference": "af615970e265543a26ee712c958404eb9b7ac93d",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.5.9|>=7.0.8" "php": "^5.5.9|>=7.0.8"
...@@ -4058,13 +3225,7 @@ ...@@ -4058,13 +3225,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/9753fc340726e327e4d48b7c0604f85475ae0bc3", "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/9753fc340726e327e4d48b7c0604f85475ae0bc3",
"reference": "9753fc340726e327e4d48b7c0604f85475ae0bc3", "reference": "9753fc340726e327e4d48b7c0604f85475ae0bc3",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.0", "php": ">=5.3.0",
...@@ -4113,13 +3274,7 @@ ...@@ -4113,13 +3274,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e", "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e",
"reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e", "reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": ">=5.3.9" "php": ">=5.3.9"
...@@ -4171,13 +3326,7 @@ ...@@ -4171,13 +3326,7 @@
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
"reference": "0df1908962e7a3071564e857d86874dad1ef204a", "reference": "0df1908962e7a3071564e857d86874dad1ef204a",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0" "php": "^5.3.3 || ^7.0"
...@@ -4215,5 +3364,507 @@ ...@@ -4215,5 +3364,507 @@
"check", "check",
"validate" "validate"
] ]
},
{
"name": "league/flysystem",
"version": "1.0.46",
"version_normalized": "1.0.46.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2",
"reference": "f3e0d925c18b92cf3ce84ea5cc58d62a1762a2b2",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"conflict": {
"league/flysystem-sftp": "<1.0.6"
},
"require-dev": {
"ext-fileinfo": "*",
"phpspec/phpspec": "^3.4",
"phpunit/phpunit": "^5.7.10"
},
"suggest": {
"ext-fileinfo": "Required for MimeType",
"ext-ftp": "Allows you to use FTP server storage",
"ext-openssl": "Allows you to use FTPS server storage",
"league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
"league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
"league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
"league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
"league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
"league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
"league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
"league/flysystem-webdav": "Allows you to use WebDAV storage",
"league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
"spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
"srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
},
"time": "2018-08-22T07:45:22+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"League\\Flysystem\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
"description": "Filesystem abstraction: Many filesystems, one API.",
"keywords": [
"Cloud Files",
"WebDAV",
"abstraction",
"aws",
"cloud",
"copy.com",
"dropbox",
"file systems",
"files",
"filesystem",
"filesystems",
"ftp",
"rackspace",
"remote",
"s3",
"sftp",
"storage"
]
},
{
"name": "monolog/monolog",
"version": "1.24.0",
"version_normalized": "1.24.0.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266",
"reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
"provide": {
"psr/log-implementation": "1.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
"jakub-onderka/php-parallel-lint": "0.9",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"phpunit/phpunit": "~4.5",
"phpunit/phpunit-mock-objects": "2.3.0",
"ruflin/elastica": ">=0.90 <3.0",
"sentry/sentry": "^0.13",
"swiftmailer/swiftmailer": "^5.3|^6.0"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
"sentry/sentry": "Allow sending log messages to a Sentry server"
},
"time": "2018-11-05T09:00:11+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"installation-source": "dist",
"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"
]
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.10.0",
"version_normalized": "1.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"time": "2018-09-21T13:07:52+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist",
"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"
]
},
{
"name": "nesbot/carbon",
"version": "1.34.4",
"version_normalized": "1.34.4.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "b9a444d829c9a16735aceca1b173e765745bcc0c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/b9a444d829c9a16735aceca1b173e765745bcc0c",
"reference": "b9a444d829c9a16735aceca1b173e765745bcc0c",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/translation": "~2.6 || ~3.0 || ~4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7"
},
"suggest": {
"friendsofphp/php-cs-fixer": "Needed for the `composer phpcs` command. Allow to automatically fix code style.",
"phpstan/phpstan": "Needed for the `composer phpstan` command. Allow to detect potential errors."
},
"time": "2018-11-13T08:26:10+00:00",
"type": "library",
"extra": {
"laravel": {
"providers": [
"Carbon\\Laravel\\ServiceProvider"
]
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Brian Nesbitt",
"email": "brian@nesbot.com",
"homepage": "http://nesbot.com"
}
],
"description": "A simple API extension for DateTime.",
"homepage": "http://carbon.nesbot.com",
"keywords": [
"date",
"datetime",
"time"
]
},
{
"name": "symfony/polyfill-util",
"version": "v1.10.0",
"version_normalized": "1.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-util.git",
"reference": "3b58903eae668d348a7126f999b0da0f2f93611c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/3b58903eae668d348a7126f999b0da0f2f93611c",
"reference": "3b58903eae668d348a7126f999b0da0f2f93611c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2018-09-30T16:36:12+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Util\\": ""
}
},
"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 utilities for portability of PHP codes",
"homepage": "https://symfony.com",
"keywords": [
"compat",
"compatibility",
"polyfill",
"shim"
]
},
{
"name": "symfony/polyfill-php56",
"version": "v1.10.0",
"version_normalized": "1.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php56.git",
"reference": "ff208829fe1aa48ab9af356992bb7199fed551af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/ff208829fe1aa48ab9af356992bb7199fed551af",
"reference": "ff208829fe1aa48ab9af356992bb7199fed551af",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/polyfill-util": "~1.0"
},
"time": "2018-09-21T06:26:08+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php56\\": ""
},
"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 5.6+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
]
},
{
"name": "symfony/event-dispatcher",
"version": "v3.4.18",
"version_normalized": "3.4.18.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14",
"reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8"
},
"conflict": {
"symfony/dependency-injection": "<3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.8|~3.0|~4.0",
"symfony/dependency-injection": "~3.3|~4.0",
"symfony/expression-language": "~2.8|~3.0|~4.0",
"symfony/stopwatch": "~2.8|~3.0|~4.0"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"time": "2018-10-30T16:50:50+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"installation-source": "dist",
"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"
},
{
"name": "redgo/monitor-ding",
"version": "0.2",
"version_normalized": "0.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/GreenLightt/monitorDing.git",
"reference": "c75a14a22c6308da89068a67bbd0e6caea05bfe2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GreenLightt/monitorDing/zipball/c75a14a22c6308da89068a67bbd0e6caea05bfe2",
"reference": "c75a14a22c6308da89068a67bbd0e6caea05bfe2",
"shasum": ""
},
"require": {
"laravel/framework": "^5.1"
},
"time": "2018-07-09T09:21:34+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Redgo\\MonitorDing\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "redgo",
"email": "1223858310@qq.com"
}
],
"description": "用于给钉钉自定义机器人发送消息"
} }
] ]
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
} }
], ],
"require": { "require": {
"php": ">=5.5.9", "php": ">=5.5.9"
"ext-fileinfo": "*"
}, },
"require-dev": { "require-dev": {
"ext-fileinfo": "*",
"phpspec/phpspec": "^3.4", "phpspec/phpspec": "^3.4",
"phpunit/phpunit": "^5.7.10" "phpunit/phpunit": "^5.7.10"
}, },
......
...@@ -8,12 +8,12 @@ The `Handler` type and associated calls will be removed in version 2.0. ...@@ -8,12 +8,12 @@ The `Handler` type and associated calls will be removed in version 2.0.
### Upgrade path ### Upgrade path
You should create your own implementation for handling OOP usage, You should either create your own implementation for handling OOP usage,
but it's recommended to move away from using an OOP-style wrapper entirely. but it's recommended to move away from using an OOP-style wrapper entirely.
The reason for this is that it's too easy for implementation details (for The reason for this is that it's too easy for implementation details (for
your application this is Flysystem) to leak into the application. The most your application this is Flysystem) to leak into the application. The most
important part for Flysystem is that it improves portability and creates a important part for Flysystem is that it improved portability and creates a
solid boundary between your application core and the infrastructure you use. solid boundary between your application core and the infrastructure you use.
The OOP-style handling breaks this principle, therefore I want to stop The OOP-style handling breaks this principle, therefor I want to stop
promoting it. promoting it.
\ No newline at end of file
...@@ -10,165 +10,6 @@ use ErrorException; ...@@ -10,165 +10,6 @@ use ErrorException;
*/ */
class MimeType class MimeType
{ {
protected static $extensionToMimeTypeMap = [
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'csv' => 'text/x-comma-separated-values',
'bin' => 'application/octet-stream',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => 'application/octet-stream',
'class' => 'application/octet-stream',
'psd' => 'application/x-photoshop',
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => 'application/pdf',
'ai' => 'application/pdf',
'eps' => 'application/postscript',
'epub' => 'application/epub+zip',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/powerpoint',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => 'application/x-httpd-php',
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => 'application/javascript',
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => 'application/x-tar',
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => 'application/x-zip',
'rar' => 'application/x-rar',
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => 'audio/mpeg',
'aif' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => 'audio/x-wav',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'jpe' => 'image/jpeg',
'png' => 'image/png',
'gif' => 'image/gif',
'bmp' => 'image/bmp',
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'svg' => 'image/svg+xml',
'css' => 'text/css',
'html' => 'text/html',
'htm' => 'text/html',
'shtml' => 'text/html',
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => 'text/plain',
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => 'application/xml',
'xsl' => 'application/xml',
'dmn' => 'application/octet-stream',
'bpmn' => 'application/octet-stream',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => 'video/x-msvideo',
'movie' => 'video/x-sgi-movie',
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'docm' => 'application/vnd.ms-word.template.macroEnabled.12',
'dot' => 'application/msword',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'word' => 'application/msword',
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => 'application/json',
'pem' => 'application/x-x509-user-cert',
'p10' => 'application/x-pkcs10',
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => 'application/pkcs7-mime',
'p7m' => 'application/pkcs7-mime',
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => 'application/x-x509-ca-cert',
'crl' => 'application/pkix-crl',
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => 'application/pkix-cert',
'3g2' => 'video/3gpp2',
'3gp' => 'video/3gp',
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => 'video/mp4',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => 'video/x-ms-wmv',
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => 'audio/ogg',
'kmz' => 'application/vnd.google-earth.kmz',
'kml' => 'application/vnd.google-earth.kml+xml',
'ics' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7zip' => 'application/x-7z-compressed',
'cdr' => 'application/cdr',
'wma' => 'audio/x-ms-wma',
'jar' => 'application/java-archive',
'tex' => 'application/x-tex',
'latex' => 'application/x-latex',
'odt' => 'application/vnd.oasis.opendocument.text',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'odc' => 'application/vnd.oasis.opendocument.chart',
'odf' => 'application/vnd.oasis.opendocument.formula',
'odi' => 'application/vnd.oasis.opendocument.image',
'odm' => 'application/vnd.oasis.opendocument.text-master',
'odb' => 'application/vnd.oasis.opendocument.database',
'ott' => 'application/vnd.oasis.opendocument.text-template',
];
/** /**
* Detects MIME Type based on given content. * Detects MIME Type based on given content.
* *
...@@ -200,9 +41,17 @@ class MimeType ...@@ -200,9 +41,17 @@ class MimeType
*/ */
public static function detectByFileExtension($extension) public static function detectByFileExtension($extension)
{ {
return isset(static::$extensionToMimeTypeMap[$extension]) static $extensionToMimeTypeMap;
? static::$extensionToMimeTypeMap[$extension]
: 'text/plain'; if (! $extensionToMimeTypeMap) {
$extensionToMimeTypeMap = static::getExtensionToMimeTypeMap();
}
if (isset($extensionToMimeTypeMap[$extension])) {
return $extensionToMimeTypeMap[$extension];
}
return 'text/plain';
} }
/** /**
...@@ -222,6 +71,162 @@ class MimeType ...@@ -222,6 +71,162 @@ class MimeType
*/ */
public static function getExtensionToMimeTypeMap() public static function getExtensionToMimeTypeMap()
{ {
return static::$extensionToMimeTypeMap; return [
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'csv' => 'text/x-comma-separated-values',
'bin' => 'application/octet-stream',
'dms' => 'application/octet-stream',
'lha' => 'application/octet-stream',
'lzh' => 'application/octet-stream',
'exe' => 'application/octet-stream',
'class' => 'application/octet-stream',
'psd' => 'application/x-photoshop',
'so' => 'application/octet-stream',
'sea' => 'application/octet-stream',
'dll' => 'application/octet-stream',
'oda' => 'application/oda',
'pdf' => 'application/pdf',
'ai' => 'application/pdf',
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
'mif' => 'application/vnd.mif',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/powerpoint',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'wbxml' => 'application/wbxml',
'wmlc' => 'application/wmlc',
'dcr' => 'application/x-director',
'dir' => 'application/x-director',
'dxr' => 'application/x-director',
'dvi' => 'application/x-dvi',
'gtar' => 'application/x-gtar',
'gz' => 'application/x-gzip',
'gzip' => 'application/x-gzip',
'php' => 'application/x-httpd-php',
'php4' => 'application/x-httpd-php',
'php3' => 'application/x-httpd-php',
'phtml' => 'application/x-httpd-php',
'phps' => 'application/x-httpd-php-source',
'js' => 'application/javascript',
'swf' => 'application/x-shockwave-flash',
'sit' => 'application/x-stuffit',
'tar' => 'application/x-tar',
'tgz' => 'application/x-tar',
'z' => 'application/x-compress',
'xhtml' => 'application/xhtml+xml',
'xht' => 'application/xhtml+xml',
'zip' => 'application/x-zip',
'rar' => 'application/x-rar',
'mid' => 'audio/midi',
'midi' => 'audio/midi',
'mpga' => 'audio/mpeg',
'mp2' => 'audio/mpeg',
'mp3' => 'audio/mpeg',
'aif' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'ram' => 'audio/x-pn-realaudio',
'rm' => 'audio/x-pn-realaudio',
'rpm' => 'audio/x-pn-realaudio-plugin',
'ra' => 'audio/x-realaudio',
'rv' => 'video/vnd.rn-realvideo',
'wav' => 'audio/x-wav',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'jpe' => 'image/jpeg',
'png' => 'image/png',
'gif' => 'image/gif',
'bmp' => 'image/bmp',
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'svg' => 'image/svg+xml',
'css' => 'text/css',
'html' => 'text/html',
'htm' => 'text/html',
'shtml' => 'text/html',
'txt' => 'text/plain',
'text' => 'text/plain',
'log' => 'text/plain',
'rtx' => 'text/richtext',
'rtf' => 'text/rtf',
'xml' => 'application/xml',
'xsl' => 'application/xml',
'dmn' => 'application/octet-stream',
'bpmn' => 'application/octet-stream',
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'qt' => 'video/quicktime',
'mov' => 'video/quicktime',
'avi' => 'video/x-msvideo',
'movie' => 'video/x-sgi-movie',
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'docm' => 'application/vnd.ms-word.template.macroEnabled.12',
'dot' => 'application/msword',
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'word' => 'application/msword',
'xl' => 'application/excel',
'eml' => 'message/rfc822',
'json' => 'application/json',
'pem' => 'application/x-x509-user-cert',
'p10' => 'application/x-pkcs10',
'p12' => 'application/x-pkcs12',
'p7a' => 'application/x-pkcs7-signature',
'p7c' => 'application/pkcs7-mime',
'p7m' => 'application/pkcs7-mime',
'p7r' => 'application/x-pkcs7-certreqresp',
'p7s' => 'application/pkcs7-signature',
'crt' => 'application/x-x509-ca-cert',
'crl' => 'application/pkix-crl',
'der' => 'application/x-x509-ca-cert',
'kdb' => 'application/octet-stream',
'pgp' => 'application/pgp',
'gpg' => 'application/gpg-keys',
'sst' => 'application/octet-stream',
'csr' => 'application/octet-stream',
'rsa' => 'application/x-pkcs7',
'cer' => 'application/pkix-cert',
'3g2' => 'video/3gpp2',
'3gp' => 'video/3gp',
'mp4' => 'video/mp4',
'm4a' => 'audio/x-m4a',
'f4v' => 'video/mp4',
'webm' => 'video/webm',
'aac' => 'audio/x-acc',
'm4u' => 'application/vnd.mpegurl',
'm3u' => 'text/plain',
'xspf' => 'application/xspf+xml',
'vlc' => 'application/videolan',
'wmv' => 'video/x-ms-wmv',
'au' => 'audio/x-au',
'ac3' => 'audio/ac3',
'flac' => 'audio/x-flac',
'ogg' => 'audio/ogg',
'kmz' => 'application/vnd.google-earth.kmz',
'kml' => 'application/vnd.google-earth.kml+xml',
'ics' => 'text/calendar',
'zsh' => 'text/x-scriptzsh',
'7zip' => 'application/x-7z-compressed',
'cdr' => 'application/cdr',
'wma' => 'audio/x-ms-wma',
'jar' => 'application/java-archive',
'tex' => 'application/x-tex',
'latex' => 'application/x-latex',
'odt' => 'application/vnd.oasis.opendocument.text',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'odg' => 'application/vnd.oasis.opendocument.graphics',
'odc' => 'application/vnd.oasis.opendocument.chart',
'odf' => 'application/vnd.oasis.opendocument.formula',
'odi' => 'application/vnd.oasis.opendocument.image',
'odm' => 'application/vnd.oasis.opendocument.text-master',
'odb' => 'application/vnd.oasis.opendocument.database',
'ott' => 'application/vnd.oasis.opendocument.text-template',
];
} }
} }
### 1.24.0 (2018-11-05)
* Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors
* Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers)
* Added a way to log signals being received using Monolog\SignalHandler
* Added ability to customize error handling at the Logger level using Logger::setExceptionHandler
* Added InsightOpsHandler to migrate users of the LogEntriesHandler
* Added protection to NormalizerHandler against circular and very deep structures, it now stops normalizing at a depth of 9
* Added capture of stack traces to ErrorHandler when logging PHP errors
* Added RavenHandler support for a `contexts` context or extra key to forward that to Sentry's contexts
* Added forwarding of context info to FluentdFormatter
* Added SocketHandler::setChunkSize to override the default chunk size in case you must send large log lines to rsyslog for example
* Added ability to extend/override BrowserConsoleHandler
* Added SlackWebhookHandler::getWebhookUrl and SlackHandler::getToken to enable class extensibility
* Added SwiftMailerHandler::getSubjectFormatter to enable class extensibility
* Dropped official support for HHVM in test builds
* Fixed normalization of exception traces when call_user_func is used to avoid serializing objects and the data they contain
* Fixed naming of fields in Slack handler, all field names are now capitalized in all cases
* Fixed HipChatHandler bug where slack dropped messages randomly
* Fixed normalization of objects in Slack handlers
* Fixed support for PHP7's Throwable in NewRelicHandler
* Fixed race bug when StreamHandler sometimes incorrectly reported it failed to create a directory
* Fixed table row styling issues in HtmlFormatter
* Fixed RavenHandler dropping the message when logging exception
* Fixed WhatFailureGroupHandler skipping processors when using handleBatch
and implement it where possible
* Fixed display of anonymous class names
### 1.23.0 (2017-06-19) ### 1.23.0 (2017-06-19)
* Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument * Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
[![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) [![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
[![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) [![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
[![Reference Status](https://www.versioneye.com/php/monolog:monolog/reference_badge.svg)](https://www.versioneye.com/php/monolog:monolog/references)
Monolog sends your logs to files, sockets, inboxes, databases and various Monolog sends your logs to files, sockets, inboxes, databases and various
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
- _RollbarHandler_: Logs records to a [Rollbar](https://rollbar.com/) account. - _RollbarHandler_: Logs records to a [Rollbar](https://rollbar.com/) account.
- _SyslogUdpHandler_: Logs records to a remote [Syslogd](http://www.rsyslog.com/) server. - _SyslogUdpHandler_: Logs records to a remote [Syslogd](http://www.rsyslog.com/) server.
- _LogEntriesHandler_: Logs records to a [LogEntries](http://logentries.com/) account. - _LogEntriesHandler_: Logs records to a [LogEntries](http://logentries.com/) account.
- _InsightOpsHandler_: Logs records to a [InsightOps](https://www.rapid7.com/products/insightops/) account.
### Logging in development ### Logging in development
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
help in some older codebases or for ease of use. help in some older codebases or for ease of use.
- _ErrorHandler_: The `Monolog\ErrorHandler` class allows you to easily register - _ErrorHandler_: The `Monolog\ErrorHandler` class allows you to easily register
a Logger instance as an exception handler, error handler or fatal error handler. a Logger instance as an exception handler, error handler or fatal error handler.
- _SignalHandler_: The `Monolog\SignalHandler` class allows you to easily register
a Logger instance as a POSIX signal handler.
- _ErrorLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log - _ErrorLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log
level is reached. level is reached.
- _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain - _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain
......
...@@ -14,6 +14,7 @@ namespace Monolog; ...@@ -14,6 +14,7 @@ namespace Monolog;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel; use Psr\Log\LogLevel;
use Monolog\Handler\AbstractHandler; use Monolog\Handler\AbstractHandler;
use Monolog\Registry;
/** /**
* Monolog error handler * Monolog error handler
...@@ -38,6 +39,7 @@ class ErrorHandler ...@@ -38,6 +39,7 @@ class ErrorHandler
private $hasFatalErrorHandler; private $hasFatalErrorHandler;
private $fatalLevel; private $fatalLevel;
private $reservedMemory; private $reservedMemory;
private $lastFatalTrace;
private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR); private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR);
public function __construct(LoggerInterface $logger) public function __construct(LoggerInterface $logger)
...@@ -132,7 +134,7 @@ class ErrorHandler ...@@ -132,7 +134,7 @@ class ErrorHandler
{ {
$this->logger->log( $this->logger->log(
$this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel, $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel,
sprintf('Uncaught Exception %s: "%s" at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()), sprintf('Uncaught Exception %s: "%s" at %s line %s', Utils::getClass($e), $e->getMessage(), $e->getFile(), $e->getLine()),
array('exception' => $e) array('exception' => $e)
); );
...@@ -156,6 +158,13 @@ class ErrorHandler ...@@ -156,6 +158,13 @@ class ErrorHandler
if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) { if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) {
$level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL; $level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
$this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line)); $this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line));
} else {
// http://php.net/manual/en/function.debug-backtrace.php
// As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added.
// Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'.
$trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS);
array_shift($trace); // Exclude handleError from trace
$this->lastFatalTrace = $trace;
} }
if ($this->previousErrorHandler === true) { if ($this->previousErrorHandler === true) {
...@@ -177,7 +186,7 @@ class ErrorHandler ...@@ -177,7 +186,7 @@ class ErrorHandler
$this->logger->log( $this->logger->log(
$this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel, $this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel,
'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'], 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line']) array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $this->lastFatalTrace)
); );
if ($this->logger instanceof Logger) { if ($this->logger instanceof Logger) {
......
...@@ -62,6 +62,7 @@ class FluentdFormatter implements FormatterInterface ...@@ -62,6 +62,7 @@ class FluentdFormatter implements FormatterInterface
$message = array( $message = array(
'message' => $record['message'], 'message' => $record['message'],
'context' => $record['context'],
'extra' => $record['extra'], 'extra' => $record['extra'],
); );
......
...@@ -58,7 +58,7 @@ class HtmlFormatter extends NormalizerFormatter ...@@ -58,7 +58,7 @@ class HtmlFormatter extends NormalizerFormatter
$td = '<pre>'.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'</pre>'; $td = '<pre>'.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'</pre>';
} }
return "<tr style=\"padding: 4px;spacing: 0;text-align: left;\">\n<th style=\"background: #cccccc\" width=\"100px\">$th:</th>\n<td style=\"padding: 4px;spacing: 0;text-align: left;background: #eeeeee\">".$td."</td>\n</tr>"; return "<tr style=\"padding: 4px;text-align: left;\">\n<th style=\"vertical-align: top;background: #ccc;color: #000\" width=\"100\">$th:</th>\n<td style=\"padding: 4px;text-align: left;vertical-align: top;background: #eee;color: #000\">".$td."</td>\n</tr>";
} }
/** /**
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace Monolog\Formatter; namespace Monolog\Formatter;
use Exception; use Exception;
use Monolog\Utils;
use Throwable; use Throwable;
/** /**
...@@ -138,18 +139,23 @@ class JsonFormatter extends NormalizerFormatter ...@@ -138,18 +139,23 @@ class JsonFormatter extends NormalizerFormatter
* *
* @return mixed * @return mixed
*/ */
protected function normalize($data) protected function normalize($data, $depth = 0)
{ {
if ($depth > 9) {
return 'Over 9 levels deep, aborting normalization';
}
if (is_array($data) || $data instanceof \Traversable) { if (is_array($data) || $data instanceof \Traversable) {
$normalized = array(); $normalized = array();
$count = 1; $count = 1;
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
if ($count++ >= 1000) { if ($count++ > 1000) {
$normalized['...'] = 'Over 1000 items, aborting normalization'; $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization';
break; break;
} }
$normalized[$key] = $this->normalize($value);
$normalized[$key] = $this->normalize($value, $depth+1);
} }
return $normalized; return $normalized;
...@@ -174,11 +180,11 @@ class JsonFormatter extends NormalizerFormatter ...@@ -174,11 +180,11 @@ class JsonFormatter extends NormalizerFormatter
{ {
// TODO 2.0 only check for Throwable // TODO 2.0 only check for Throwable
if (!$e instanceof Exception && !$e instanceof Throwable) { if (!$e instanceof Exception && !$e instanceof Throwable) {
throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.get_class($e)); throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e));
} }
$data = array( $data = array(
'class' => get_class($e), 'class' => Utils::getClass($e),
'message' => $e->getMessage(), 'message' => $e->getMessage(),
'code' => $e->getCode(), 'code' => $e->getCode(),
'file' => $e->getFile().':'.$e->getLine(), 'file' => $e->getFile().':'.$e->getLine(),
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
namespace Monolog\Formatter; namespace Monolog\Formatter;
use Monolog\Utils;
/** /**
* Formats incoming records into a one-line string * Formats incoming records into a one-line string
* *
...@@ -129,17 +131,17 @@ class LineFormatter extends NormalizerFormatter ...@@ -129,17 +131,17 @@ class LineFormatter extends NormalizerFormatter
{ {
// TODO 2.0 only check for Throwable // TODO 2.0 only check for Throwable
if (!$e instanceof \Exception && !$e instanceof \Throwable) { if (!$e instanceof \Exception && !$e instanceof \Throwable) {
throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.get_class($e)); throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e));
} }
$previousText = ''; $previousText = '';
if ($previous = $e->getPrevious()) { if ($previous = $e->getPrevious()) {
do { do {
$previousText .= ', '.get_class($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine(); $previousText .= ', '.Utils::getClass($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine();
} while ($previous = $previous->getPrevious()); } while ($previous = $previous->getPrevious());
} }
$str = '[object] ('.get_class($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')'; $str = '[object] ('.Utils::getClass($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')';
if ($this->includeStacktraces) { if ($this->includeStacktraces) {
$str .= "\n[stacktrace]\n".$e->getTraceAsString()."\n"; $str .= "\n[stacktrace]\n".$e->getTraceAsString()."\n";
} }
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
namespace Monolog\Formatter; namespace Monolog\Formatter;
use Monolog\Utils;
/** /**
* Formats a record for use with the MongoDBHandler. * Formats a record for use with the MongoDBHandler.
* *
...@@ -75,7 +77,7 @@ class MongoDBFormatter implements FormatterInterface ...@@ -75,7 +77,7 @@ class MongoDBFormatter implements FormatterInterface
protected function formatObject($value, $nestingLevel) protected function formatObject($value, $nestingLevel)
{ {
$objectVars = get_object_vars($value); $objectVars = get_object_vars($value);
$objectVars['class'] = get_class($value); $objectVars['class'] = Utils::getClass($value);
return $this->formatArray($objectVars, $nestingLevel); return $this->formatArray($objectVars, $nestingLevel);
} }
...@@ -83,7 +85,7 @@ class MongoDBFormatter implements FormatterInterface ...@@ -83,7 +85,7 @@ class MongoDBFormatter implements FormatterInterface
protected function formatException(\Exception $exception, $nestingLevel) protected function formatException(\Exception $exception, $nestingLevel)
{ {
$formattedException = array( $formattedException = array(
'class' => get_class($exception), 'class' => Utils::getClass($exception),
'message' => $exception->getMessage(), 'message' => $exception->getMessage(),
'code' => $exception->getCode(), 'code' => $exception->getCode(),
'file' => $exception->getFile() . ':' . $exception->getLine(), 'file' => $exception->getFile() . ':' . $exception->getLine(),
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace Monolog\Formatter; namespace Monolog\Formatter;
use Exception; use Exception;
use Monolog\Utils;
/** /**
* Normalizes incoming records to remove objects/resources so it's easier to dump to various targets * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets
...@@ -55,8 +56,12 @@ class NormalizerFormatter implements FormatterInterface ...@@ -55,8 +56,12 @@ class NormalizerFormatter implements FormatterInterface
return $records; return $records;
} }
protected function normalize($data) protected function normalize($data, $depth = 0)
{ {
if ($depth > 9) {
return 'Over 9 levels deep, aborting normalization';
}
if (null === $data || is_scalar($data)) { if (null === $data || is_scalar($data)) {
if (is_float($data)) { if (is_float($data)) {
if (is_infinite($data)) { if (is_infinite($data)) {
...@@ -75,11 +80,12 @@ class NormalizerFormatter implements FormatterInterface ...@@ -75,11 +80,12 @@ class NormalizerFormatter implements FormatterInterface
$count = 1; $count = 1;
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
if ($count++ >= 1000) { if ($count++ > 1000) {
$normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization'; $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization';
break; break;
} }
$normalized[$key] = $this->normalize($value);
$normalized[$key] = $this->normalize($value, $depth+1);
} }
return $normalized; return $normalized;
...@@ -103,7 +109,7 @@ class NormalizerFormatter implements FormatterInterface ...@@ -103,7 +109,7 @@ class NormalizerFormatter implements FormatterInterface
$value = $this->toJson($data, true); $value = $this->toJson($data, true);
} }
return sprintf("[object] (%s: %s)", get_class($data), $value); return sprintf("[object] (%s: %s)", Utils::getClass($data), $value);
} }
if (is_resource($data)) { if (is_resource($data)) {
...@@ -117,11 +123,11 @@ class NormalizerFormatter implements FormatterInterface ...@@ -117,11 +123,11 @@ class NormalizerFormatter implements FormatterInterface
{ {
// TODO 2.0 only check for Throwable // TODO 2.0 only check for Throwable
if (!$e instanceof Exception && !$e instanceof \Throwable) { if (!$e instanceof Exception && !$e instanceof \Throwable) {
throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.get_class($e)); throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e));
} }
$data = array( $data = array(
'class' => get_class($e), 'class' => Utils::getClass($e),
'message' => $e->getMessage(), 'message' => $e->getMessage(),
'code' => $e->getCode(), 'code' => $e->getCode(),
'file' => $e->getFile().':'.$e->getLine(), 'file' => $e->getFile().':'.$e->getLine(),
...@@ -146,9 +152,20 @@ class NormalizerFormatter implements FormatterInterface ...@@ -146,9 +152,20 @@ class NormalizerFormatter implements FormatterInterface
if (isset($frame['file'])) { if (isset($frame['file'])) {
$data['trace'][] = $frame['file'].':'.$frame['line']; $data['trace'][] = $frame['file'].':'.$frame['line'];
} elseif (isset($frame['function']) && $frame['function'] === '{closure}') { } elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
// We should again normalize the frames, because it might contain invalid items // Simplify closures handling
$data['trace'][] = $frame['function']; $data['trace'][] = $frame['function'];
} else { } else {
if (isset($frame['args'])) {
// Make sure that objects present as arguments are not serialized nicely but rather only
// as a class name to avoid any unexpected leak of sensitive information
$frame['args'] = array_map(function ($arg) {
if (is_object($arg) && !($arg instanceof \DateTime || $arg instanceof \DateTimeInterface)) {
return sprintf("[object] (%s)", Utils::getClass($arg));
}
return $arg;
}, $frame['args']);
}
// We should again normalize the frames, because it might contain invalid items // We should again normalize the frames, because it might contain invalid items
$data['trace'][] = $this->toJson($this->normalize($frame), true); $data['trace'][] = $this->toJson($this->normalize($frame), true);
} }
......
...@@ -102,12 +102,12 @@ class WildfireFormatter extends NormalizerFormatter ...@@ -102,12 +102,12 @@ class WildfireFormatter extends NormalizerFormatter
throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter'); throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter');
} }
protected function normalize($data) protected function normalize($data, $depth = 0)
{ {
if (is_object($data) && !$data instanceof \DateTime) { if (is_object($data) && !$data instanceof \DateTime) {
return $data; return $data;
} }
return parent::normalize($data); return parent::normalize($data, $depth);
} }
} }
...@@ -11,16 +11,17 @@ ...@@ -11,16 +11,17 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\Logger;
use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\FormatterInterface;
use Monolog\Formatter\LineFormatter; use Monolog\Formatter\LineFormatter;
use Monolog\Logger;
use Monolog\ResettableInterface;
/** /**
* Base Handler class providing the Handler structure * Base Handler class providing the Handler structure
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
abstract class AbstractHandler implements HandlerInterface abstract class AbstractHandler implements HandlerInterface, ResettableInterface
{ {
protected $level = Logger::DEBUG; protected $level = Logger::DEBUG;
protected $bubble = true; protected $bubble = true;
...@@ -32,8 +33,8 @@ abstract class AbstractHandler implements HandlerInterface ...@@ -32,8 +33,8 @@ abstract class AbstractHandler implements HandlerInterface
protected $processors = array(); protected $processors = array();
/** /**
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct($level = Logger::DEBUG, $bubble = true) public function __construct($level = Logger::DEBUG, $bubble = true)
{ {
...@@ -141,8 +142,8 @@ abstract class AbstractHandler implements HandlerInterface ...@@ -141,8 +142,8 @@ abstract class AbstractHandler implements HandlerInterface
/** /**
* Sets the bubbling behavior. * Sets the bubbling behavior.
* *
* @param Boolean $bubble true means that this handler allows bubbling. * @param bool $bubble true means that this handler allows bubbling.
* false means that bubbling is not permitted. * false means that bubbling is not permitted.
* @return self * @return self
*/ */
public function setBubble($bubble) public function setBubble($bubble)
...@@ -155,8 +156,8 @@ abstract class AbstractHandler implements HandlerInterface ...@@ -155,8 +156,8 @@ abstract class AbstractHandler implements HandlerInterface
/** /**
* Gets the bubbling behavior. * Gets the bubbling behavior.
* *
* @return Boolean true means that this handler allows bubbling. * @return bool true means that this handler allows bubbling.
* false means that bubbling is not permitted. * false means that bubbling is not permitted.
*/ */
public function getBubble() public function getBubble()
{ {
...@@ -174,6 +175,15 @@ abstract class AbstractHandler implements HandlerInterface ...@@ -174,6 +175,15 @@ abstract class AbstractHandler implements HandlerInterface
} }
} }
public function reset()
{
foreach ($this->processors as $processor) {
if ($processor instanceof ResettableInterface) {
$processor->reset();
}
}
}
/** /**
* Gets the default formatter. * Gets the default formatter.
* *
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\ResettableInterface;
/** /**
* Base Handler class providing the Handler structure * Base Handler class providing the Handler structure
* *
......
...@@ -53,9 +53,9 @@ abstract class AbstractSyslogHandler extends AbstractProcessingHandler ...@@ -53,9 +53,9 @@ abstract class AbstractSyslogHandler extends AbstractProcessingHandler
); );
/** /**
* @param mixed $facility * @param mixed $facility
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true) public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
{ {
......
...@@ -43,11 +43,11 @@ class BrowserConsoleHandler extends AbstractProcessingHandler ...@@ -43,11 +43,11 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
protected function write(array $record) protected function write(array $record)
{ {
// Accumulate records // Accumulate records
self::$records[] = $record; static::$records[] = $record;
// Register shutdown handler if not already done // Register shutdown handler if not already done
if (!self::$initialized) { if (!static::$initialized) {
self::$initialized = true; static::$initialized = true;
$this->registerShutdownFunction(); $this->registerShutdownFunction();
} }
} }
...@@ -58,27 +58,37 @@ class BrowserConsoleHandler extends AbstractProcessingHandler ...@@ -58,27 +58,37 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
*/ */
public static function send() public static function send()
{ {
$format = self::getResponseFormat(); $format = static::getResponseFormat();
if ($format === 'unknown') { if ($format === 'unknown') {
return; return;
} }
if (count(self::$records)) { if (count(static::$records)) {
if ($format === 'html') { if ($format === 'html') {
self::writeOutput('<script>' . self::generateScript() . '</script>'); static::writeOutput('<script>' . static::generateScript() . '</script>');
} elseif ($format === 'js') { } elseif ($format === 'js') {
self::writeOutput(self::generateScript()); static::writeOutput(static::generateScript());
} }
self::reset(); static::resetStatic();
} }
} }
public function close()
{
self::resetStatic();
}
public function reset()
{
self::resetStatic();
}
/** /**
* Forget all logged records * Forget all logged records
*/ */
public static function reset() public static function resetStatic()
{ {
self::$records = array(); static::$records = array();
} }
/** /**
...@@ -133,18 +143,18 @@ class BrowserConsoleHandler extends AbstractProcessingHandler ...@@ -133,18 +143,18 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
private static function generateScript() private static function generateScript()
{ {
$script = array(); $script = array();
foreach (self::$records as $record) { foreach (static::$records as $record) {
$context = self::dump('Context', $record['context']); $context = static::dump('Context', $record['context']);
$extra = self::dump('Extra', $record['extra']); $extra = static::dump('Extra', $record['extra']);
if (empty($context) && empty($extra)) { if (empty($context) && empty($extra)) {
$script[] = self::call_array('log', self::handleStyles($record['formatted'])); $script[] = static::call_array('log', static::handleStyles($record['formatted']));
} else { } else {
$script = array_merge($script, $script = array_merge($script,
array(self::call_array('groupCollapsed', self::handleStyles($record['formatted']))), array(static::call_array('groupCollapsed', static::handleStyles($record['formatted']))),
$context, $context,
$extra, $extra,
array(self::call('groupEnd')) array(static::call('groupEnd'))
); );
} }
} }
...@@ -154,19 +164,19 @@ class BrowserConsoleHandler extends AbstractProcessingHandler ...@@ -154,19 +164,19 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
private static function handleStyles($formatted) private static function handleStyles($formatted)
{ {
$args = array(self::quote('font-weight: normal')); $args = array(static::quote('font-weight: normal'));
$format = '%c' . $formatted; $format = '%c' . $formatted;
preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
foreach (array_reverse($matches) as $match) { foreach (array_reverse($matches) as $match) {
$args[] = self::quote(self::handleCustomStyles($match[2][0], $match[1][0])); $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0]));
$args[] = '"font-weight: normal"'; $args[] = '"font-weight: normal"';
$pos = $match[0][1]; $pos = $match[0][1];
$format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0])); $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0]));
} }
array_unshift($args, self::quote($format)); array_unshift($args, static::quote($format));
return $args; return $args;
} }
...@@ -198,13 +208,13 @@ class BrowserConsoleHandler extends AbstractProcessingHandler ...@@ -198,13 +208,13 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
if (empty($dict)) { if (empty($dict)) {
return $script; return $script;
} }
$script[] = self::call('log', self::quote('%c%s'), self::quote('font-weight: bold'), self::quote($title)); $script[] = static::call('log', static::quote('%c%s'), static::quote('font-weight: bold'), static::quote($title));
foreach ($dict as $key => $value) { foreach ($dict as $key => $value) {
$value = json_encode($value); $value = json_encode($value);
if (empty($value)) { if (empty($value)) {
$value = self::quote(''); $value = static::quote('');
} }
$script[] = self::call('log', self::quote('%s: %o'), self::quote($key), $value); $script[] = static::call('log', static::quote('%s: %o'), static::quote($key), $value);
} }
return $script; return $script;
...@@ -220,7 +230,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler ...@@ -220,7 +230,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
$args = func_get_args(); $args = func_get_args();
$method = array_shift($args); $method = array_shift($args);
return self::call_array($method, $args); return static::call_array($method, $args);
} }
private static function call_array($method, array $args) private static function call_array($method, array $args)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\Logger; use Monolog\Logger;
use Monolog\ResettableInterface;
/** /**
* Buffers all records until closing the handler and then pass them as batch. * Buffers all records until closing the handler and then pass them as batch.
...@@ -34,8 +35,8 @@ class BufferHandler extends AbstractHandler ...@@ -34,8 +35,8 @@ class BufferHandler extends AbstractHandler
* @param HandlerInterface $handler Handler. * @param HandlerInterface $handler Handler.
* @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. * @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param Boolean $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded * @param bool $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded
*/ */
public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false) public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false)
{ {
...@@ -114,4 +115,15 @@ class BufferHandler extends AbstractHandler ...@@ -114,4 +115,15 @@ class BufferHandler extends AbstractHandler
$this->bufferSize = 0; $this->bufferSize = 0;
$this->buffer = array(); $this->buffer = array();
} }
public function reset()
{
$this->flush();
parent::reset();
if ($this->handler instanceof ResettableInterface) {
$this->handler->reset();
}
}
} }
...@@ -32,7 +32,7 @@ class ChromePHPHandler extends AbstractProcessingHandler ...@@ -32,7 +32,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
* Header name * Header name
*/ */
const HEADER_NAME = 'X-ChromeLogger-Data'; const HEADER_NAME = 'X-ChromeLogger-Data';
/** /**
* Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+) * Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+)
*/ */
...@@ -45,7 +45,7 @@ class ChromePHPHandler extends AbstractProcessingHandler ...@@ -45,7 +45,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
* *
* Chrome limits the headers to 256KB, so when we sent 240KB we stop sending * Chrome limits the headers to 256KB, so when we sent 240KB we stop sending
* *
* @var Boolean * @var bool
*/ */
protected static $overflowed = false; protected static $overflowed = false;
...@@ -58,8 +58,8 @@ class ChromePHPHandler extends AbstractProcessingHandler ...@@ -58,8 +58,8 @@ class ChromePHPHandler extends AbstractProcessingHandler
protected static $sendHeaders = true; protected static $sendHeaders = true;
/** /**
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct($level = Logger::DEBUG, $bubble = true) public function __construct($level = Logger::DEBUG, $bubble = true)
{ {
...@@ -174,7 +174,7 @@ class ChromePHPHandler extends AbstractProcessingHandler ...@@ -174,7 +174,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
/** /**
* Verifies if the headers are accepted by the current user agent * Verifies if the headers are accepted by the current user agent
* *
* @return Boolean * @return bool
*/ */
protected function headersAccepted() protected function headersAccepted()
{ {
......
...@@ -60,7 +60,7 @@ class DeduplicationHandler extends BufferHandler ...@@ -60,7 +60,7 @@ class DeduplicationHandler extends BufferHandler
* @param string $deduplicationStore The file/path where the deduplication log should be kept * @param string $deduplicationStore The file/path where the deduplication log should be kept
* @param int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes * @param int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes
* @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct(HandlerInterface $handler, $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, $time = 60, $bubble = true) public function __construct(HandlerInterface $handler, $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, $time = 60, $bubble = true)
{ {
......
...@@ -46,10 +46,10 @@ class ElasticSearchHandler extends AbstractProcessingHandler ...@@ -46,10 +46,10 @@ class ElasticSearchHandler extends AbstractProcessingHandler
protected $options = array(); protected $options = array();
/** /**
* @param Client $client Elastica Client object * @param Client $client Elastica Client object
* @param array $options Handler configuration * @param array $options Handler configuration
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true) public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true)
{ {
......
...@@ -28,10 +28,10 @@ class ErrorLogHandler extends AbstractProcessingHandler ...@@ -28,10 +28,10 @@ class ErrorLogHandler extends AbstractProcessingHandler
protected $expandNewlines; protected $expandNewlines;
/** /**
* @param int $messageType Says where the error should go. * @param int $messageType Says where the error should go.
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param Boolean $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries * @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries
*/ */
public function __construct($messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, $bubble = true, $expandNewlines = false) public function __construct($messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, $bubble = true, $expandNewlines = false)
{ {
......
...@@ -40,7 +40,7 @@ class FilterHandler extends AbstractHandler ...@@ -40,7 +40,7 @@ class FilterHandler extends AbstractHandler
/** /**
* Whether the messages that are handled can bubble up the stack or not * Whether the messages that are handled can bubble up the stack or not
* *
* @var Boolean * @var bool
*/ */
protected $bubble; protected $bubble;
...@@ -48,7 +48,7 @@ class FilterHandler extends AbstractHandler ...@@ -48,7 +48,7 @@ class FilterHandler extends AbstractHandler
* @param callable|HandlerInterface $handler Handler or factory callable($record, $this). * @param callable|HandlerInterface $handler Handler or factory callable($record, $this).
* @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
* @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true) public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true)
{ {
......
...@@ -22,7 +22,7 @@ interface ActivationStrategyInterface ...@@ -22,7 +22,7 @@ interface ActivationStrategyInterface
* Returns whether the given record activates the handler. * Returns whether the given record activates the handler.
* *
* @param array $record * @param array $record
* @return Boolean * @return bool
*/ */
public function isHandlerActivated(array $record); public function isHandlerActivated(array $record);
} }
...@@ -14,6 +14,7 @@ namespace Monolog\Handler; ...@@ -14,6 +14,7 @@ namespace Monolog\Handler;
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
use Monolog\Logger; use Monolog\Logger;
use Monolog\ResettableInterface;
/** /**
* Buffers all records until a certain level is reached * Buffers all records until a certain level is reached
...@@ -41,8 +42,8 @@ class FingersCrossedHandler extends AbstractHandler ...@@ -41,8 +42,8 @@ class FingersCrossedHandler extends AbstractHandler
* @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler). * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
* @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
* @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param Boolean $stopBuffering Whether the handler should stop buffering after being triggered (default true) * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true)
* @param int $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered * @param int $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered
*/ */
public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true, $passthruLevel = null) public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true, $passthruLevel = null)
...@@ -130,24 +131,18 @@ class FingersCrossedHandler extends AbstractHandler ...@@ -130,24 +131,18 @@ class FingersCrossedHandler extends AbstractHandler
*/ */
public function close() public function close()
{ {
if (null !== $this->passthruLevel) { $this->flushBuffer();
$level = $this->passthruLevel;
$this->buffer = array_filter($this->buffer, function ($record) use ($level) {
return $record['level'] >= $level;
});
if (count($this->buffer) > 0) {
$this->handler->handleBatch($this->buffer);
$this->buffer = array();
}
}
} }
/**
* Resets the state of the handler. Stops forwarding records to the wrapped handler.
*/
public function reset() public function reset()
{ {
$this->buffering = true; $this->flushBuffer();
parent::reset();
if ($this->handler instanceof ResettableInterface) {
$this->handler->reset();
}
} }
/** /**
...@@ -160,4 +155,23 @@ class FingersCrossedHandler extends AbstractHandler ...@@ -160,4 +155,23 @@ class FingersCrossedHandler extends AbstractHandler
$this->buffer = array(); $this->buffer = array();
$this->reset(); $this->reset();
} }
/**
* Resets the state of the handler. Stops forwarding records to the wrapped handler.
*/
private function flushBuffer()
{
if (null !== $this->passthruLevel) {
$level = $this->passthruLevel;
$this->buffer = array_filter($this->buffer, function ($record) use ($level) {
return $record['level'] >= $level;
});
if (count($this->buffer) > 0) {
$this->handler->handleBatch($this->buffer);
}
}
$this->buffer = array();
$this->buffering = true;
}
} }
...@@ -158,7 +158,7 @@ class FirePHPHandler extends AbstractProcessingHandler ...@@ -158,7 +158,7 @@ class FirePHPHandler extends AbstractProcessingHandler
/** /**
* Verifies if the headers are accepted by the current user agent * Verifies if the headers are accepted by the current user agent
* *
* @return Boolean * @return bool
*/ */
protected function headersAccepted() protected function headersAccepted()
{ {
......
...@@ -50,14 +50,6 @@ class GelfHandler extends AbstractProcessingHandler ...@@ -50,14 +50,6 @@ class GelfHandler extends AbstractProcessingHandler
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function close()
{
$this->publisher = null;
}
/**
* {@inheritdoc}
*/
protected function write(array $record) protected function write(array $record)
{ {
$this->publisher->publish($record['formatted']); $this->publisher->publish($record['formatted']);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\FormatterInterface;
use Monolog\ResettableInterface;
/** /**
* Forwards records to multiple handlers * Forwards records to multiple handlers
...@@ -23,8 +24,8 @@ class GroupHandler extends AbstractHandler ...@@ -23,8 +24,8 @@ class GroupHandler extends AbstractHandler
protected $handlers; protected $handlers;
/** /**
* @param array $handlers Array of Handlers. * @param array $handlers Array of Handlers.
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct(array $handlers, $bubble = true) public function __construct(array $handlers, $bubble = true)
{ {
...@@ -90,6 +91,17 @@ class GroupHandler extends AbstractHandler ...@@ -90,6 +91,17 @@ class GroupHandler extends AbstractHandler
} }
} }
public function reset()
{
parent::reset();
foreach ($this->handlers as $handler) {
if ($handler instanceof ResettableInterface) {
$handler->reset();
}
}
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
...@@ -31,7 +31,7 @@ interface HandlerInterface ...@@ -31,7 +31,7 @@ interface HandlerInterface
* *
* @param array $record Partial log record containing only a level key * @param array $record Partial log record containing only a level key
* *
* @return Boolean * @return bool
*/ */
public function isHandling(array $record); public function isHandling(array $record);
...@@ -46,7 +46,7 @@ interface HandlerInterface ...@@ -46,7 +46,7 @@ interface HandlerInterface
* calling further handlers in the stack with a given log record. * calling further handlers in the stack with a given log record.
* *
* @param array $record The record to handle * @param array $record The record to handle
* @return Boolean true means that this handler handled the record, and that bubbling is not permitted. * @return bool true means that this handler handled the record, and that bubbling is not permitted.
* false means the record was either not processed or that this handler allows bubbling. * false means the record was either not processed or that this handler allows bubbling.
*/ */
public function handle(array $record); public function handle(array $record);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\ResettableInterface;
use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\FormatterInterface;
/** /**
...@@ -30,7 +31,7 @@ use Monolog\Formatter\FormatterInterface; ...@@ -30,7 +31,7 @@ use Monolog\Formatter\FormatterInterface;
* *
* @author Alexey Karapetov <alexey@karapetov.com> * @author Alexey Karapetov <alexey@karapetov.com>
*/ */
class HandlerWrapper implements HandlerInterface class HandlerWrapper implements HandlerInterface, ResettableInterface
{ {
/** /**
* @var HandlerInterface * @var HandlerInterface
...@@ -105,4 +106,11 @@ class HandlerWrapper implements HandlerInterface ...@@ -105,4 +106,11 @@ class HandlerWrapper implements HandlerInterface
{ {
return $this->handler->getFormatter(); return $this->handler->getFormatter();
} }
public function reset()
{
if ($this->handler instanceof ResettableInterface) {
return $this->handler->reset();
}
}
} }
...@@ -219,6 +219,21 @@ class HipChatHandler extends SocketHandler ...@@ -219,6 +219,21 @@ class HipChatHandler extends SocketHandler
protected function write(array $record) protected function write(array $record)
{ {
parent::write($record); parent::write($record);
$this->finalizeWrite();
}
/**
* Finalizes the request by reading some bytes and then closing the socket
*
* If we do not read some but close the socket too early, hipchat sometimes
* drops the request entirely.
*/
protected function finalizeWrite()
{
$res = $this->getResource();
if (is_resource($res)) {
@fread($res, 2048);
}
$this->closeSocket(); $this->closeSocket();
} }
......
...@@ -30,10 +30,10 @@ class IFTTTHandler extends AbstractProcessingHandler ...@@ -30,10 +30,10 @@ class IFTTTHandler extends AbstractProcessingHandler
private $secretKey; private $secretKey;
/** /**
* @param string $eventName The name of the IFTTT Maker event that should be triggered * @param string $eventName The name of the IFTTT Maker event that should be triggered
* @param string $secretKey A valid IFTTT secret key * @param string $secretKey A valid IFTTT secret key
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true) public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true)
{ {
......
<?php
/*
* 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;
/**
* Inspired on LogEntriesHandler.
*
* @author Robert Kaufmann III <rok3@rok3.me>
* @author Gabriel Machado <gabriel.ms1@hotmail.com>
*/
class InsightOpsHandler extends SocketHandler
{
/**
* @var string
*/
protected $logToken;
/**
* @param string $token Log token supplied by InsightOps
* @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'.
* @param bool $useSSL Whether or not SSL encryption should be used
* @param int $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($token, $region = 'us', $useSSL = true, $level = Logger::DEBUG, $bubble = true)
{
if ($useSSL && !extension_loaded('openssl')) {
throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
}
$endpoint = $useSSL
? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443'
: $region . '.data.logs.insight.rapid7.com:80';
parent::__construct($endpoint, $level, $bubble);
$this->logToken = $token;
}
/**
* {@inheritdoc}
*
* @param array $record
* @return string
*/
protected function generateDataStream($record)
{
return $this->logToken . ' ' . $record['formatted'];
}
}
...@@ -31,13 +31,13 @@ class LogEntriesHandler extends SocketHandler ...@@ -31,13 +31,13 @@ class LogEntriesHandler extends SocketHandler
* *
* @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
*/ */
public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true) public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true, $host = 'data.logentries.com')
{ {
if ($useSSL && !extension_loaded('openssl')) { if ($useSSL && !extension_loaded('openssl')) {
throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler'); throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
} }
$endpoint = $useSSL ? 'ssl://data.logentries.com:443' : 'data.logentries.com:80'; $endpoint = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
parent::__construct($endpoint, $level, $bubble); parent::__construct($endpoint, $level, $bubble);
$this->logToken = $token; $this->logToken = $token;
} }
......
...@@ -27,7 +27,7 @@ class MandrillHandler extends MailHandler ...@@ -27,7 +27,7 @@ class MandrillHandler extends MailHandler
* @param string $apiKey A valid Mandrill API key * @param string $apiKey A valid Mandrill API key
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true) public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true)
{ {
......
...@@ -18,6 +18,8 @@ use Monolog\Formatter\NormalizerFormatter; ...@@ -18,6 +18,8 @@ use Monolog\Formatter\NormalizerFormatter;
* Class to record a log on a NewRelic application. * Class to record a log on a NewRelic application.
* Enabling New Relic High Security mode may prevent capture of useful information. * Enabling New Relic High Security mode may prevent capture of useful information.
* *
* This handler requires a NormalizerFormatter to function and expects an array in $record['formatted']
*
* @see https://docs.newrelic.com/docs/agents/php-agent * @see https://docs.newrelic.com/docs/agents/php-agent
* @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security
*/ */
...@@ -84,7 +86,7 @@ class NewRelicHandler extends AbstractProcessingHandler ...@@ -84,7 +86,7 @@ class NewRelicHandler extends AbstractProcessingHandler
unset($record['formatted']['context']['transaction_name']); unset($record['formatted']['context']['transaction_name']);
} }
if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) { if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) {
newrelic_notice_error($record['message'], $record['context']['exception']); newrelic_notice_error($record['message'], $record['context']['exception']);
unset($record['formatted']['context']['exception']); unset($record['formatted']['context']['exception']);
} else { } else {
......
...@@ -31,7 +31,7 @@ class PsrHandler extends AbstractHandler ...@@ -31,7 +31,7 @@ class PsrHandler extends AbstractHandler
/** /**
* @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true) public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true)
{ {
......
...@@ -69,8 +69,8 @@ class PushoverHandler extends SocketHandler ...@@ -69,8 +69,8 @@ class PushoverHandler extends SocketHandler
* @param string|array $users Pushover user id or array of ids the message will be sent to * @param string|array $users Pushover user id or array of ids the message will be sent to
* @param string $title Title sent to the Pushover API * @param string $title Title sent to the Pushover API
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param Boolean $useSSL Whether to connect via SSL. Required when pushing messages to users that are not * @param bool $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
* the pushover.net app owner. OpenSSL is required for this option. * the pushover.net app owner. OpenSSL is required for this option.
* @param int $highPriorityLevel The minimum logging level at which this handler will start * @param int $highPriorityLevel The minimum logging level at which this handler will start
* sending "high priority" requests to the Pushover API * sending "high priority" requests to the Pushover API
...@@ -180,6 +180,6 @@ class PushoverHandler extends SocketHandler ...@@ -180,6 +180,6 @@ class PushoverHandler extends SocketHandler
*/ */
public function useFormattedMessage($value) public function useFormattedMessage($value)
{ {
$this->useFormattedMessage = (boolean) $value; $this->useFormattedMessage = (bool) $value;
} }
} }
...@@ -18,7 +18,7 @@ use Raven_Client; ...@@ -18,7 +18,7 @@ use Raven_Client;
/** /**
* Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server * Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server
* using raven-php (https://github.com/getsentry/raven-php) * using sentry-php (https://github.com/getsentry/sentry-php)
* *
* @author Marc Abramowitz <marc@marc-abramowitz.com> * @author Marc Abramowitz <marc@marc-abramowitz.com>
*/ */
...@@ -27,7 +27,7 @@ class RavenHandler extends AbstractProcessingHandler ...@@ -27,7 +27,7 @@ class RavenHandler extends AbstractProcessingHandler
/** /**
* Translates Monolog log levels to Raven log levels. * Translates Monolog log levels to Raven log levels.
*/ */
private $logLevels = array( protected $logLevels = array(
Logger::DEBUG => Raven_Client::DEBUG, Logger::DEBUG => Raven_Client::DEBUG,
Logger::INFO => Raven_Client::INFO, Logger::INFO => Raven_Client::INFO,
Logger::NOTICE => Raven_Client::INFO, Logger::NOTICE => Raven_Client::INFO,
...@@ -42,7 +42,7 @@ class RavenHandler extends AbstractProcessingHandler ...@@ -42,7 +42,7 @@ class RavenHandler extends AbstractProcessingHandler
* @var string should represent the current version of the calling * @var string should represent the current version of the calling
* software. Can be any string (git commit, version number) * software. Can be any string (git commit, version number)
*/ */
private $release; protected $release;
/** /**
* @var Raven_Client the client object that sends the message to the server * @var Raven_Client the client object that sends the message to the server
...@@ -57,7 +57,7 @@ class RavenHandler extends AbstractProcessingHandler ...@@ -57,7 +57,7 @@ class RavenHandler extends AbstractProcessingHandler
/** /**
* @param Raven_Client $ravenClient * @param Raven_Client $ravenClient
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true) public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true)
{ {
...@@ -180,7 +180,7 @@ class RavenHandler extends AbstractProcessingHandler ...@@ -180,7 +180,7 @@ class RavenHandler extends AbstractProcessingHandler
} }
if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) { if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) {
$options['extra']['message'] = $record['formatted']; $options['message'] = $record['formatted'];
$this->ravenClient->captureException($record['context']['exception'], $options); $this->ravenClient->captureException($record['context']['exception'], $options);
} else { } else {
$this->ravenClient->captureMessage($record['formatted'], array(), $options); $this->ravenClient->captureMessage($record['formatted'], array(), $options);
...@@ -216,7 +216,7 @@ class RavenHandler extends AbstractProcessingHandler ...@@ -216,7 +216,7 @@ class RavenHandler extends AbstractProcessingHandler
*/ */
protected function getExtraParameters() protected function getExtraParameters()
{ {
return array('checksum', 'release', 'event_id'); return array('contexts', 'checksum', 'release', 'event_id');
} }
/** /**
......
...@@ -129,4 +129,16 @@ class RollbarHandler extends AbstractProcessingHandler ...@@ -129,4 +129,16 @@ class RollbarHandler extends AbstractProcessingHandler
{ {
$this->flush(); $this->flush();
} }
/**
* {@inheritdoc}
*/
public function reset()
{
$this->flush();
parent::reset();
}
} }
...@@ -39,9 +39,9 @@ class RotatingFileHandler extends StreamHandler ...@@ -39,9 +39,9 @@ class RotatingFileHandler extends StreamHandler
* @param string $filename * @param string $filename
* @param int $maxFiles The maximal amount of files to keep (0 means unlimited) * @param int $maxFiles The maximal amount of files to keep (0 means unlimited)
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
* @param Boolean $useLocking Try to lock log file before doing any writes * @param bool $useLocking Try to lock log file before doing any writes
*/ */
public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
{ {
...@@ -66,6 +66,18 @@ class RotatingFileHandler extends StreamHandler ...@@ -66,6 +66,18 @@ class RotatingFileHandler extends StreamHandler
} }
} }
/**
* {@inheritdoc}
*/
public function reset()
{
parent::reset();
if (true === $this->mustRotate) {
$this->rotate();
}
}
public function setFilenameFormat($filenameFormat, $dateFormat) public function setFilenameFormat($filenameFormat, $dateFormat)
{ {
if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) { if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) {
...@@ -166,7 +178,7 @@ class RotatingFileHandler extends StreamHandler ...@@ -166,7 +178,7 @@ class RotatingFileHandler extends StreamHandler
$fileInfo = pathinfo($this->filename); $fileInfo = pathinfo($this->filename);
$glob = str_replace( $glob = str_replace(
array('{filename}', '{date}'), array('{filename}', '{date}'),
array($fileInfo['filename'], '*'), array($fileInfo['filename'], '[0-9][0-9][0-9][0-9]*'),
$fileInfo['dirname'] . '/' . $this->filenameFormat $fileInfo['dirname'] . '/' . $this->filenameFormat
); );
if (!empty($fileInfo['extension'])) { if (!empty($fileInfo['extension'])) {
......
...@@ -146,7 +146,7 @@ class SlackRecord ...@@ -146,7 +146,7 @@ class SlackRecord
if ($this->useShortAttachment) { if ($this->useShortAttachment) {
$attachment['fields'][] = $this->generateAttachmentField( $attachment['fields'][] = $this->generateAttachmentField(
ucfirst($key), $key,
$record[$key] $record[$key]
); );
} else { } else {
...@@ -229,8 +229,8 @@ class SlackRecord ...@@ -229,8 +229,8 @@ class SlackRecord
/** /**
* Generates attachment field * Generates attachment field
* *
* @param string $title * @param string $title
* @param string|array $value\ * @param string|array $value
* *
* @return array * @return array
*/ */
...@@ -241,7 +241,7 @@ class SlackRecord ...@@ -241,7 +241,7 @@ class SlackRecord
: $value; : $value;
return array( return array(
'title' => $title, 'title' => ucfirst($title),
'value' => $value, 'value' => $value,
'short' => false 'short' => false
); );
...@@ -257,7 +257,7 @@ class SlackRecord ...@@ -257,7 +257,7 @@ class SlackRecord
private function generateAttachmentFields(array $data) private function generateAttachmentFields(array $data)
{ {
$fields = array(); $fields = array();
foreach ($data as $key => $value) { foreach ($this->normalizerFormatter->format($data) as $key => $value) {
$fields[] = $this->generateAttachmentField($key, $value); $fields[] = $this->generateAttachmentField($key, $value);
} }
......
...@@ -75,6 +75,11 @@ class SlackHandler extends SocketHandler ...@@ -75,6 +75,11 @@ class SlackHandler extends SocketHandler
return $this->slackRecord; return $this->slackRecord;
} }
public function getToken()
{
return $this->token;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
......
...@@ -70,6 +70,11 @@ class SlackWebhookHandler extends AbstractProcessingHandler ...@@ -70,6 +70,11 @@ class SlackWebhookHandler extends AbstractProcessingHandler
return $this->slackRecord; return $this->slackRecord;
} }
public function getWebhookUrl()
{
return $this->webhookUrl;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
* *
......
...@@ -27,15 +27,16 @@ class SocketHandler extends AbstractProcessingHandler ...@@ -27,15 +27,16 @@ class SocketHandler extends AbstractProcessingHandler
private $timeout = 0; private $timeout = 0;
private $writingTimeout = 10; private $writingTimeout = 10;
private $lastSentBytes = null; private $lastSentBytes = null;
private $chunkSize = null;
private $persistent = false; private $persistent = false;
private $errno; private $errno;
private $errstr; private $errstr;
private $lastWritingAt; private $lastWritingAt;
/** /**
* @param string $connectionString Socket connection string * @param string $connectionString Socket connection string
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true) public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true)
{ {
...@@ -87,7 +88,7 @@ class SocketHandler extends AbstractProcessingHandler ...@@ -87,7 +88,7 @@ class SocketHandler extends AbstractProcessingHandler
*/ */
public function setPersistent($persistent) public function setPersistent($persistent)
{ {
$this->persistent = (boolean) $persistent; $this->persistent = (bool) $persistent;
} }
/** /**
...@@ -128,6 +129,16 @@ class SocketHandler extends AbstractProcessingHandler ...@@ -128,6 +129,16 @@ class SocketHandler extends AbstractProcessingHandler
} }
/** /**
* Set chunk size. Only has effect during connection in the writing cycle.
*
* @param float $bytes
*/
public function setChunkSize($bytes)
{
$this->chunkSize = $bytes;
}
/**
* Get current connection string * Get current connection string
* *
* @return string * @return string
...@@ -178,6 +189,16 @@ class SocketHandler extends AbstractProcessingHandler ...@@ -178,6 +189,16 @@ class SocketHandler extends AbstractProcessingHandler
} }
/** /**
* Get current chunk size
*
* @return float
*/
public function getChunkSize()
{
return $this->chunkSize;
}
/**
* Check to see if the socket is currently available. * Check to see if the socket is currently available.
* *
* UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details. * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.
...@@ -221,6 +242,16 @@ class SocketHandler extends AbstractProcessingHandler ...@@ -221,6 +242,16 @@ class SocketHandler extends AbstractProcessingHandler
/** /**
* Wrapper to allow mocking * Wrapper to allow mocking
*
* @see http://php.net/manual/en/function.stream-set-chunk-size.php
*/
protected function streamSetChunkSize()
{
return stream_set_chunk_size($this->resource, $this->chunkSize);
}
/**
* Wrapper to allow mocking
*/ */
protected function fwrite($data) protected function fwrite($data)
{ {
...@@ -268,6 +299,7 @@ class SocketHandler extends AbstractProcessingHandler ...@@ -268,6 +299,7 @@ class SocketHandler extends AbstractProcessingHandler
{ {
$this->createSocketResource(); $this->createSocketResource();
$this->setSocketTimeout(); $this->setSocketTimeout();
$this->setStreamChunkSize();
} }
private function createSocketResource() private function createSocketResource()
...@@ -290,6 +322,13 @@ class SocketHandler extends AbstractProcessingHandler ...@@ -290,6 +322,13 @@ class SocketHandler extends AbstractProcessingHandler
} }
} }
private function setStreamChunkSize()
{
if ($this->chunkSize && !$this->streamSetChunkSize()) {
throw new \UnexpectedValueException("Failed setting chunk size with stream_set_chunk_size()");
}
}
private function writeToSocket($data) private function writeToSocket($data)
{ {
$length = strlen($data); $length = strlen($data);
......
...@@ -32,9 +32,9 @@ class StreamHandler extends AbstractProcessingHandler ...@@ -32,9 +32,9 @@ class StreamHandler extends AbstractProcessingHandler
/** /**
* @param resource|string $stream * @param resource|string $stream
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
* @param Boolean $useLocking Try to lock log file before doing any writes * @param bool $useLocking Try to lock log file before doing any writes
* *
* @throws \Exception If a missing directory is not buildable * @throws \Exception If a missing directory is not buildable
* @throws \InvalidArgumentException If stream is not a resource or string * @throws \InvalidArgumentException If stream is not a resource or string
...@@ -167,7 +167,7 @@ class StreamHandler extends AbstractProcessingHandler ...@@ -167,7 +167,7 @@ class StreamHandler extends AbstractProcessingHandler
set_error_handler(array($this, 'customErrorHandler')); set_error_handler(array($this, 'customErrorHandler'));
$status = mkdir($dir, 0777, true); $status = mkdir($dir, 0777, true);
restore_error_handler(); restore_error_handler();
if (false === $status) { if (false === $status && !is_dir($dir)) {
throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir)); throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir));
} }
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
namespace Monolog\Handler; namespace Monolog\Handler;
use Monolog\Logger; use Monolog\Logger;
use Monolog\Formatter\FormatterInterface;
use Monolog\Formatter\LineFormatter; use Monolog\Formatter\LineFormatter;
use Swift; use Swift;
...@@ -29,7 +30,7 @@ class SwiftMailerHandler extends MailHandler ...@@ -29,7 +30,7 @@ class SwiftMailerHandler extends MailHandler
* @param \Swift_Mailer $mailer The mailer to use * @param \Swift_Mailer $mailer The mailer to use
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*/ */
public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true) public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true)
{ {
...@@ -48,6 +49,17 @@ class SwiftMailerHandler extends MailHandler ...@@ -48,6 +49,17 @@ class SwiftMailerHandler extends MailHandler
} }
/** /**
* Gets the formatter for the Swift_Message subject.
*
* @param string $format The format of the subject
* @return FormatterInterface
*/
protected function getSubjectFormatter($format)
{
return new LineFormatter($format);
}
/**
* Creates instance of Swift_Message to be sent * Creates instance of Swift_Message to be sent
* *
* @param string $content formatted email body to be sent * @param string $content formatted email body to be sent
...@@ -69,7 +81,7 @@ class SwiftMailerHandler extends MailHandler ...@@ -69,7 +81,7 @@ class SwiftMailerHandler extends MailHandler
} }
if ($records) { if ($records) {
$subjectFormatter = new LineFormatter($message->getSubject()); $subjectFormatter = $this->getSubjectFormatter($message->getSubject());
$message->setSubject($subjectFormatter->format($this->getHighestRecord($records))); $message->setSubject($subjectFormatter->format($this->getHighestRecord($records)));
} }
......
...@@ -32,11 +32,11 @@ class SyslogHandler extends AbstractSyslogHandler ...@@ -32,11 +32,11 @@ class SyslogHandler extends AbstractSyslogHandler
protected $logopts; protected $logopts;
/** /**
* @param string $ident * @param string $ident
* @param mixed $facility * @param mixed $facility
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param int $logopts Option flags for the openlog() call, defaults to LOG_PID * @param int $logopts Option flags for the openlog() call, defaults to LOG_PID
*/ */
public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID) public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID)
{ {
......
...@@ -25,12 +25,12 @@ class SyslogUdpHandler extends AbstractSyslogHandler ...@@ -25,12 +25,12 @@ class SyslogUdpHandler extends AbstractSyslogHandler
protected $ident; protected $ident;
/** /**
* @param string $host * @param string $host
* @param int $port * @param int $port
* @param mixed $facility * @param mixed $facility
* @param int $level The minimum logging level at which this handler will be triggered * @param int $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
* @param string $ident Program name or tag for each log message. * @param string $ident Program name or tag for each log message.
*/ */
public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $ident = 'php') public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $ident = 'php')
{ {
......
...@@ -84,14 +84,24 @@ class TestHandler extends AbstractProcessingHandler ...@@ -84,14 +84,24 @@ class TestHandler extends AbstractProcessingHandler
return isset($this->recordsByLevel[$level]); return isset($this->recordsByLevel[$level]);
} }
/**
* @param string|array $record Either a message string or an array containing message and optionally context keys that will be checked against all records
* @param int $level Logger::LEVEL constant value
*/
public function hasRecord($record, $level) public function hasRecord($record, $level)
{ {
if (is_array($record)) { if (is_string($record)) {
$record = $record['message']; $record = array('message' => $record);
} }
return $this->hasRecordThatPasses(function ($rec) use ($record) { return $this->hasRecordThatPasses(function ($rec) use ($record) {
return $rec['message'] === $record; if ($rec['message'] !== $record['message']) {
return false;
}
if (isset($record['context']) && $rec['context'] !== $record['context']) {
return false;
}
return true;
}, $level); }, $level);
} }
......
...@@ -48,6 +48,16 @@ class WhatFailureGroupHandler extends GroupHandler ...@@ -48,6 +48,16 @@ class WhatFailureGroupHandler extends GroupHandler
*/ */
public function handleBatch(array $records) public function handleBatch(array $records)
{ {
if ($this->processors) {
$processed = array();
foreach ($records as $record) {
foreach ($this->processors as $processor) {
$processed[] = call_user_func($processor, $record);
}
}
$records = $processed;
}
foreach ($this->handlers as $handler) { foreach ($this->handlers as $handler) {
try { try {
$handler->handleBatch($records); $handler->handleBatch($records);
......
...@@ -15,6 +15,7 @@ use Monolog\Handler\HandlerInterface; ...@@ -15,6 +15,7 @@ use Monolog\Handler\HandlerInterface;
use Monolog\Handler\StreamHandler; use Monolog\Handler\StreamHandler;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Psr\Log\InvalidArgumentException; use Psr\Log\InvalidArgumentException;
use Exception;
/** /**
* Monolog log channel * Monolog log channel
...@@ -24,7 +25,7 @@ use Psr\Log\InvalidArgumentException; ...@@ -24,7 +25,7 @@ use Psr\Log\InvalidArgumentException;
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class Logger implements LoggerInterface class Logger implements LoggerInterface, ResettableInterface
{ {
/** /**
* Detailed debug information * Detailed debug information
...@@ -134,6 +135,11 @@ class Logger implements LoggerInterface ...@@ -134,6 +135,11 @@ class Logger implements LoggerInterface
protected $microsecondTimestamps = true; protected $microsecondTimestamps = true;
/** /**
* @var callable
*/
protected $exceptionHandler;
/**
* @param string $name The logging channel * @param string $name The logging channel
* @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc. * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc.
* @param callable[] $processors Optional array of processors * @param callable[] $processors Optional array of processors
...@@ -141,7 +147,7 @@ class Logger implements LoggerInterface ...@@ -141,7 +147,7 @@ class Logger implements LoggerInterface
public function __construct($name, array $handlers = array(), array $processors = array()) public function __construct($name, array $handlers = array(), array $processors = array())
{ {
$this->name = $name; $this->name = $name;
$this->handlers = $handlers; $this->setHandlers($handlers);
$this->processors = $processors; $this->processors = $processors;
} }
...@@ -281,7 +287,7 @@ class Logger implements LoggerInterface ...@@ -281,7 +287,7 @@ class Logger implements LoggerInterface
* @param int $level The logging level * @param int $level The logging level
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addRecord($level, $message, array $context = array()) public function addRecord($level, $message, array $context = array())
{ {
...@@ -329,27 +335,75 @@ class Logger implements LoggerInterface ...@@ -329,27 +335,75 @@ class Logger implements LoggerInterface
'extra' => array(), 'extra' => array(),
); );
foreach ($this->processors as $processor) { try {
$record = call_user_func($processor, $record); foreach ($this->processors as $processor) {
$record = call_user_func($processor, $record);
}
while ($handler = current($this->handlers)) {
if (true === $handler->handle($record)) {
break;
}
next($this->handlers);
}
} catch (Exception $e) {
$this->handleException($e, $record);
} }
while ($handler = current($this->handlers)) { return true;
if (true === $handler->handle($record)) { }
break;
/**
* Ends a log cycle and frees all resources used by handlers.
*
* Closing a Handler means flushing all buffers and freeing any open resources/handles.
* Handlers that have been closed should be able to accept log records again and re-open
* themselves on demand, but this may not always be possible depending on implementation.
*
* This is useful at the end of a request and will be called automatically on every handler
* when they get destructed.
*/
public function close()
{
foreach ($this->handlers as $handler) {
if (method_exists($handler, 'close')) {
$handler->close();
} }
}
}
next($this->handlers); /**
* Ends a log cycle and resets all handlers and processors to their initial state.
*
* Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal
* state, and getting it back to a state in which it can receive log records again.
*
* This is useful in case you want to avoid logs leaking between two requests or jobs when you
* have a long running process like a worker or an application server serving multiple requests
* in one process.
*/
public function reset()
{
foreach ($this->handlers as $handler) {
if ($handler instanceof ResettableInterface) {
$handler->reset();
}
} }
return true; foreach ($this->processors as $processor) {
if ($processor instanceof ResettableInterface) {
$processor->reset();
}
}
} }
/** /**
* Adds a log record at the DEBUG level. * Adds a log record at the DEBUG level.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addDebug($message, array $context = array()) public function addDebug($message, array $context = array())
{ {
...@@ -359,9 +413,9 @@ class Logger implements LoggerInterface ...@@ -359,9 +413,9 @@ class Logger implements LoggerInterface
/** /**
* Adds a log record at the INFO level. * Adds a log record at the INFO level.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addInfo($message, array $context = array()) public function addInfo($message, array $context = array())
{ {
...@@ -371,9 +425,9 @@ class Logger implements LoggerInterface ...@@ -371,9 +425,9 @@ class Logger implements LoggerInterface
/** /**
* Adds a log record at the NOTICE level. * Adds a log record at the NOTICE level.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addNotice($message, array $context = array()) public function addNotice($message, array $context = array())
{ {
...@@ -383,9 +437,9 @@ class Logger implements LoggerInterface ...@@ -383,9 +437,9 @@ class Logger implements LoggerInterface
/** /**
* Adds a log record at the WARNING level. * Adds a log record at the WARNING level.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addWarning($message, array $context = array()) public function addWarning($message, array $context = array())
{ {
...@@ -395,9 +449,9 @@ class Logger implements LoggerInterface ...@@ -395,9 +449,9 @@ class Logger implements LoggerInterface
/** /**
* Adds a log record at the ERROR level. * Adds a log record at the ERROR level.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addError($message, array $context = array()) public function addError($message, array $context = array())
{ {
...@@ -407,9 +461,9 @@ class Logger implements LoggerInterface ...@@ -407,9 +461,9 @@ class Logger implements LoggerInterface
/** /**
* Adds a log record at the CRITICAL level. * Adds a log record at the CRITICAL level.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addCritical($message, array $context = array()) public function addCritical($message, array $context = array())
{ {
...@@ -419,9 +473,9 @@ class Logger implements LoggerInterface ...@@ -419,9 +473,9 @@ class Logger implements LoggerInterface
/** /**
* Adds a log record at the ALERT level. * Adds a log record at the ALERT level.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addAlert($message, array $context = array()) public function addAlert($message, array $context = array())
{ {
...@@ -431,9 +485,9 @@ class Logger implements LoggerInterface ...@@ -431,9 +485,9 @@ class Logger implements LoggerInterface
/** /**
* Adds a log record at the EMERGENCY level. * Adds a log record at the EMERGENCY level.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function addEmergency($message, array $context = array()) public function addEmergency($message, array $context = array())
{ {
...@@ -484,7 +538,7 @@ class Logger implements LoggerInterface ...@@ -484,7 +538,7 @@ class Logger implements LoggerInterface
* Checks whether the Logger has a handler that listens on the given level * Checks whether the Logger has a handler that listens on the given level
* *
* @param int $level * @param int $level
* @return Boolean * @return bool
*/ */
public function isHandling($level) public function isHandling($level)
{ {
...@@ -502,14 +556,51 @@ class Logger implements LoggerInterface ...@@ -502,14 +556,51 @@ class Logger implements LoggerInterface
} }
/** /**
* Set a custom exception handler
*
* @param callable $callback
* @return $this
*/
public function setExceptionHandler($callback)
{
if (!is_callable($callback)) {
throw new \InvalidArgumentException('Exception handler must be valid callable (callback or object with an __invoke method), '.var_export($callback, true).' given');
}
$this->exceptionHandler = $callback;
return $this;
}
/**
* @return callable
*/
public function getExceptionHandler()
{
return $this->exceptionHandler;
}
/**
* Delegates exception management to the custom exception handler,
* or throws the exception if no custom handler is set.
*/
protected function handleException(Exception $e, array $record)
{
if (!$this->exceptionHandler) {
throw $e;
}
call_user_func($this->exceptionHandler, $e, $record);
}
/**
* Adds a log record at an arbitrary level. * Adds a log record at an arbitrary level.
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param mixed $level The log level * @param mixed $level The log level
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function log($level, $message, array $context = array()) public function log($level, $message, array $context = array())
{ {
...@@ -523,9 +614,9 @@ class Logger implements LoggerInterface ...@@ -523,9 +614,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function debug($message, array $context = array()) public function debug($message, array $context = array())
{ {
...@@ -537,9 +628,9 @@ class Logger implements LoggerInterface ...@@ -537,9 +628,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function info($message, array $context = array()) public function info($message, array $context = array())
{ {
...@@ -551,9 +642,9 @@ class Logger implements LoggerInterface ...@@ -551,9 +642,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function notice($message, array $context = array()) public function notice($message, array $context = array())
{ {
...@@ -565,9 +656,9 @@ class Logger implements LoggerInterface ...@@ -565,9 +656,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function warn($message, array $context = array()) public function warn($message, array $context = array())
{ {
...@@ -579,9 +670,9 @@ class Logger implements LoggerInterface ...@@ -579,9 +670,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function warning($message, array $context = array()) public function warning($message, array $context = array())
{ {
...@@ -593,9 +684,9 @@ class Logger implements LoggerInterface ...@@ -593,9 +684,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function err($message, array $context = array()) public function err($message, array $context = array())
{ {
...@@ -607,9 +698,9 @@ class Logger implements LoggerInterface ...@@ -607,9 +698,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function error($message, array $context = array()) public function error($message, array $context = array())
{ {
...@@ -621,9 +712,9 @@ class Logger implements LoggerInterface ...@@ -621,9 +712,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function crit($message, array $context = array()) public function crit($message, array $context = array())
{ {
...@@ -635,9 +726,9 @@ class Logger implements LoggerInterface ...@@ -635,9 +726,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function critical($message, array $context = array()) public function critical($message, array $context = array())
{ {
...@@ -649,9 +740,9 @@ class Logger implements LoggerInterface ...@@ -649,9 +740,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function alert($message, array $context = array()) public function alert($message, array $context = array())
{ {
...@@ -663,9 +754,9 @@ class Logger implements LoggerInterface ...@@ -663,9 +754,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function emerg($message, array $context = array()) public function emerg($message, array $context = array())
{ {
...@@ -677,9 +768,9 @@ class Logger implements LoggerInterface ...@@ -677,9 +768,9 @@ class Logger implements LoggerInterface
* *
* This method allows for compatibility with common interfaces. * This method allows for compatibility with common interfaces.
* *
* @param string $message The log message * @param string $message The log message
* @param array $context The log context * @param array $context The log context
* @return Boolean Whether the record has been processed * @return bool Whether the record has been processed
*/ */
public function emergency($message, array $context = array()) public function emergency($message, array $context = array())
{ {
......
...@@ -19,7 +19,7 @@ use Monolog\Logger; ...@@ -19,7 +19,7 @@ use Monolog\Logger;
* @author Nick Otter * @author Nick Otter
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class GitProcessor class GitProcessor implements ProcessorInterface
{ {
private $level; private $level;
private static $cache; private static $cache;
......
...@@ -24,7 +24,7 @@ use Monolog\Logger; ...@@ -24,7 +24,7 @@ use Monolog\Logger;
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class IntrospectionProcessor class IntrospectionProcessor implements ProcessorInterface
{ {
private $level; private $level;
......
...@@ -16,7 +16,7 @@ namespace Monolog\Processor; ...@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Rob Jensen * @author Rob Jensen
*/ */
abstract class MemoryProcessor abstract class MemoryProcessor implements ProcessorInterface
{ {
/** /**
* @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported. * @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
...@@ -34,8 +34,8 @@ abstract class MemoryProcessor ...@@ -34,8 +34,8 @@ abstract class MemoryProcessor
*/ */
public function __construct($realUsage = true, $useFormatting = true) public function __construct($realUsage = true, $useFormatting = true)
{ {
$this->realUsage = (boolean) $realUsage; $this->realUsage = (bool) $realUsage;
$this->useFormatting = (boolean) $useFormatting; $this->useFormatting = (bool) $useFormatting;
} }
/** /**
......
...@@ -18,7 +18,7 @@ use Monolog\Logger; ...@@ -18,7 +18,7 @@ use Monolog\Logger;
* *
* @author Jonathan A. Schweder <jonathanschweder@gmail.com> * @author Jonathan A. Schweder <jonathanschweder@gmail.com>
*/ */
class MercurialProcessor class MercurialProcessor implements ProcessorInterface
{ {
private $level; private $level;
private static $cache; private static $cache;
......
...@@ -16,7 +16,7 @@ namespace Monolog\Processor; ...@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Andreas Hörnicke * @author Andreas Hörnicke
*/ */
class ProcessIdProcessor class ProcessIdProcessor implements ProcessorInterface
{ {
/** /**
* @param array $record * @param array $record
......
<?php
/*
* 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\Processor;
/**
* An optional interface to allow labelling Monolog processors.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
interface ProcessorInterface
{
/**
* @return array The processed records
*/
public function __invoke(array $records);
}
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
namespace Monolog\Processor; namespace Monolog\Processor;
use Monolog\Utils;
/** /**
* Processes a record's message according to PSR-3 rules * Processes a record's message according to PSR-3 rules
* *
...@@ -18,7 +20,7 @@ namespace Monolog\Processor; ...@@ -18,7 +20,7 @@ namespace Monolog\Processor;
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class PsrLogMessageProcessor class PsrLogMessageProcessor implements ProcessorInterface
{ {
/** /**
* @param array $record * @param array $record
...@@ -35,7 +37,7 @@ class PsrLogMessageProcessor ...@@ -35,7 +37,7 @@ class PsrLogMessageProcessor
if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
$replacements['{'.$key.'}'] = $val; $replacements['{'.$key.'}'] = $val;
} elseif (is_object($val)) { } elseif (is_object($val)) {
$replacements['{'.$key.'}'] = '[object '.get_class($val).']'; $replacements['{'.$key.'}'] = '[object '.Utils::getClass($val).']';
} else { } else {
$replacements['{'.$key.'}'] = '['.gettype($val).']'; $replacements['{'.$key.'}'] = '['.gettype($val).']';
} }
......
...@@ -16,7 +16,7 @@ namespace Monolog\Processor; ...@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Martijn Riemers * @author Martijn Riemers
*/ */
class TagProcessor class TagProcessor implements ProcessorInterface
{ {
private $tags; private $tags;
......
...@@ -11,12 +11,14 @@ ...@@ -11,12 +11,14 @@
namespace Monolog\Processor; namespace Monolog\Processor;
use Monolog\ResettableInterface;
/** /**
* Adds a unique identifier into records * Adds a unique identifier into records
* *
* @author Simon Mönch <sm@webfactory.de> * @author Simon Mönch <sm@webfactory.de>
*/ */
class UidProcessor class UidProcessor implements ProcessorInterface, ResettableInterface
{ {
private $uid; private $uid;
...@@ -26,7 +28,8 @@ class UidProcessor ...@@ -26,7 +28,8 @@ class UidProcessor
throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32'); throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
} }
$this->uid = substr(hash('md5', uniqid('', true)), 0, $length);
$this->uid = $this->generateUid($length);
} }
public function __invoke(array $record) public function __invoke(array $record)
...@@ -43,4 +46,14 @@ class UidProcessor ...@@ -43,4 +46,14 @@ class UidProcessor
{ {
return $this->uid; return $this->uid;
} }
public function reset()
{
$this->uid = $this->generateUid(strlen($this->uid));
}
private function generateUid($length)
{
return substr(hash('md5', uniqid('', true)), 0, $length);
}
} }
...@@ -16,7 +16,7 @@ namespace Monolog\Processor; ...@@ -16,7 +16,7 @@ namespace Monolog\Processor;
* *
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
*/ */
class WebProcessor class WebProcessor implements ProcessorInterface
{ {
/** /**
* @var array|\ArrayAccess * @var array|\ArrayAccess
......
<?php
/*
* 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 or Processor implementing this interface will be reset when Logger::reset() is called.
*
* Resetting ends a log cycle gets them back to their initial state.
*
* Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal
* state, and getting it back to a state in which it can receive log records again.
*
* This is useful in case you want to avoid logs leaking between two requests or jobs when you
* have a long running process like a worker or an application server serving multiple requests
* in one process.
*
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
interface ResettableInterface
{
public function reset();
}
<?php
/*
* 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 Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use ReflectionExtension;
/**
* Monolog POSIX signal handler
*
* @author Robert Gust-Bardon <robert@gust-bardon.org>
*/
class SignalHandler
{
private $logger;
private $previousSignalHandler = array();
private $signalLevelMap = array();
private $signalRestartSyscalls = array();
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
}
public function registerSignalHandler($signo, $level = LogLevel::CRITICAL, $callPrevious = true, $restartSyscalls = true, $async = true)
{
if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) {
return $this;
}
if ($callPrevious) {
if (function_exists('pcntl_signal_get_handler')) {
$handler = pcntl_signal_get_handler($signo);
if ($handler === false) {
return $this;
}
$this->previousSignalHandler[$signo] = $handler;
} else {
$this->previousSignalHandler[$signo] = true;
}
} else {
unset($this->previousSignalHandler[$signo]);
}
$this->signalLevelMap[$signo] = $level;
$this->signalRestartSyscalls[$signo] = $restartSyscalls;
if (function_exists('pcntl_async_signals') && $async !== null) {
pcntl_async_signals($async);
}
pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls);
return $this;
}
public function handleSignal($signo, array $siginfo = null)
{
static $signals = array();
if (!$signals && extension_loaded('pcntl')) {
$pcntl = new ReflectionExtension('pcntl');
$constants = $pcntl->getConstants();
if (!$constants) {
// HHVM 3.24.2 returns an empty array.
$constants = get_defined_constants(true);
$constants = $constants['Core'];
}
foreach ($constants as $name => $value) {
if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) {
$signals[$value] = $name;
}
}
unset($constants);
}
$level = isset($this->signalLevelMap[$signo]) ? $this->signalLevelMap[$signo] : LogLevel::CRITICAL;
$signal = isset($signals[$signo]) ? $signals[$signo] : $signo;
$context = isset($siginfo) ? $siginfo : array();
$this->logger->log($level, sprintf('Program received signal %s', $signal), $context);
if (!isset($this->previousSignalHandler[$signo])) {
return;
}
if ($this->previousSignalHandler[$signo] === true || $this->previousSignalHandler[$signo] === SIG_DFL) {
if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch')
&& extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill')) {
$restartSyscalls = isset($this->restartSyscalls[$signo]) ? $this->restartSyscalls[$signo] : true;
pcntl_signal($signo, SIG_DFL, $restartSyscalls);
pcntl_sigprocmask(SIG_UNBLOCK, array($signo), $oldset);
posix_kill(posix_getpid(), $signo);
pcntl_signal_dispatch();
pcntl_sigprocmask(SIG_SETMASK, $oldset);
pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls);
}
} elseif (is_callable($this->previousSignalHandler[$signo])) {
if (PHP_VERSION_ID >= 70100) {
$this->previousSignalHandler[$signo]($signo, $siginfo);
} else {
$this->previousSignalHandler[$signo]($signo);
}
}
}
}
<?php
/*
* 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;
class Utils
{
/**
* @internal
*/
public static function getClass($object)
{
$class = \get_class($object);
return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
}
}
...@@ -40,7 +40,7 @@ class FluentdFormatterTest extends TestCase ...@@ -40,7 +40,7 @@ class FluentdFormatterTest extends TestCase
$formatter = new FluentdFormatter(); $formatter = new FluentdFormatter();
$this->assertEquals( $this->assertEquals(
'["test",0,{"message":"test","extra":[],"level":300,"level_name":"WARNING"}]', '["test",0,{"message":"test","context":[],"extra":[],"level":300,"level_name":"WARNING"}]',
$formatter->format($record) $formatter->format($record)
); );
} }
...@@ -55,7 +55,7 @@ class FluentdFormatterTest extends TestCase ...@@ -55,7 +55,7 @@ class FluentdFormatterTest extends TestCase
$formatter = new FluentdFormatter(true); $formatter = new FluentdFormatter(true);
$this->assertEquals( $this->assertEquals(
'["test.error",0,{"message":"test","extra":[]}]', '["test.error",0,{"message":"test","context":[],"extra":[]}]',
$formatter->format($record) $formatter->format($record)
); );
} }
......
...@@ -180,4 +180,40 @@ class JsonFormatterTest extends TestCase ...@@ -180,4 +180,40 @@ class JsonFormatterTest extends TestCase
'}'; '}';
return $formattedException; return $formattedException;
} }
public function testNormalizeHandleLargeArraysWithExactly1000Items()
{
$formatter = new NormalizerFormatter();
$largeArray = range(1, 1000);
$res = $formatter->format(array(
'level_name' => 'CRITICAL',
'channel' => 'test',
'message' => 'bar',
'context' => array($largeArray),
'datetime' => new \DateTime,
'extra' => array(),
));
$this->assertCount(1000, $res['context'][0]);
$this->assertArrayNotHasKey('...', $res['context'][0]);
}
public function testNormalizeHandleLargeArrays()
{
$formatter = new NormalizerFormatter();
$largeArray = range(1, 2000);
$res = $formatter->format(array(
'level_name' => 'CRITICAL',
'channel' => 'test',
'message' => 'bar',
'context' => array($largeArray),
'datetime' => new \DateTime,
'extra' => array(),
));
$this->assertCount(1001, $res['context'][0]);
$this->assertEquals('Over 1000 items (2000 total), aborting normalization', $res['context'][0]['...']);
}
} }
...@@ -193,6 +193,15 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase ...@@ -193,6 +193,15 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(@json_encode(array($foo, $bar)), $res); $this->assertEquals(@json_encode(array($foo, $bar)), $res);
} }
public function testCanNormalizeReferences()
{
$formatter = new NormalizerFormatter();
$x = array('foo' => 'bar');
$y = array('x' => &$x);
$x['y'] = &$y;
$formatter->format($y);
}
public function testIgnoresInvalidTypes() public function testIgnoresInvalidTypes()
{ {
// set up the recursion // set up the recursion
...@@ -217,6 +226,24 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase ...@@ -217,6 +226,24 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(@json_encode(array($resource)), $res); $this->assertEquals(@json_encode(array($resource)), $res);
} }
public function testNormalizeHandleLargeArraysWithExactly1000Items()
{
$formatter = new NormalizerFormatter();
$largeArray = range(1, 1000);
$res = $formatter->format(array(
'level_name' => 'CRITICAL',
'channel' => 'test',
'message' => 'bar',
'context' => array($largeArray),
'datetime' => new \DateTime,
'extra' => array(),
));
$this->assertCount(1000, $res['context'][0]);
$this->assertArrayNotHasKey('...', $res['context'][0]);
}
public function testNormalizeHandleLargeArrays() public function testNormalizeHandleLargeArrays()
{ {
$formatter = new NormalizerFormatter(); $formatter = new NormalizerFormatter();
...@@ -231,7 +258,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase ...@@ -231,7 +258,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
'extra' => array(), 'extra' => array(),
)); ));
$this->assertCount(1000, $res['context'][0]); $this->assertCount(1001, $res['context'][0]);
$this->assertEquals('Over 1000 items (2000 total), aborting normalization', $res['context'][0]['...']); $this->assertEquals('Over 1000 items (2000 total), aborting normalization', $res['context'][0]['...']);
} }
...@@ -380,6 +407,29 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase ...@@ -380,6 +407,29 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$result['context']['exception']['trace'][0] $result['context']['exception']['trace'][0]
); );
} }
public function testExceptionTraceDoesNotLeakCallUserFuncArgs()
{
try {
$arg = new TestInfoLeak;
call_user_func(array($this, 'throwHelper'), $arg, $dt = new \DateTime());
} catch (\Exception $e) {
}
$formatter = new NormalizerFormatter();
$record = array('context' => array('exception' => $e));
$result = $formatter->format($record);
$this->assertSame(
'{"function":"throwHelper","class":"Monolog\\\\Formatter\\\\NormalizerFormatterTest","type":"->","args":["[object] (Monolog\\\\Formatter\\\\TestInfoLeak)","'.$dt->format('Y-m-d H:i:s').'"]}',
$result['context']['exception']['trace'][0]
);
}
private function throwHelper($arg)
{
throw new \RuntimeException('Thrown');
}
} }
class TestFooNorm class TestFooNorm
...@@ -421,3 +471,11 @@ class TestToStringError ...@@ -421,3 +471,11 @@ class TestToStringError
throw new \RuntimeException('Could not convert to string'); throw new \RuntimeException('Could not convert to string');
} }
} }
class TestInfoLeak
{
public function __toString()
{
return 'Sensitive information';
}
}
...@@ -21,7 +21,7 @@ class BrowserConsoleHandlerTest extends TestCase ...@@ -21,7 +21,7 @@ class BrowserConsoleHandlerTest extends TestCase
{ {
protected function setUp() protected function setUp()
{ {
BrowserConsoleHandler::reset(); BrowserConsoleHandler::resetStatic();
} }
protected function generateScript() protected function generateScript()
......
...@@ -21,7 +21,7 @@ class ChromePHPHandlerTest extends TestCase ...@@ -21,7 +21,7 @@ class ChromePHPHandlerTest extends TestCase
{ {
protected function setUp() protected function setUp()
{ {
TestChromePHPHandler::reset(); TestChromePHPHandler::resetStatic();
$_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; Chrome/1.0'; $_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; Chrome/1.0';
} }
...@@ -136,7 +136,7 @@ class TestChromePHPHandler extends ChromePHPHandler ...@@ -136,7 +136,7 @@ class TestChromePHPHandler extends ChromePHPHandler
{ {
protected $headers = array(); protected $headers = array();
public static function reset() public static function resetStatic()
{ {
self::$initialized = false; self::$initialized = false;
self::$overflowed = false; self::$overflowed = false;
......
...@@ -58,7 +58,7 @@ class FingersCrossedHandlerTest extends TestCase ...@@ -58,7 +58,7 @@ class FingersCrossedHandlerTest extends TestCase
* @covers Monolog\Handler\FingersCrossedHandler::activate * @covers Monolog\Handler\FingersCrossedHandler::activate
* @covers Monolog\Handler\FingersCrossedHandler::reset * @covers Monolog\Handler\FingersCrossedHandler::reset
*/ */
public function testHandleRestartBufferingAfterReset() public function testHandleResetBufferingAfterReset()
{ {
$test = new TestHandler(); $test = new TestHandler();
$handler = new FingersCrossedHandler($test); $handler = new FingersCrossedHandler($test);
...@@ -76,7 +76,7 @@ class FingersCrossedHandlerTest extends TestCase ...@@ -76,7 +76,7 @@ class FingersCrossedHandlerTest extends TestCase
* @covers Monolog\Handler\FingersCrossedHandler::handle * @covers Monolog\Handler\FingersCrossedHandler::handle
* @covers Monolog\Handler\FingersCrossedHandler::activate * @covers Monolog\Handler\FingersCrossedHandler::activate
*/ */
public function testHandleRestartBufferingAfterBeingTriggeredWhenStopBufferingIsDisabled() public function testHandleResetBufferingAfterBeingTriggeredWhenStopBufferingIsDisabled()
{ {
$test = new TestHandler(); $test = new TestHandler();
$handler = new FingersCrossedHandler($test, Logger::WARNING, 0, false, false); $handler = new FingersCrossedHandler($test, Logger::WARNING, 0, false, false);
......
...@@ -21,7 +21,7 @@ class FirePHPHandlerTest extends TestCase ...@@ -21,7 +21,7 @@ class FirePHPHandlerTest extends TestCase
{ {
public function setUp() public function setUp()
{ {
TestFirePHPHandler::reset(); TestFirePHPHandler::resetStatic();
$_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; FirePHP/1.0'; $_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; FirePHP/1.0';
} }
...@@ -77,7 +77,7 @@ class TestFirePHPHandler extends FirePHPHandler ...@@ -77,7 +77,7 @@ class TestFirePHPHandler extends FirePHPHandler
{ {
protected $headers = array(); protected $headers = array();
public static function reset() public static function resetStatic()
{ {
self::$initialized = false; self::$initialized = false;
self::$sendHeaders = true; self::$sendHeaders = true;
......
<?php
/*
* 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\TestCase;
use Monolog\Logger;
/**
* @author Robert Kaufmann III <rok3@rok3.me>
* @author Gabriel Machado <gabriel.ms1@hotmail.com>
*/
class InsightOpsHandlerTest extends TestCase
{
/**
* @var resource
*/
private $resource;
/**
* @var LogEntriesHandler
*/
private $handler;
public function testWriteContent()
{
$this->createHandler();
$this->handler->handle($this->getRecord(Logger::CRITICAL, 'Critical write test'));
fseek($this->resource, 0);
$content = fread($this->resource, 1024);
$this->assertRegexp('/testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] test.CRITICAL: Critical write test/', $content);
}
public function testWriteBatchContent()
{
$this->createHandler();
$this->handler->handleBatch($this->getMultipleRecords());
fseek($this->resource, 0);
$content = fread($this->resource, 1024);
$this->assertRegexp('/(testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] .* \[\] \[\]\n){3}/', $content);
}
private function createHandler()
{
$useSSL = extension_loaded('openssl');
$args = array('testToken', 'us', $useSSL, Logger::DEBUG, true);
$this->resource = fopen('php://memory', 'a');
$this->handler = $this->getMock(
'\Monolog\Handler\InsightOpsHandler',
array('fsockopen', 'streamSetTimeout', 'closeSocket'),
$args
);
$reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString');
$reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($this->handler, 'localhost:1234');
$this->handler->expects($this->any())
->method('fsockopen')
->will($this->returnValue($this->resource));
$this->handler->expects($this->any())
->method('streamSetTimeout')
->will($this->returnValue(true));
$this->handler->expects($this->any())
->method('closeSocket')
->will($this->returnValue(true));
}
}
...@@ -191,6 +191,40 @@ class RotatingFileHandlerTest extends TestCase ...@@ -191,6 +191,40 @@ class RotatingFileHandlerTest extends TestCase
); );
} }
/**
* @dataProvider rotationWhenSimilarFilesExistTests
*/
public function testRotationWhenSimilarFileNamesExist($dateFormat)
{
touch($old1 = __DIR__.'/Fixtures/foo-foo-'.date($dateFormat).'.rot');
touch($old2 = __DIR__.'/Fixtures/foo-bar-'.date($dateFormat).'.rot');
$log = __DIR__.'/Fixtures/foo-'.date($dateFormat).'.rot';
$handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2);
$handler->setFormatter($this->getIdentityFormatter());
$handler->setFilenameFormat('{filename}-{date}', $dateFormat);
$handler->handle($this->getRecord());
$handler->close();
$this->assertTrue(file_exists($log));
}
public function rotationWhenSimilarFilesExistTests()
{
return array(
'Rotation is triggered when the file of the current day is not present but similar exists'
=> array(RotatingFileHandler::FILE_PER_DAY),
'Rotation is triggered when the file of the current month is not present but similar exists'
=> array(RotatingFileHandler::FILE_PER_MONTH),
'Rotation is triggered when the file of the current year is not present but similar exists'
=> array(RotatingFileHandler::FILE_PER_YEAR),
);
}
public function testReuseCurrentFile() public function testReuseCurrentFile()
{ {
$log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot'; $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot';
......
...@@ -320,12 +320,12 @@ class SlackRecordTest extends TestCase ...@@ -320,12 +320,12 @@ class SlackRecordTest extends TestCase
'short' => false, 'short' => false,
), ),
array( array(
'title' => 'tags', 'title' => 'Tags',
'value' => sprintf('```%s```', json_encode($extra['tags'])), 'value' => sprintf('```%s```', json_encode($extra['tags'])),
'short' => false 'short' => false
), ),
array( array(
'title' => 'test', 'title' => 'Test',
'value' => $context['test'], 'value' => $context['test'],
'short' => false 'short' => false
) )
...@@ -353,6 +353,14 @@ class SlackRecordTest extends TestCase ...@@ -353,6 +353,14 @@ class SlackRecordTest extends TestCase
$this->assertSame($record['datetime']->getTimestamp(), $attachment['ts']); $this->assertSame($record['datetime']->getTimestamp(), $attachment['ts']);
} }
public function testContextHasException()
{
$record = $this->getRecord(Logger::CRITICAL, 'This is a critical message.', array('exception' => new \Exception()));
$slackRecord = new SlackRecord(null, null, true, null, false, true);
$data = $slackRecord->getSlackData($record);
$this->assertInternalType('string', $data['attachments'][0]['fields'][1]['value']);
}
public function testExcludeExtraAndContextFields() public function testExcludeExtraAndContextFields()
{ {
$record = $this->getRecord( $record = $this->getRecord(
...@@ -368,12 +376,12 @@ class SlackRecordTest extends TestCase ...@@ -368,12 +376,12 @@ class SlackRecordTest extends TestCase
$expected = array( $expected = array(
array( array(
'title' => 'info', 'title' => 'Info',
'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)), 'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)),
'short' => false 'short' => false
), ),
array( array(
'title' => 'tags', 'title' => 'Tags',
'value' => sprintf('```%s```', json_encode(array('web'))), 'value' => sprintf('```%s```', json_encode(array('web'))),
'short' => false 'short' => false
), ),
......
...@@ -77,6 +77,13 @@ class SocketHandlerTest extends TestCase ...@@ -77,6 +77,13 @@ class SocketHandlerTest extends TestCase
$this->assertEquals(10.25, $this->handler->getWritingTimeout()); $this->assertEquals(10.25, $this->handler->getWritingTimeout());
} }
public function testSetChunkSize()
{
$this->createHandler('localhost:1234');
$this->handler->setChunkSize(1025);
$this->assertEquals(1025, $this->handler->getChunkSize());
}
public function testSetConnectionString() public function testSetConnectionString()
{ {
$this->createHandler('tcp://localhost:9090'); $this->createHandler('tcp://localhost:9090');
...@@ -121,6 +128,19 @@ class SocketHandlerTest extends TestCase ...@@ -121,6 +128,19 @@ class SocketHandlerTest extends TestCase
} }
/** /**
* @expectedException UnexpectedValueException
*/
public function testExceptionIsThrownIfCannotSetChunkSize()
{
$this->setMockHandler(array('streamSetChunkSize'));
$this->handler->setChunkSize(8192);
$this->handler->expects($this->once())
->method('streamSetChunkSize')
->will($this->returnValue(false));
$this->writeRecord('Hello world');
}
/**
* @expectedException RuntimeException * @expectedException RuntimeException
*/ */
public function testWriteFailsOnIfFwriteReturnsFalse() public function testWriteFailsOnIfFwriteReturnsFalse()
...@@ -304,6 +324,12 @@ class SocketHandlerTest extends TestCase ...@@ -304,6 +324,12 @@ class SocketHandlerTest extends TestCase
->will($this->returnValue(true)); ->will($this->returnValue(true));
} }
if (!in_array('streamSetChunkSize', $methods)) {
$this->handler->expects($this->any())
->method('streamSetChunkSize')
->will($this->returnValue(8192));
}
$this->handler->setFormatter($this->getIdentityFormatter()); $this->handler->setFormatter($this->getIdentityFormatter());
} }
} }
...@@ -54,6 +54,52 @@ class TestHandlerTest extends TestCase ...@@ -54,6 +54,52 @@ class TestHandlerTest extends TestCase
$this->assertEquals(array($record), $records); $this->assertEquals(array($record), $records);
} }
public function testHandlerAssertEmptyContext() {
$handler = new TestHandler;
$record = $this->getRecord(Logger::WARNING, 'test', array());
$this->assertFalse($handler->hasWarning(array(
'message' => 'test',
'context' => array(),
)));
$handler->handle($record);
$this->assertTrue($handler->hasWarning(array(
'message' => 'test',
'context' => array(),
)));
$this->assertFalse($handler->hasWarning(array(
'message' => 'test',
'context' => array(
'foo' => 'bar'
),
)));
}
public function testHandlerAssertNonEmptyContext() {
$handler = new TestHandler;
$record = $this->getRecord(Logger::WARNING, 'test', array('foo' => 'bar'));
$this->assertFalse($handler->hasWarning(array(
'message' => 'test',
'context' => array(
'foo' => 'bar'
),
)));
$handler->handle($record);
$this->assertTrue($handler->hasWarning(array(
'message' => 'test',
'context' => array(
'foo' => 'bar'
),
)));
$this->assertFalse($handler->hasWarning(array(
'message' => 'test',
'context' => array(),
)));
}
public function methodProvider() public function methodProvider()
{ {
return array( return array(
......
...@@ -88,6 +88,29 @@ class WhatFailureGroupHandlerTest extends TestCase ...@@ -88,6 +88,29 @@ class WhatFailureGroupHandlerTest extends TestCase
} }
/** /**
* @covers Monolog\Handler\WhatFailureGroupHandler::handleBatch
*/
public function testHandleBatchUsesProcessors()
{
$testHandlers = array(new TestHandler(), new TestHandler());
$handler = new WhatFailureGroupHandler($testHandlers);
$handler->pushProcessor(function ($record) {
$record['extra']['foo'] = true;
return $record;
});
$handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO)));
foreach ($testHandlers as $test) {
$this->assertTrue($test->hasDebugRecords());
$this->assertTrue($test->hasInfoRecords());
$this->assertTrue(count($test->getRecords()) === 2);
$records = $test->getRecords();
$this->assertTrue($records[0]['extra']['foo']);
$this->assertTrue($records[1]['extra']['foo']);
}
}
/**
* @covers Monolog\Handler\WhatFailureGroupHandler::handle * @covers Monolog\Handler\WhatFailureGroupHandler::handle
*/ */
public function testHandleException() public function testHandleException()
......
...@@ -545,4 +545,146 @@ class LoggerTest extends \PHPUnit_Framework_TestCase ...@@ -545,4 +545,146 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
'without microseconds' => array(false, PHP_VERSION_ID >= 70100 ? 'assertNotSame' : 'assertSame'), 'without microseconds' => array(false, PHP_VERSION_ID >= 70100 ? 'assertNotSame' : 'assertSame'),
); );
} }
/**
* @covers Monolog\Logger::setExceptionHandler
*/
public function testSetExceptionHandler()
{
$logger = new Logger(__METHOD__);
$this->assertNull($logger->getExceptionHandler());
$callback = function ($ex) {
};
$logger->setExceptionHandler($callback);
$this->assertEquals($callback, $logger->getExceptionHandler());
}
/**
* @covers Monolog\Logger::setExceptionHandler
* @expectedException InvalidArgumentException
*/
public function testBadExceptionHandlerType()
{
$logger = new Logger(__METHOD__);
$logger->setExceptionHandler(false);
}
/**
* @covers Monolog\Logger::handleException
* @expectedException Exception
*/
public function testDefaultHandleException()
{
$logger = new Logger(__METHOD__);
$handler = $this->getMock('Monolog\Handler\HandlerInterface');
$handler->expects($this->any())
->method('isHandling')
->will($this->returnValue(true))
;
$handler->expects($this->any())
->method('handle')
->will($this->throwException(new \Exception('Some handler exception')))
;
$logger->pushHandler($handler);
$logger->info('test');
}
/**
* @covers Monolog\Logger::handleException
* @covers Monolog\Logger::addRecord
*/
public function testCustomHandleException()
{
$logger = new Logger(__METHOD__);
$that = $this;
$logger->setExceptionHandler(function ($e, $record) use ($that) {
$that->assertEquals($e->getMessage(), 'Some handler exception');
$that->assertTrue(is_array($record));
$that->assertEquals($record['message'], 'test');
});
$handler = $this->getMock('Monolog\Handler\HandlerInterface');
$handler->expects($this->any())
->method('isHandling')
->will($this->returnValue(true))
;
$handler->expects($this->any())
->method('handle')
->will($this->throwException(new \Exception('Some handler exception')))
;
$logger->pushHandler($handler);
$logger->info('test');
}
public function testReset()
{
$logger = new Logger('app');
$testHandler = new Handler\TestHandler();
$bufferHandler = new Handler\BufferHandler($testHandler);
$groupHandler = new Handler\GroupHandler(array($bufferHandler));
$fingersCrossedHandler = new Handler\FingersCrossedHandler($groupHandler);
$logger->pushHandler($fingersCrossedHandler);
$processorUid1 = new Processor\UidProcessor(10);
$uid1 = $processorUid1->getUid();
$groupHandler->pushProcessor($processorUid1);
$processorUid2 = new Processor\UidProcessor(5);
$uid2 = $processorUid2->getUid();
$logger->pushProcessor($processorUid2);
$getProperty = function ($object, $property) {
$reflectionProperty = new \ReflectionProperty(get_class($object), $property);
$reflectionProperty->setAccessible(true);
return $reflectionProperty->getValue($object);
};
$that = $this;
$assertBufferOfBufferHandlerEmpty = function () use ($getProperty, $bufferHandler, $that) {
$that->assertEmpty($getProperty($bufferHandler, 'buffer'));
};
$assertBuffersEmpty = function() use ($assertBufferOfBufferHandlerEmpty, $getProperty, $fingersCrossedHandler, $that) {
$assertBufferOfBufferHandlerEmpty();
$that->assertEmpty($getProperty($fingersCrossedHandler, 'buffer'));
};
$logger->debug('debug');
$logger->reset();
$assertBuffersEmpty();
$this->assertFalse($testHandler->hasDebugRecords());
$this->assertFalse($testHandler->hasErrorRecords());
$this->assertNotSame($uid1, $uid1 = $processorUid1->getUid());
$this->assertNotSame($uid2, $uid2 = $processorUid2->getUid());
$logger->debug('debug');
$logger->error('error');
$logger->reset();
$assertBuffersEmpty();
$this->assertTrue($testHandler->hasDebugRecords());
$this->assertTrue($testHandler->hasErrorRecords());
$this->assertNotSame($uid1, $uid1 = $processorUid1->getUid());
$this->assertNotSame($uid2, $uid2 = $processorUid2->getUid());
$logger->info('info');
$this->assertNotEmpty($getProperty($fingersCrossedHandler, 'buffer'));
$assertBufferOfBufferHandlerEmpty();
$this->assertFalse($testHandler->hasInfoRecords());
$logger->reset();
$assertBuffersEmpty();
$this->assertFalse($testHandler->hasInfoRecords());
$this->assertNotSame($uid1, $uid1 = $processorUid1->getUid());
$this->assertNotSame($uid2, $uid2 = $processorUid2->getUid());
$logger->notice('notice');
$logger->emergency('emergency');
$logger->reset();
$assertBuffersEmpty();
$this->assertFalse($testHandler->hasInfoRecords());
$this->assertTrue($testHandler->hasNoticeRecords());
$this->assertTrue($testHandler->hasEmergencyRecords());
$this->assertNotSame($uid1, $processorUid1->getUid());
$this->assertNotSame($uid2, $processorUid2->getUid());
}
} }
<?php
/*
* 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 Monolog\Handler\StreamHandler;
use Monolog\Handler\TestHandler;
use Psr\Log\LogLevel;
/**
* @author Robert Gust-Bardon <robert@gust-bardon.org>
* @covers Monolog\SignalHandler
*/
class SignalHandlerTest extends TestCase
{
private $asyncSignalHandling;
private $blockedSignals;
private $signalHandlers;
protected function setUp()
{
$this->signalHandlers = array();
if (extension_loaded('pcntl')) {
if (function_exists('pcntl_async_signals')) {
$this->asyncSignalHandling = pcntl_async_signals();
}
if (function_exists('pcntl_sigprocmask')) {
pcntl_sigprocmask(SIG_BLOCK, array(), $this->blockedSignals);
}
}
}
protected function tearDown()
{
if ($this->asyncSignalHandling !== null) {
pcntl_async_signals($this->asyncSignalHandling);
}
if ($this->blockedSignals !== null) {
pcntl_sigprocmask(SIG_SETMASK, $this->blockedSignals);
}
if ($this->signalHandlers) {
pcntl_signal_dispatch();
foreach ($this->signalHandlers as $signo => $handler) {
pcntl_signal($signo, $handler);
}
}
}
private function setSignalHandler($signo, $handler = SIG_DFL) {
if (function_exists('pcntl_signal_get_handler')) {
$this->signalHandlers[$signo] = pcntl_signal_get_handler($signo);
} else {
$this->signalHandlers[$signo] = SIG_DFL;
}
$this->assertTrue(pcntl_signal($signo, $handler));
}
public function testHandleSignal()
{
$logger = new Logger('test', array($handler = new TestHandler));
$errHandler = new SignalHandler($logger);
$signo = 2; // SIGINT.
$siginfo = array('signo' => $signo, 'errno' => 0, 'code' => 0);
$errHandler->handleSignal($signo, $siginfo);
$this->assertCount(1, $handler->getRecords());
$this->assertTrue($handler->hasCriticalRecords());
$records = $handler->getRecords();
$this->assertSame($siginfo, $records[0]['context']);
}
/**
* @depends testHandleSignal
* @requires extension pcntl
* @requires extension posix
* @requires function pcntl_signal
* @requires function pcntl_signal_dispatch
* @requires function posix_getpid
* @requires function posix_kill
*/
public function testRegisterSignalHandler()
{
// SIGCONT and SIGURG should be ignored by default.
if (!defined('SIGCONT') || !defined('SIGURG')) {
$this->markTestSkipped('This test requires the SIGCONT and SIGURG pcntl constants.');
}
$this->setSignalHandler(SIGCONT, SIG_IGN);
$this->setSignalHandler(SIGURG, SIG_IGN);
$logger = new Logger('test', array($handler = new TestHandler));
$errHandler = new SignalHandler($logger);
$pid = posix_getpid();
$this->assertTrue(posix_kill($pid, SIGURG));
$this->assertTrue(pcntl_signal_dispatch());
$this->assertCount(0, $handler->getRecords());
$errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, false, false);
$this->assertTrue(posix_kill($pid, SIGCONT));
$this->assertTrue(pcntl_signal_dispatch());
$this->assertCount(0, $handler->getRecords());
$this->assertTrue(posix_kill($pid, SIGURG));
$this->assertTrue(pcntl_signal_dispatch());
$this->assertCount(1, $handler->getRecords());
$this->assertTrue($handler->hasInfoThatContains('SIGURG'));
}
/**
* @dataProvider defaultPreviousProvider
* @depends testRegisterSignalHandler
* @requires function pcntl_fork
* @requires function pcntl_sigprocmask
* @requires function pcntl_waitpid
*/
public function testRegisterDefaultPreviousSignalHandler($signo, $callPrevious, $expected)
{
$this->setSignalHandler($signo, SIG_DFL);
$path = tempnam(sys_get_temp_dir(), 'monolog-');
$this->assertNotFalse($path);
$pid = pcntl_fork();
if ($pid === 0) { // Child.
$streamHandler = new StreamHandler($path);
$streamHandler->setFormatter($this->getIdentityFormatter());
$logger = new Logger('test', array($streamHandler));
$errHandler = new SignalHandler($logger);
$errHandler->registerSignalHandler($signo, LogLevel::INFO, $callPrevious, false, false);
pcntl_sigprocmask(SIG_SETMASK, array(SIGCONT));
posix_kill(posix_getpid(), $signo);
pcntl_signal_dispatch();
// If $callPrevious is true, SIGINT should terminate by this line.
pcntl_sigprocmask(SIG_BLOCK, array(), $oldset);
file_put_contents($path, implode(' ', $oldset), FILE_APPEND);
posix_kill(posix_getpid(), $signo);
pcntl_signal_dispatch();
exit();
}
$this->assertNotSame(-1, $pid);
$this->assertNotSame(-1, pcntl_waitpid($pid, $status));
$this->assertNotSame(-1, $status);
$this->assertSame($expected, file_get_contents($path));
}
public function defaultPreviousProvider()
{
if (!defined('SIGCONT') || !defined('SIGINT') || !defined('SIGURG')) {
return array();
}
return array(
array(SIGINT, false, 'Program received signal SIGINT'.SIGCONT.'Program received signal SIGINT'),
array(SIGINT, true, 'Program received signal SIGINT'),
array(SIGURG, false, 'Program received signal SIGURG'.SIGCONT.'Program received signal SIGURG'),
array(SIGURG, true, 'Program received signal SIGURG'.SIGCONT.'Program received signal SIGURG'),
);
}
/**
* @dataProvider callablePreviousProvider
* @depends testRegisterSignalHandler
* @requires function pcntl_signal_get_handler
*/
public function testRegisterCallablePreviousSignalHandler($callPrevious)
{
$this->setSignalHandler(SIGURG, SIG_IGN);
$logger = new Logger('test', array($handler = new TestHandler));
$errHandler = new SignalHandler($logger);
$previousCalled = 0;
pcntl_signal(SIGURG, function ($signo, array $siginfo = null) use (&$previousCalled) {
++$previousCalled;
});
$errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, $callPrevious, false, false);
$this->assertTrue(posix_kill(posix_getpid(), SIGURG));
$this->assertTrue(pcntl_signal_dispatch());
$this->assertCount(1, $handler->getRecords());
$this->assertTrue($handler->hasInfoThatContains('SIGURG'));
$this->assertSame($callPrevious ? 1 : 0, $previousCalled);
}
public function callablePreviousProvider()
{
return array(
array(false),
array(true),
);
}
/**
* @dataProvider restartSyscallsProvider
* @depends testRegisterDefaultPreviousSignalHandler
* @requires function pcntl_fork
* @requires function pcntl_waitpid
*/
public function testRegisterSyscallRestartingSignalHandler($restartSyscalls)
{
$this->setSignalHandler(SIGURG, SIG_IGN);
$parentPid = posix_getpid();
$microtime = microtime(true);
$pid = pcntl_fork();
if ($pid === 0) { // Child.
usleep(100000);
posix_kill($parentPid, SIGURG);
usleep(100000);
exit();
}
$this->assertNotSame(-1, $pid);
$logger = new Logger('test', array($handler = new TestHandler));
$errHandler = new SignalHandler($logger);
$errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, $restartSyscalls, false);
if ($restartSyscalls) {
// pcntl_wait is expected to be restarted after the signal handler.
$this->assertNotSame(-1, pcntl_waitpid($pid, $status));
} else {
// pcntl_wait is expected to be interrupted when the signal handler is invoked.
$this->assertSame(-1, pcntl_waitpid($pid, $status));
}
$this->assertSame($restartSyscalls, microtime(true) - $microtime > 0.15);
$this->assertTrue(pcntl_signal_dispatch());
$this->assertCount(1, $handler->getRecords());
if ($restartSyscalls) {
// The child has already exited.
$this->assertSame(-1, pcntl_waitpid($pid, $status));
} else {
// The child has not exited yet.
$this->assertNotSame(-1, pcntl_waitpid($pid, $status));
}
}
public function restartSyscallsProvider()
{
return array(
array(false),
array(true),
array(false),
array(true),
);
}
/**
* @dataProvider asyncProvider
* @depends testRegisterDefaultPreviousSignalHandler
* @requires function pcntl_async_signals
*/
public function testRegisterAsyncSignalHandler($initialAsync, $desiredAsync, $expectedBefore, $expectedAfter)
{
$this->setSignalHandler(SIGURG, SIG_IGN);
pcntl_async_signals($initialAsync);
$logger = new Logger('test', array($handler = new TestHandler));
$errHandler = new SignalHandler($logger);
$errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, false, $desiredAsync);
$this->assertTrue(posix_kill(posix_getpid(), SIGURG));
$this->assertCount($expectedBefore, $handler->getRecords());
$this->assertTrue(pcntl_signal_dispatch());
$this->assertCount($expectedAfter, $handler->getRecords());
}
public function asyncProvider()
{
return array(
array(false, false, 0, 1),
array(false, null, 0, 1),
array(false, true, 1, 1),
array(true, false, 0, 1),
array(true, null, 1, 1),
array(true, true, 1, 1),
);
}
}
...@@ -25,9 +25,12 @@ ...@@ -25,9 +25,12 @@
"symfony/translation": "~2.6 || ~3.0 || ~4.0" "symfony/translation": "~2.6 || ~3.0 || ~4.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "~2",
"phpunit/phpunit": "^4.8.35 || ^5.7" "phpunit/phpunit": "^4.8.35 || ^5.7"
}, },
"suggest": {
"friendsofphp/php-cs-fixer": "Needed for the `composer phpcs` command. Allow to automatically fix code style.",
"phpstan/phpstan": "Needed for the `composer phpstan` command. Allow to detect potential errors."
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"": "src/" "": "src/"
......
...@@ -195,7 +195,7 @@ class Carbon extends DateTime implements JsonSerializable ...@@ -195,7 +195,7 @@ class Carbon extends DateTime implements JsonSerializable
't' => '(2[89]|3[01])', 't' => '(2[89]|3[01])',
'L' => '(0|1)', 'L' => '(0|1)',
'o' => '([1-9][0-9]{0,4})', 'o' => '([1-9][0-9]{0,4})',
'Y' => '([1-9][0-9]{0,4})', 'Y' => '([1-9]?[0-9]{4})',
'y' => '([0-9]{2})', 'y' => '([0-9]{2})',
'a' => '(am|pm)', 'a' => '(am|pm)',
'A' => '(AM|PM)', 'A' => '(AM|PM)',
...@@ -217,8 +217,8 @@ class Carbon extends DateTime implements JsonSerializable ...@@ -217,8 +217,8 @@ class Carbon extends DateTime implements JsonSerializable
'U' => '([0-9]*)', 'U' => '([0-9]*)',
// The formats below are combinations of the above formats. // The formats below are combinations of the above formats.
'c' => '(([1-9][0-9]{0,4})\-(1[012]|0[1-9])\-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[\+\-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP 'c' => '(([1-9]?[0-9]{4})\-(1[012]|0[1-9])\-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[\+\-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP
'r' => '(([a-zA-Z]{3}), ([123][0-9]|[1-9]) ([a-zA-Z]{3}) ([1-9][0-9]{0,4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [\+\-](1[012]|0[0-9])([0134][05]))', // D, j M Y H:i:s O 'r' => '(([a-zA-Z]{3}), ([123][0-9]|[1-9]) ([a-zA-Z]{3}) ([1-9]?[0-9]{4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [\+\-](1[012]|0[0-9])([0134][05]))', // D, j M Y H:i:s O
); );
/** /**
...@@ -3976,7 +3976,13 @@ class Carbon extends DateTime implements JsonSerializable ...@@ -3976,7 +3976,13 @@ class Carbon extends DateTime implements JsonSerializable
$value = $diff->days * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE + $value = $diff->days * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE +
$diff->h * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE + $diff->h * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE +
$diff->i * static::SECONDS_PER_MINUTE + $diff->i * static::SECONDS_PER_MINUTE +
$diff->s; $diff->s - (
version_compare(PHP_VERSION, '7.1.8-dev', '>=') &&
property_exists($diff, 'f') &&
$diff->f < 0
? 1
: 0
);
return $absolute || !$diff->invert ? $value : -$value; return $absolute || !$diff->invert ? $value : -$value;
} }
......
...@@ -498,6 +498,11 @@ class CarbonInterval extends DateInterval ...@@ -498,6 +498,11 @@ class CarbonInterval extends DateInterval
{ {
$instance = new static(static::getDateIntervalSpec($di)); $instance = new static(static::getDateIntervalSpec($di));
$instance->invert = $di->invert; $instance->invert = $di->invert;
foreach (array('y', 'm', 'd', 'h', 'i', 's') as $unit) {
if ($di->$unit < 0) {
$instance->$unit *= -1;
}
}
return $instance; return $instance;
} }
...@@ -961,15 +966,15 @@ class CarbonInterval extends DateInterval ...@@ -961,15 +966,15 @@ class CarbonInterval extends DateInterval
public static function getDateIntervalSpec(DateInterval $interval) public static function getDateIntervalSpec(DateInterval $interval)
{ {
$date = array_filter(array( $date = array_filter(array(
static::PERIOD_YEARS => $interval->y, static::PERIOD_YEARS => abs($interval->y),
static::PERIOD_MONTHS => $interval->m, static::PERIOD_MONTHS => abs($interval->m),
static::PERIOD_DAYS => $interval->d, static::PERIOD_DAYS => abs($interval->d),
)); ));
$time = array_filter(array( $time = array_filter(array(
static::PERIOD_HOURS => $interval->h, static::PERIOD_HOURS => abs($interval->h),
static::PERIOD_MINUTES => $interval->i, static::PERIOD_MINUTES => abs($interval->i),
static::PERIOD_SECONDS => $interval->s, static::PERIOD_SECONDS => abs($interval->s),
)); ));
$specString = static::PERIOD_PREFIX; $specString = static::PERIOD_PREFIX;
......
# monitorDing
Laravel 插件,用于给钉钉自定义机器人发送消息
# 引入步骤
发布视图
```
php artisan vendor:publish
```
`config/app.php` 添加
```
Redgo\MonitorDing\MonitorDingServiceProvider::class,
```
如果需要配置门面模式, 在 `config/app.php` 添加
```
'MonitorDing' => Redgo\MonitorDing\Facades\MonitorDing::class,
```
# 使用
1. 首先在配置文件 `config/monitorDing` 修改 `webhook`
{
"name": "redgo/monitor-ding",
"license": "MIT",
"description": "用于给钉钉自定义机器人发送消息",
"type": "library",
"authors": [
{
"name": "redgo",
"email": "1223858310@qq.com"
}
],
"require": {
"laravel/framework": "^5.1"
},
"autoload": {
"psr-4": {
"Redgo\\MonitorDing\\": "src/"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
<?php namespace Redgo\MonitorDing\Exceptions;
use Exception;
class SendErrorException extends Exception {
}
\ No newline at end of file
<?php namespace Redgo\MonitorDing\Facades;
use Illuminate\Support\Facades\Facade;
class MonitorDing extends Facade {
/**
* Return facade accessor
* @return string
*/
protected static function getFacadeAccessor()
{
return 'monitorDing';
}
}
\ No newline at end of file
<?php
namespace Redgo\MonitorDing\Middleware;
use Error;
use Closure;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Psy\Exception\ErrorException;
use Redgo\MonitorDing\Exceptions\SendErrorException;
use Redgo\MonitorDing\MonitorDingClient;
use Symfony\Component\Debug\Exception\FatalThrowableError;
class Monitor
{
/**
* The App container
*
* @var Container
*/
protected $container;
/**
* The Monitor Client
*
* @var MonitorDingClient
*/
protected $monitor;
/**
* Create a new middleware instance.
*
* @param Container $container
*/
public function __construct(Container $container, MonitorDingClient $monitor)
{
$this->container = $container;
$this->monitor = $monitor;
}
/**
* Handle an incoming request.
*
* @param Request $request
* @param Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$enabled = config('monitorDing.enabled');
try {
$response = $next($request);
} catch (Exception $e) {
$response = $this->handleException($request, $e);
$enabled && $this->monitor->sendText(sprintf("文件:%s (%s 行) 内容:%s", $e->getFile(), $e->getLine(), $e->getMessage()));
} catch (Error $error) {
$e = new FatalThrowableError($error);
$response = $this->handleException($request, $e);
$enabled && $this->monitor->sendText(sprintf("文件:%s (%s 行) 内容:%s", $e->getFile(), $e->getLine(), $e->getMessage()));
}catch(ErrorException $error){
$e = new FatalThrowableError($error);
$response = $this->handleException($request, $e);
$enabled && $this->monitor->sendText(sprintf("文件:%s (%s 行) 内容:%s", $e->getFile(), $e->getLine(), $e->getMessage()));
}catch(SendErrorException $error){
$e = new FatalThrowableError($error);
$response = $this->handleException($request, $e);
$enabled && $this->monitor->sendText(sprintf("文件:%s (%s 行) 内容:%s", $e->getFile(), $e->getLine(), $e->getMessage()));
}finally{
if($response->getStatusCode() == 500 && (isset($response->exception) && $response->exception && $response->exception != null )){
$this->monitor->sendText(substr("Order系统错误[请及时修改]:".$response->exception,0,800)."---[更多详情请看日志]");
}
}
return $response;
}
/**
* Handle the given exception.
*
* (Copy from Illuminate\Routing\Pipeline by Taylor Otwell)
*
* @param $passable
* @param Exception $e
* @return mixed
* @throws Exception
*/
protected function handleException($passable, Exception $e)
{
if (! $this->container->bound(ExceptionHandler::class) || ! $passable instanceof Request) {
throw $e;
}
$handler = $this->container->make(ExceptionHandler::class);
$handler->report($e);
return $handler->render($passable, $e);
}
}
<?php
namespace Redgo\MonitorDing;
use Redgo\MonitorDing\Exceptions\SendErrorException;
class MonitorDingClient {
protected $webhook;
protected $curl_verify;
public function __construct($webhook, $curl_verify=false)
{
$this->webhook = $webhook;
$this->curl_verify = $curl_verify;
}
/**
* 发送文本类型的消息
*
* @param $content string 消息内容
* @param array $atMobiles 被@人的手机号
* @param bool $isAtAll 是否 @ 所有人
* @throws SendErrorException
*/
public function sendText($content, $atMobiles=[], $isAtAll=false) {
$params = [
'msgtype' => 'text',
'text' => [
'content' => $content,
],
'at' => [
'atMobiles' => $atMobiles,
'isAtAll' => $isAtAll
]
];
$this->send($params);
}
/**
* 发送 Link 类型的消息
*
*
* @param $title
* @param $text
* @param $messageUrl
* @param string $picUrl
* @throws SendErrorException
*/
public function sendLink($title, $text, $messageUrl, $picUrl="") {
$params = [
'msgtype' => 'link',
'link' => [
'text' => $text,
'title' => $title,
'messageUrl' => $messageUrl,
'picUrl' => $picUrl,
],
];
$this->send($params);
}
/**
* 发送 Markdown 类型的消息
*
* @param $title
* @param $text
* @param array $atMobiles
* @param bool $isAtAll
*/
public function sendMarkdown($title, $text, $atMobiles=[], $isAtAll=false) {
$params = [
'msgtype' => 'markdown',
'markdown' => [
'title' => $title,
'text' => $text,
],
'at' => [
'atMobiles' => $atMobiles,
'isAtAll' => $isAtAll,
],
];
$this->send($params);
}
/**
* 发送
* @param array $params 请求需要的参数
* @throws SendErrorException
*/
private function send($params=[]) {
if (! config('monitorDing.enabled')) {
app('Log')->info('~~ Monitor Ding ~~');
app('Log')->info($params);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->webhook);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_HTTPHEADER, array ('Content-Type: application/json;charset=utf-8'));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if ($this->curl_verify) {
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
}
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
if ($data['errcode']) {
throw new SendErrorException($data['errmsg']);
}
}
}
\ No newline at end of file
<?php
namespace Redgo\MonitorDing;
use Illuminate\Support\ServiceProvider;
class MonitorDingServiceProvider extends ServiceProvider {
/**
* Boot the provider.
*
* @return void
*/
public function boot()
{
$this->publishes([
__DIR__.'/config.php' => config_path('monitorDing.php'),
]);
$this->registerMiddleware('Redgo\MonitorDing\Middleware\Monitor');
}
/**
* 注册中间件
*
* @param string $middleware
*/
protected function registerMiddleware($middleware)
{
$kernel = $this->app['Illuminate\Contracts\Http\Kernel'];
$kernel->pushMiddleware($middleware);
}
/**
* 在容器中注册绑定.
*
* @return void
*/
public function register()
{
$this->app->singleton(MonitorDingClient::class, function ($app) {
$config = config('monitorDing');
return new MonitorDingClient($config['webhook'], $config['curl_verify']);
});
$this->app->alias(MonitorDingClient::class, 'monitorDing');
}
}
\ No newline at end of file
<?php
return [
// 是否开启报错写入
'enabled' => true,
// curl证书验证, 线下环境不用开启
'curl_verify' => false,
// webhook的值
'webhook' => '',
];
\ No newline at end of file
...@@ -31,8 +31,6 @@ class GenericEventTest extends TestCase ...@@ -31,8 +31,6 @@ class GenericEventTest extends TestCase
*/ */
protected function setUp() protected function setUp()
{ {
parent::setUp();
$this->subject = new \stdClass(); $this->subject = new \stdClass();
$this->event = new GenericEvent($this->subject, array('name' => 'Event')); $this->event = new GenericEvent($this->subject, array('name' => 'Event'));
} }
...@@ -44,8 +42,6 @@ class GenericEventTest extends TestCase ...@@ -44,8 +42,6 @@ class GenericEventTest extends TestCase
{ {
$this->subject = null; $this->subject = null;
$this->event = null; $this->event = null;
parent::tearDown();
} }
public function testConstruct() public function testConstruct()
......
...@@ -72,8 +72,8 @@ final class Mbstring ...@@ -72,8 +72,8 @@ final class Mbstring
private static $language = 'neutral'; private static $language = 'neutral';
private static $internalEncoding = 'UTF-8'; private static $internalEncoding = 'UTF-8';
private static $caseFold = array( private static $caseFold = array(
array('µ','ſ',"\xCD\x85",'ς',"\xCF\x90","\xCF\x91","\xCF\x95","\xCF\x96","\xCF\xB0","\xCF\xB1","\xCF\xB5","\xE1\xBA\x9B","\xE1\xBE\xBE"), array('µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"),
array('μ','s','ι', 'σ','β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1",'ι'), array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'),
); );
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
...@@ -141,7 +141,8 @@ final class Mbstring ...@@ -141,7 +141,8 @@ final class Mbstring
public static function mb_decode_numericentity($s, $convmap, $encoding = null) public static function mb_decode_numericentity($s, $convmap, $encoding = null)
{ {
if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) {
trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.gettype($s).' given', E_USER_WARNING); trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING);
return null; return null;
} }
...@@ -150,7 +151,8 @@ final class Mbstring ...@@ -150,7 +151,8 @@ final class Mbstring
} }
if (null !== $encoding && !\is_scalar($encoding)) { if (null !== $encoding && !\is_scalar($encoding)) {
trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING);
return ''; // Instead of null (cf. mb_encode_numericentity). return ''; // Instead of null (cf. mb_encode_numericentity).
} }
...@@ -185,6 +187,7 @@ final class Mbstring ...@@ -185,6 +187,7 @@ final class Mbstring
return Mbstring::mb_chr($c - $convmap[$i + 2]); return Mbstring::mb_chr($c - $convmap[$i + 2]);
} }
} }
return $m[0]; return $m[0];
}, $s); }, $s);
...@@ -198,7 +201,8 @@ final class Mbstring ...@@ -198,7 +201,8 @@ final class Mbstring
public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false)
{ {
if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) {
trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.gettype($s).' given', E_USER_WARNING); trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING);
return null; return null;
} }
...@@ -207,12 +211,14 @@ final class Mbstring ...@@ -207,12 +211,14 @@ final class Mbstring
} }
if (null !== $encoding && !\is_scalar($encoding)) { if (null !== $encoding && !\is_scalar($encoding)) {
trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING);
return null; // Instead of '' (cf. mb_decode_numericentity). return null; // Instead of '' (cf. mb_decode_numericentity).
} }
if (null !== $is_hex && !\is_scalar($is_hex)) { if (null !== $is_hex && !\is_scalar($is_hex)) {
trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.gettype($s).' given', E_USER_WARNING); trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', E_USER_WARNING);
return null; return null;
} }
...@@ -327,7 +333,7 @@ final class Mbstring ...@@ -327,7 +333,7 @@ final class Mbstring
} else { } else {
$s = substr_replace($s, $uchr, $i - $ulen, $ulen); $s = substr_replace($s, $uchr, $i - $ulen, $ulen);
$len += $nlen - $ulen; $len += $nlen - $ulen;
$i += $nlen - $ulen; $i += $nlen - $ulen;
} }
} }
} }
...@@ -455,6 +461,7 @@ final class Mbstring ...@@ -455,6 +461,7 @@ final class Mbstring
if (strncmp($enc, 'ISO-8859-', 9)) { if (strncmp($enc, 'ISO-8859-', 9)) {
return false; return false;
} }
// no break
case 'ASCII': case 'ASCII':
case 'UTF8': case 'UTF8':
case 'UTF-8': case 'UTF-8':
...@@ -704,6 +711,10 @@ final class Mbstring ...@@ -704,6 +711,10 @@ final class Mbstring
$s = mb_convert_encoding($s, 'UTF-8', $encoding); $s = mb_convert_encoding($s, 'UTF-8', $encoding);
} }
if (1 === \strlen($s)) {
return \ord($s);
}
$code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
if (0xF0 <= $code) { if (0xF0 <= $code) {
return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
......
<?php <?php
static $data = array ( return array(
'A' => 'a', 'A' => 'a',
'B' => 'b', 'B' => 'b',
'C' => 'c', 'C' => 'c',
...@@ -1094,8 +1094,3 @@ static $data = array ( ...@@ -1094,8 +1094,3 @@ static $data = array (
'𑢾' => '𑣞', '𑢾' => '𑣞',
'𑢿' => '𑣟', '𑢿' => '𑣟',
); );
$result =& $data;
unset($data);
return $result;
<?php <?php
static $data = array ( return array(
'a' => 'A', 'a' => 'A',
'b' => 'B', 'b' => 'B',
'c' => 'C', 'c' => 'C',
...@@ -1102,8 +1102,3 @@ static $data = array ( ...@@ -1102,8 +1102,3 @@ static $data = array (
'𑣞' => '𑢾', '𑣞' => '𑢾',
'𑣟' => '𑢿', '𑣟' => '𑢿',
); );
$result =& $data;
unset($data);
return $result;
...@@ -24,13 +24,13 @@ final class Php56 ...@@ -24,13 +24,13 @@ final class Php56
public static function hash_equals($knownString, $userInput) public static function hash_equals($knownString, $userInput)
{ {
if (!\is_string($knownString)) { if (!\is_string($knownString)) {
trigger_error('Expected known_string to be a string, '.gettype($knownString).' given', E_USER_WARNING); trigger_error('Expected known_string to be a string, '.\gettype($knownString).' given', E_USER_WARNING);
return false; return false;
} }
if (!\is_string($userInput)) { if (!\is_string($userInput)) {
trigger_error('Expected user_input to be a string, '.gettype($userInput).' given', E_USER_WARNING); trigger_error('Expected user_input to be a string, '.\gettype($userInput).' given', E_USER_WARNING);
return false; return false;
} }
...@@ -124,11 +124,11 @@ final class Php56 ...@@ -124,11 +124,11 @@ final class Php56
// Encode leading/trailing spaces if self::LDAP_ESCAPE_DN is passed // Encode leading/trailing spaces if self::LDAP_ESCAPE_DN is passed
if ($flags & self::LDAP_ESCAPE_DN) { if ($flags & self::LDAP_ESCAPE_DN) {
if ($result[0] === ' ') { if (' ' === $result[0]) {
$result = '\\20'.substr($result, 1); $result = '\\20'.substr($result, 1);
} }
if ($result[\strlen($result) - 1] === ' ') { if (' ' === $result[\strlen($result) - 1]) {
$result = substr($result, 0, -1).'\\20'; $result = substr($result, 0, -1).'\\20';
} }
} }
......
...@@ -11,8 +11,12 @@ ...@@ -11,8 +11,12 @@
namespace Symfony\Polyfill\Util; namespace Symfony\Polyfill\Util;
if (extension_loaded('mbstring')) { if (\extension_loaded('mbstring')) {
class Binary extends BinaryOnFuncOverload {} class Binary extends BinaryOnFuncOverload
{
}
} else { } else {
class Binary extends BinaryNoFuncOverload {} class Binary extends BinaryNoFuncOverload
{
}
} }
...@@ -81,4 +81,9 @@ class LegacyTestListener extends \PHPUnit_Framework_TestSuite implements \PHPUni ...@@ -81,4 +81,9 @@ class LegacyTestListener extends \PHPUnit_Framework_TestSuite implements \PHPUni
public function endTest(\PHPUnit_Framework_Test $test, $time) public function endTest(\PHPUnit_Framework_Test $test, $time)
{ {
} }
public static function warning($message)
{
return parent::warning($message);
}
} }
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
namespace Symfony\Polyfill\Util; namespace Symfony\Polyfill\Util;
use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\TestListener as TestListenerInterface;
use PHPUnit\Framework\Test; use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestListener as TestListenerInterface;
use PHPUnit\Framework\TestSuite; use PHPUnit\Framework\TestSuite;
use PHPUnit\Framework\Warning; use PHPUnit\Framework\Warning;
use PHPUnit\Framework\WarningTestCase;
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) { if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
class_alias('Symfony\Polyfill\Util\LegacyTestListener', 'Symfony\Polyfill\Util\TestListener'); class_alias('Symfony\Polyfill\Util\LegacyTestListener', 'Symfony\Polyfill\Util\TestListener');
...@@ -92,5 +93,10 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve ...@@ -92,5 +93,10 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve
public function endTest(Test $test, $time) public function endTest(Test $test, $time)
{ {
} }
public static function warning($message)
{
return parent::warning($message);
}
} }
} }
...@@ -40,17 +40,34 @@ class TestListenerTrait ...@@ -40,17 +40,34 @@ class TestListenerTrait
continue; continue;
} }
$testedClass = new \ReflectionClass($m[1].$m[2]); $testedClass = new \ReflectionClass($m[1].$m[2]);
$bootstrap = new \SplFileObject(dirname($testedClass->getFileName()).'/bootstrap.php'); $bootstrap = new \SplFileObject(\dirname($testedClass->getFileName()).'/bootstrap.php');
$warnings = array(); $warnings = array();
$defLine = null; $defLine = null;
foreach (new \RegexIterator($bootstrap, '/define\(\'/') as $defLine) {
preg_match('/define\(\'(?P<name>.+)\'/', $defLine, $matches);
if (\defined($matches['name'])) {
continue;
}
try {
eval($defLine);
} catch (\PHPUnit_Framework_Exception $ex){
$warnings[] = $TestListener::warning($ex->getMessage());
} catch (\PHPUnit\Framework\Exception $ex) {
$warnings[] = $TestListener::warning($ex->getMessage());
}
}
$bootstrap->rewind();
foreach (new \RegexIterator($bootstrap, '/return p\\\\'.$testedClass->getShortName().'::/') as $defLine) { foreach (new \RegexIterator($bootstrap, '/return p\\\\'.$testedClass->getShortName().'::/') as $defLine) {
if (!preg_match('/^\s*function (?P<name>[^\(]++)(?P<signature>\([^\)]*+\)) \{ (?<return>return p\\\\'.$testedClass->getShortName().'::[^\(]++)(?P<args>\([^\)]*+\)); \}$/', $defLine, $f)) { if (!preg_match('/^\s*function (?P<name>[^\(]++)(?P<signature>\(.*\)) \{ (?<return>return p\\\\'.$testedClass->getShortName().'::[^\(]++)(?P<args>\([^\)]*+\)); \}$/', $defLine, $f)) {
$warnings[] = $TestListener::warning('Invalid line in bootstrap.php: '.trim($defLine)); $warnings[] = $TestListener::warning('Invalid line in bootstrap.php: '.trim($defLine));
continue; continue;
} }
$testNamespace = substr($testClass, 0, strrpos($testClass, '\\')); $testNamespace = substr($testClass, 0, strrpos($testClass, '\\'));
if (function_exists($testNamespace.'\\'.$f['name'])) { if (\function_exists($testNamespace.'\\'.$f['name'])) {
continue; continue;
} }
...@@ -59,10 +76,12 @@ class TestListenerTrait ...@@ -59,10 +76,12 @@ class TestListenerTrait
if ($r->isUserDefined()) { if ($r->isUserDefined()) {
throw new \ReflectionException(); throw new \ReflectionException();
} }
if (false !== strpos($f['signature'], '&')) { if ('idn_to_ascii' === $f['name'] || 'idn_to_utf8' === $f['name']) {
$defLine = sprintf('return INTL_IDNA_VARIANT_2003 === $variant ? \\%s($domain, $options, $variant) : \\%1$s%s', $f['name'], $f['args']);
} elseif (false !== strpos($f['signature'], '&') && 'idn_to_ascii' !== $f['name'] && 'idn_to_utf8' !== $f['name']) {
$defLine = sprintf('return \\%s%s', $f['name'], $f['args']); $defLine = sprintf('return \\%s%s', $f['name'], $f['args']);
} else { } else {
$defLine = sprintf("return \\call_user_func_array('%s', func_get_args())", $f['name']); $defLine = sprintf("return \\call_user_func_array('%s', \\func_get_args())", $f['name']);
} }
} catch (\ReflectionException $e) { } catch (\ReflectionException $e) {
$defLine = sprintf("throw new \\{$SkippedTestError}('Internal function not found: %s')", $f['name']); $defLine = sprintf("throw new \\{$SkippedTestError}('Internal function not found: %s')", $f['name']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment