@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( !ini_get ( 'short_open_tag' ) ) { |
|
4 | - die( "please enable short_open_tag directive in php.ini\n" ); |
|
3 | +if ( ! ini_get('short_open_tag')) { |
|
4 | + die("please enable short_open_tag directive in php.ini\n"); |
|
5 | 5 | } |
6 | 6 | |
7 | -if ( !ini_get ( 'register_argc_argv' ) ) { |
|
8 | - die( "please enable register_argc_argv directive in php.ini\n" ); |
|
7 | +if ( ! ini_get('register_argc_argv')) { |
|
8 | + die("please enable register_argc_argv directive in php.ini\n"); |
|
9 | 9 | } |
10 | 10 | |
11 | -if ( function_exists ( 'ini_set' ) ) { |
|
12 | - @ini_set ( 'display_errors', 1 ); |
|
11 | +if (function_exists('ini_set')) { |
|
12 | + @ini_set('display_errors', 1); |
|
13 | 13 | |
14 | - $memoryInBytes = function ( $value ) { |
|
15 | - $unit = strtolower ( substr ( $value, -1, 1 ) ); |
|
14 | + $memoryInBytes = function($value) { |
|
15 | + $unit = strtolower(substr($value, -1, 1)); |
|
16 | 16 | $value = (int) $value; |
17 | - switch ( $unit ) { |
|
17 | + switch ($unit) { |
|
18 | 18 | case 'g': |
19 | 19 | $value *= 1024; |
20 | 20 | // no break (cumulative multiplier) |
@@ -28,22 +28,22 @@ discard block |
||
28 | 28 | return $value; |
29 | 29 | }; |
30 | 30 | |
31 | - $memoryLimit = trim ( ini_get ( 'memory_limit' ) ); |
|
31 | + $memoryLimit = trim(ini_get('memory_limit')); |
|
32 | 32 | // Increase memory_limit if it is lower than 1GB |
33 | - if ( $memoryLimit != -1 && $memoryInBytes( $memoryLimit ) < 1024 * 1024 * 1024 ) { |
|
34 | - @ini_set ( 'memory_limit', '1G' ); |
|
33 | + if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1024) { |
|
34 | + @ini_set('memory_limit', '1G'); |
|
35 | 35 | } |
36 | - unset( $memoryInBytes, $memoryLimit ); |
|
36 | + unset($memoryInBytes, $memoryLimit); |
|
37 | 37 | } |
38 | 38 | |
39 | -\Phar::interceptFileFuncs (); |
|
39 | +\Phar::interceptFileFuncs(); |
|
40 | 40 | |
41 | -set_include_path ( |
|
42 | - implode ( |
|
41 | +set_include_path( |
|
42 | + implode( |
|
43 | 43 | PATH_SEPARATOR, |
44 | - array ( |
|
45 | - realpath ( __DIR__ ), |
|
46 | - get_include_path (), |
|
44 | + array( |
|
45 | + realpath(__DIR__), |
|
46 | + get_include_path(), |
|
47 | 47 | ) |
48 | 48 | ) |
49 | 49 | ); |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | require_once 'Classes/MakerConfigFile.php'; |
54 | 54 | |
55 | 55 | try { |
56 | - $_path = realpath ( |
|
57 | - str_replace ( |
|
56 | + $_path = realpath( |
|
57 | + str_replace( |
|
58 | 58 | 'phar://', |
59 | 59 | '', |
60 | 60 | __DIR__ |
61 | 61 | ) |
62 | 62 | ); |
63 | 63 | |
64 | - $arrValid = array ( |
|
64 | + $arrValid = array( |
|
65 | 65 | 'version', |
66 | 66 | 'help', |
67 | 67 | 'status', |
@@ -76,18 +76,18 @@ discard block |
||
76 | 76 | 'path:' |
77 | 77 | ); |
78 | 78 | |
79 | - $arg = getopt ( null, $arrValid ); |
|
80 | - if ( array_key_exists ( 'init', $arg ) ) { |
|
81 | - $maker = new \Classes\MakerConfigFile( $arg, $_path ); |
|
79 | + $arg = getopt(null, $arrValid); |
|
80 | + if (array_key_exists('init', $arg)) { |
|
81 | + $maker = new \Classes\MakerConfigFile($arg, $_path); |
|
82 | 82 | } |
83 | 83 | else { |
84 | - $maker = new \Classes\MakerFile( new \Classes\Config( $arg, $_path, count ( $argv ) ) ); |
|
84 | + $maker = new \Classes\MakerFile(new \Classes\Config($arg, $_path, count($argv))); |
|
85 | 85 | } |
86 | 86 | |
87 | - $maker->run (); |
|
87 | + $maker->run(); |
|
88 | 88 | |
89 | -} catch ( \Exception $e ) { |
|
90 | - die( $e->getMessage () ); |
|
89 | +} catch (\Exception $e) { |
|
90 | + die($e->getMessage()); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | __halt_compiler(); |
94 | 94 | \ No newline at end of file |
@@ -79,8 +79,7 @@ |
||
79 | 79 | $arg = getopt ( null, $arrValid ); |
80 | 80 | if ( array_key_exists ( 'init', $arg ) ) { |
81 | 81 | $maker = new \Classes\MakerConfigFile( $arg, $_path ); |
82 | - } |
|
83 | - else { |
|
82 | + } else { |
|
84 | 83 | $maker = new \Classes\MakerFile( new \Classes\Config( $arg, $_path, count ( $argv ) ) ); |
85 | 84 | } |
86 | 85 |
@@ -6,26 +6,26 @@ discard block |
||
6 | 6 | * @author Pedro Alarcao <[email protected]> |
7 | 7 | */ |
8 | 8 | |
9 | -if ( ! ini_get ( 'short_open_tag' ) ) |
|
9 | +if ( ! ini_get('short_open_tag')) |
|
10 | 10 | { |
11 | - die( "please enable short_open_tag directive in php.ini\n" ); |
|
11 | + die("please enable short_open_tag directive in php.ini\n"); |
|
12 | 12 | } |
13 | 13 | |
14 | -if ( ! ini_get ( 'register_argc_argv' ) ) |
|
14 | +if ( ! ini_get('register_argc_argv')) |
|
15 | 15 | { |
16 | - die( "please enable register_argc_argv directive in php.ini\n" ); |
|
16 | + die("please enable register_argc_argv directive in php.ini\n"); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | |
20 | -if ( function_exists ( 'ini_set' ) ) |
|
20 | +if (function_exists('ini_set')) |
|
21 | 21 | { |
22 | - @ini_set ( 'display_errors' , 1 ); |
|
22 | + @ini_set('display_errors', 1); |
|
23 | 23 | |
24 | - $memoryInBytes = function ( $value ) |
|
24 | + $memoryInBytes = function($value) |
|
25 | 25 | { |
26 | - $unit = strtolower ( substr ( $value , - 1 , 1 ) ); |
|
26 | + $unit = strtolower(substr($value, - 1, 1)); |
|
27 | 27 | $value = (int) $value; |
28 | - switch ( $unit ) |
|
28 | + switch ($unit) |
|
29 | 29 | { |
30 | 30 | case 'g': |
31 | 31 | $value *= 1024; |
@@ -40,21 +40,21 @@ discard block |
||
40 | 40 | return $value; |
41 | 41 | }; |
42 | 42 | |
43 | - $memoryLimit = trim ( ini_get ( 'memory_limit' ) ); |
|
43 | + $memoryLimit = trim(ini_get('memory_limit')); |
|
44 | 44 | // Increase memory_limit if it is lower than 1GB |
45 | - if ( $memoryLimit != - 1 && $memoryInBytes( $memoryLimit ) < 1024 * 1024 * 1024 ) |
|
45 | + if ($memoryLimit != - 1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1024) |
|
46 | 46 | { |
47 | - @ini_set ( 'memory_limit' , '1G' ); |
|
47 | + @ini_set('memory_limit', '1G'); |
|
48 | 48 | } |
49 | - unset( $memoryInBytes , $memoryLimit ); |
|
49 | + unset($memoryInBytes, $memoryLimit); |
|
50 | 50 | } |
51 | 51 | |
52 | -set_include_path ( |
|
53 | - implode ( |
|
54 | - PATH_SEPARATOR , |
|
55 | - array ( |
|
56 | - realpath ( dirname ( __FILE__ ) . "/build/" ) , |
|
57 | - get_include_path () , |
|
52 | +set_include_path( |
|
53 | + implode( |
|
54 | + PATH_SEPARATOR, |
|
55 | + array( |
|
56 | + realpath(dirname(__FILE__) . "/build/"), |
|
57 | + get_include_path(), |
|
58 | 58 | ) |
59 | 59 | ) |
60 | 60 | ); |
@@ -65,34 +65,34 @@ discard block |
||
65 | 65 | |
66 | 66 | try |
67 | 67 | { |
68 | - $arrValid = array ( |
|
69 | - 'version' , |
|
70 | - 'help' , |
|
71 | - 'status' , |
|
72 | - 'init' , |
|
73 | - 'config-env:' , |
|
74 | - 'config-ini:' , |
|
75 | - 'database:' , |
|
76 | - 'schema:' , |
|
77 | - 'driver:' , |
|
68 | + $arrValid = array( |
|
69 | + 'version', |
|
70 | + 'help', |
|
71 | + 'status', |
|
72 | + 'init', |
|
73 | + 'config-env:', |
|
74 | + 'config-ini:', |
|
75 | + 'database:', |
|
76 | + 'schema:', |
|
77 | + 'driver:', |
|
78 | 78 | 'tables:', |
79 | - 'framework:' , |
|
79 | + 'framework:', |
|
80 | 80 | 'path:' |
81 | 81 | ); |
82 | 82 | |
83 | - $_path = realpath ( __FILE__ ); |
|
84 | - $arg = getopt ( null , $arrValid ); |
|
85 | - if ( array_key_exists ( 'init' , $arg ) ) |
|
83 | + $_path = realpath(__FILE__); |
|
84 | + $arg = getopt(null, $arrValid); |
|
85 | + if (array_key_exists('init', $arg)) |
|
86 | 86 | { |
87 | - $maker = new \Classes\MakerConfigFile( $arg , $_path ); |
|
87 | + $maker = new \Classes\MakerConfigFile($arg, $_path); |
|
88 | 88 | } else |
89 | 89 | { |
90 | - $maker = new \Classes\MakerFile( new \Classes\Config( $arg , $_path, count($argv) ) ); |
|
90 | + $maker = new \Classes\MakerFile(new \Classes\Config($arg, $_path, count($argv))); |
|
91 | 91 | } |
92 | 92 | |
93 | - $maker->run (); |
|
93 | + $maker->run(); |
|
94 | 94 | |
95 | -} catch ( \Exception $e ) |
|
95 | +} catch (\Exception $e) |
|
96 | 96 | { |
97 | - die( $e->getMessage () ); |
|
97 | + die($e->getMessage()); |
|
98 | 98 | } |