Skip to content

Commit 200c0e3

Browse files
authored
Merge pull request naneau#35 from entrypass/memory-limit
Option to set runtime memory limit
2 parents 0f056da + e97f68c commit 200c0e3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Naneau/Obfuscator/Console/Command/ObfuscateCommand.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ protected function configure()
8181
null,
8282
InputOption::VALUE_REQUIRED,
8383
'Configuration file to use'
84+
)->addOption(
85+
'memory_limit',
86+
null,
87+
InputOption::VALUE_REQUIRED,
88+
'Runtime memory when running the obsfucator. ' .
89+
'Example: 128M ' .
90+
'See http://php.net/manual/en/ini.core.php#ini.memory-limit'
8491
);
8592

8693
$this->setContainer(new Container);
@@ -98,6 +105,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
98105
// Finalize the container
99106
$this->finalizeContainer($input);
100107

108+
// Change runtime memory
109+
if($memory = $input->getOption('memory_limit')) {
110+
ini_set("memory_limit", $memory);
111+
}
101112
// Input/output dirs
102113
$inputDirectory = $input->getArgument('input_directory');
103114
$outputDirectory = $input->getArgument('output_directory');

0 commit comments

Comments
 (0)