@@ -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:' , |
|
78 | - 'framework:' , |
|
68 | + $arrValid = array( |
|
69 | + 'version', |
|
70 | + 'help', |
|
71 | + 'status', |
|
72 | + 'init', |
|
73 | + 'config-env:', |
|
74 | + 'config-ini:', |
|
75 | + 'database:', |
|
76 | + 'schema:', |
|
77 | + 'driver:', |
|
78 | + 'framework:', |
|
79 | 79 | 'path:' |
80 | 80 | ); |
81 | 81 | |
82 | - $_path = realpath ( __FILE__ ); |
|
83 | - $argv = getopt ( null , $arrValid ); |
|
82 | + $_path = realpath(__FILE__); |
|
83 | + $argv = getopt(null, $arrValid); |
|
84 | 84 | |
85 | - if ( array_key_exists ( 'init' , $argv ) ) |
|
85 | + if (array_key_exists('init', $argv)) |
|
86 | 86 | { |
87 | - $maker = new \Classes\MakerConfigFile( $argv , $_path ); |
|
87 | + $maker = new \Classes\MakerConfigFile($argv, $_path); |
|
88 | 88 | } else |
89 | 89 | { |
90 | - $maker = new \Classes\MakerFile( new \Classes\Config( $argv , $_path ) ); |
|
90 | + $maker = new \Classes\MakerFile(new \Classes\Config($argv, $_path)); |
|
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 | } |