@@ 13-39 (lines=27) @@ | ||
10 | die( "\033[0;31mError: please enable register_argc_argv directive in php.ini\033[0m\n" ); |
|
11 | } |
|
12 | ||
13 | if ( function_exists ( 'ini_set' ) ) { |
|
14 | @ini_set ( 'display_errors', 1 ); |
|
15 | ||
16 | $memoryInBytes = function ( $value ) { |
|
17 | $unit = strtolower ( substr ( $value, -1, 1 ) ); |
|
18 | $value = (int) $value; |
|
19 | switch ( $unit ) { |
|
20 | case 'g': |
|
21 | $value *= 1024; |
|
22 | // no break (cumulative multiplier) |
|
23 | case 'm': |
|
24 | $value *= 1024; |
|
25 | // no break (cumulative multiplier) |
|
26 | case 'k': |
|
27 | $value *= 1024; |
|
28 | } |
|
29 | ||
30 | return $value; |
|
31 | }; |
|
32 | ||
33 | $memoryLimit = trim ( ini_get ( 'memory_limit' ) ); |
|
34 | // Increase memory_limit if it is lower than 1GB |
|
35 | if ( $memoryLimit != -1 && $memoryInBytes( $memoryLimit ) < 1024 * 1024 * 1024 ) { |
|
36 | @ini_set ( 'memory_limit', '1G' ); |
|
37 | } |
|
38 | unset( $memoryInBytes, $memoryLimit ); |
|
39 | } |
|
40 | ||
41 | \Phar::interceptFileFuncs (); |
|
42 |
@@ 20-50 (lines=31) @@ | ||
17 | } |
|
18 | ||
19 | ||
20 | if ( function_exists ( 'ini_set' ) ) |
|
21 | { |
|
22 | @ini_set ( 'display_errors' , 1 ); |
|
23 | ||
24 | $memoryInBytes = function ( $value ) |
|
25 | { |
|
26 | $unit = strtolower ( substr ( $value , - 1 , 1 ) ); |
|
27 | $value = (int) $value; |
|
28 | switch ( $unit ) |
|
29 | { |
|
30 | case 'g': |
|
31 | $value *= 1024; |
|
32 | // no break (cumulative multiplier) |
|
33 | case 'm': |
|
34 | $value *= 1024; |
|
35 | // no break (cumulative multiplier) |
|
36 | case 'k': |
|
37 | $value *= 1024; |
|
38 | } |
|
39 | ||
40 | return $value; |
|
41 | }; |
|
42 | ||
43 | $memoryLimit = trim ( ini_get ( 'memory_limit' ) ); |
|
44 | // Increase memory_limit if it is lower than 1GB |
|
45 | if ( $memoryLimit != - 1 && $memoryInBytes( $memoryLimit ) < 1024 * 1024 * 1024 ) |
|
46 | { |
|
47 | @ini_set ( 'memory_limit' , '1G' ); |
|
48 | } |
|
49 | unset( $memoryInBytes , $memoryLimit ); |
|
50 | } |
|
51 | ||
52 | set_include_path ( |
|
53 | implode ( |