@@ -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( "\033[0;31mError: please enable short_open_tag directive in php.ini\033[0m\n" ); |
|
11 | + die("\033[0;31mError: please enable short_open_tag directive in php.ini\033[0m\n"); |
|
12 | 12 | } |
13 | 13 | |
14 | -if ( ! ini_get ( 'register_argc_argv' ) ) |
|
14 | +if ( ! ini_get('register_argc_argv')) |
|
15 | 15 | { |
16 | - die( "\033[0;31mError: please enable register_argc_argv directive in php.ini\033[0m\n" ); |
|
16 | + die("\033[0;31mError: please enable register_argc_argv directive in php.ini\033[0m\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,19 +65,19 @@ discard block |
||
65 | 65 | |
66 | 66 | try |
67 | 67 | { |
68 | - $arrValid = array ( |
|
69 | - 'version' , |
|
70 | - 'help' , |
|
71 | - 'status' , |
|
72 | - 'init' , |
|
73 | - 'config-env:' , |
|
74 | - 'name-ini:' , |
|
75 | - 'database:' , |
|
76 | - 'schema:' , |
|
77 | - 'driver:' , |
|
68 | + $arrValid = array( |
|
69 | + 'version', |
|
70 | + 'help', |
|
71 | + 'status', |
|
72 | + 'init', |
|
73 | + 'config-env:', |
|
74 | + 'name-ini:', |
|
75 | + 'database:', |
|
76 | + 'schema:', |
|
77 | + 'driver:', |
|
78 | 78 | 'tables:', |
79 | 79 | 'optional-classes:', |
80 | - 'framework:' , |
|
80 | + 'framework:', |
|
81 | 81 | 'path:', |
82 | 82 | 'clean-trash:', |
83 | 83 | 'update', |
@@ -85,18 +85,18 @@ discard block |
||
85 | 85 | ); |
86 | 86 | |
87 | 87 | $_path = __DIR__; |
88 | - $arg = getopt ( null , $arrValid ); |
|
89 | - if ( array_key_exists ( 'init' , $arg ) ) |
|
88 | + $arg = getopt(null, $arrValid); |
|
89 | + if (array_key_exists('init', $arg)) |
|
90 | 90 | { |
91 | - $maker = new \Classes\MakerConfigFile( $arg , $_path ); |
|
91 | + $maker = new \Classes\MakerConfigFile($arg, $_path); |
|
92 | 92 | } else |
93 | 93 | { |
94 | - $maker = new \Classes\MakerFile( new \Classes\Config( $arg , $_path, count($argv) ) ); |
|
94 | + $maker = new \Classes\MakerFile(new \Classes\Config($arg, $_path, count($argv))); |
|
95 | 95 | } |
96 | 96 | |
97 | - $maker->run (); |
|
97 | + $maker->run(); |
|
98 | 98 | |
99 | -} catch ( \Exception $e ) |
|
99 | +} catch (\Exception $e) |
|
100 | 100 | { |
101 | - die( $e->getMessage () ); |
|
101 | + die($e->getMessage()); |
|
102 | 102 | } |