1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add --use-ini-defaults arg to prevent Psalm overriding memory_limit and more

Fixes #842
This commit is contained in:
Matt Brown 2018-06-27 10:40:02 -04:00
parent 72b110af3f
commit 4a975883b4

View File

@ -7,9 +7,6 @@ use Psalm\IssueBuffer;
// show all errors
error_reporting(-1);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '4096M');
// get options from command line
$options = getopt(
@ -18,10 +15,16 @@ $options = getopt(
'help', 'debug', 'debug-by-line', 'config:', 'monochrome', 'show-info:', 'diff',
'output-format:', 'report:', 'find-dead-code', 'init',
'find-references-to:', 'root:', 'threads:', 'clear-cache', 'no-cache',
'version', 'plugin:', 'stats', 'show-snippet:',
'version', 'plugin:', 'stats', 'show-snippet:', 'use-ini-defaults',
]
);
if (!array_key_exists('use-ini-defaults', $options)) {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '4096M');
}
if (array_key_exists('help', $options)) {
$options['h'] = false;
}
@ -116,6 +119,9 @@ Options:
--stats
Shows a breakdown of Psalm's ability to infer types in the codebase
--use-ini-defaults
Use PHP-provided ini defaults for memory and error display
HELP;
exit;