Changeset View
Changeset View
Standalone View
Standalone View
support/PhabricatorStartup.php
| Show First 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | /* -( Debug Time Limit )--------------------------------------------------- */ | ||||
| * @return void | * @return void | ||||
| */ | */ | ||||
| public static function setDebugTimeLimit($limit) { | public static function setDebugTimeLimit($limit) { | ||||
| self::$debugTimeLimit = $limit; | self::$debugTimeLimit = $limit; | ||||
| static $initialized; | static $initialized; | ||||
| if (!$initialized) { | if (!$initialized) { | ||||
| declare(ticks=1); | declare(ticks=1); | ||||
| register_tick_function(array('PhabricatorStartup', 'onDebugTick')); | register_tick_function(array(__CLASS__, 'onDebugTick')); | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * Callback tick function used by @{method:setDebugTimeLimit}. | * Callback tick function used by @{method:setDebugTimeLimit}. | ||||
| * | * | ||||
| * Fatals with a useful stack trace after the time limit expires. | * Fatals with a useful stack trace after the time limit expires. | ||||
| ▲ Show 20 Lines • Show All 375 Lines • ▼ Show 20 Lines | private static function detectPostMaxSizeTriggered() { | ||||
| if (!$length) { | if (!$length) { | ||||
| return; | return; | ||||
| } | } | ||||
| // Time to fatal: we know this was a POST with data that should have been | // Time to fatal: we know this was a POST with data that should have been | ||||
| // populated into $_POST, but it wasn't. | // populated into $_POST, but it wasn't. | ||||
| $config = ini_get('post_max_size'); | $config = ini_get('post_max_size'); | ||||
| PhabricatorStartup::didFatal( | self::didFatal( | ||||
| "As received by the server, this request had a nonzero content length ". | "As received by the server, this request had a nonzero content length ". | ||||
| "but no POST data.\n\n". | "but no POST data.\n\n". | ||||
| "Normally, this indicates that it exceeds the 'post_max_size' setting ". | "Normally, this indicates that it exceeds the 'post_max_size' setting ". | ||||
| "in the PHP configuration on the server. Increase the 'post_max_size' ". | "in the PHP configuration on the server. Increase the 'post_max_size' ". | ||||
| "setting or reduce the size of the request.\n\n". | "setting or reduce the size of the request.\n\n". | ||||
| "Request size according to 'Content-Length' was '{$length}', ". | "Request size according to 'Content-Length' was '{$length}', ". | ||||
| "'post_max_size' is set to '{$config}'."); | "'post_max_size' is set to '{$config}'."); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 227 Lines • Show Last 20 Lines | |||||