@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $fileName = ucfirst($input->getArgument('name')); |
| 86 | 86 | |
| 87 | - $path = APPPATH . 'models' . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
| 87 | + $path = APPPATH.'models'.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
| 88 | 88 | |
| 89 | 89 | $fileInformation = [ |
| 90 | 90 | 'name' => $fileName, |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if ($validator->fails()) { |
| 103 | 103 | $message = $validator->getMessage(); |
| 104 | 104 | |
| 105 | - return $output->writeln('<error>' . $message . '</error>'); |
|
| 105 | + return $output->writeln('<error>'.$message.'</error>'); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $data = [ |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | $result = $generator->generate(); |
| 118 | 118 | $model = $this->renderer->render('Model.template', $result); |
| 119 | - $message = 'The model "' . $fileName . '" has been created successfully!'; |
|
| 119 | + $message = 'The model "'.$fileName.'" has been created successfully!'; |
|
| 120 | 120 | |
| 121 | 121 | $file = fopen($path, 'wb'); |
| 122 | 122 | file_put_contents($path, $model); |
| 123 | 123 | fclose($file); |
| 124 | 124 | |
| 125 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 125 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 126 | 126 | } |
| 127 | 127 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $fileName = ucfirst(Inflector::plural($input->getArgument('name'))); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $path = APPPATH . 'controllers' . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
| 95 | + $path = APPPATH.'controllers'.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
| 96 | 96 | |
| 97 | 97 | $fileInformation = [ |
| 98 | 98 | 'name' => $fileName, |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($validator->fails()) { |
| 111 | 111 | $message = $validator->getMessage(); |
| 112 | 112 | |
| 113 | - return $output->writeln('<error>' . $message . '</error>'); |
|
| 113 | + return $output->writeln('<error>'.$message.'</error>'); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $data = [ |
@@ -125,12 +125,12 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $result = $generator->generate(); |
| 127 | 127 | $controller = $this->renderer->render('Controller.template', $result); |
| 128 | - $message = 'The controller "' . $fileName . '" has been created successfully!'; |
|
| 128 | + $message = 'The controller "'.$fileName.'" has been created successfully!'; |
|
| 129 | 129 | |
| 130 | 130 | $file = fopen($path, 'wb'); |
| 131 | 131 | file_put_contents($path, $controller); |
| 132 | 132 | fclose($file); |
| 133 | 133 | |
| 134 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 134 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 135 | 135 | } |
| 136 | 136 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | if ($validator->fails()) { |
| 87 | 87 | $message = $validator->getMessage(); |
| 88 | 88 | |
| 89 | - return $output->writeln('<error>' . $message . '</error>'); |
|
| 89 | + return $output->writeln('<error>'.$message.'</error>'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $data = [ |
@@ -106,26 +106,26 @@ discard block |
||
| 106 | 106 | 'show' => $this->renderer->render('Views/show.template', $result) |
| 107 | 107 | ]; |
| 108 | 108 | |
| 109 | - $filePath = APPPATH . 'views/' . $name; |
|
| 109 | + $filePath = APPPATH.'views/'.$name; |
|
| 110 | 110 | |
| 111 | - $file = fopen($filePath . '/create.php', 'wb'); |
|
| 112 | - file_put_contents($filePath . '/create.php', $results['create']); |
|
| 111 | + $file = fopen($filePath.'/create.php', 'wb'); |
|
| 112 | + file_put_contents($filePath.'/create.php', $results['create']); |
|
| 113 | 113 | fclose($file); |
| 114 | 114 | |
| 115 | - $file = fopen($filePath . '/edit.php', 'wb'); |
|
| 116 | - file_put_contents($filePath . '/edit.php', $results['edit']); |
|
| 115 | + $file = fopen($filePath.'/edit.php', 'wb'); |
|
| 116 | + file_put_contents($filePath.'/edit.php', $results['edit']); |
|
| 117 | 117 | fclose($file); |
| 118 | 118 | |
| 119 | - $file = fopen($filePath . '/index.php', 'wb'); |
|
| 120 | - file_put_contents($filePath . '/index.php', $results['index']); |
|
| 119 | + $file = fopen($filePath.'/index.php', 'wb'); |
|
| 120 | + file_put_contents($filePath.'/index.php', $results['index']); |
|
| 121 | 121 | fclose($file); |
| 122 | 122 | |
| 123 | - $file = fopen($filePath . '/show.php', 'wb'); |
|
| 124 | - file_put_contents($filePath . '/show.php', $results['show']); |
|
| 123 | + $file = fopen($filePath.'/show.php', 'wb'); |
|
| 124 | + file_put_contents($filePath.'/show.php', $results['show']); |
|
| 125 | 125 | fclose($file); |
| 126 | 126 | |
| 127 | - $message = 'The views folder "' . $name . '" has been created successfully!'; |
|
| 127 | + $message = 'The views folder "'.$name.'" has been created successfully!'; |
|
| 128 | 128 | |
| 129 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 129 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 130 | 130 | } |
| 131 | 131 | } |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | protected function configure() |
| 49 | 49 | { |
| 50 | 50 | $this |
| 51 | - ->setName('remove:' . $this->library) |
|
| 52 | - ->setDescription('Removes ' . ucfirst($this->library)); |
|
| 51 | + ->setName('remove:'.$this->library) |
|
| 52 | + ->setDescription('Removes '.ucfirst($this->library)); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -63,6 +63,6 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $message = Tools::removeLibrary($this->library); |
| 65 | 65 | |
| 66 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 66 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 67 | 67 | } |
| 68 | 68 | } |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function fails() |
| 65 | 65 | { |
| 66 | - $hasDoctrine = file_exists(APPPATH . 'libraries/Doctrine.php'); |
|
| 67 | - $hasWildfire = file_exists(APPPATH . 'libraries/Wildfire.php'); |
|
| 66 | + $hasDoctrine = file_exists(APPPATH.'libraries/Doctrine.php'); |
|
| 67 | + $hasWildfire = file_exists(APPPATH.'libraries/Wildfire.php'); |
|
| 68 | 68 | |
| 69 | 69 | if ( ! $hasWildfire && ! $hasDoctrine) { |
| 70 | 70 | $this->message = 'Please install Wildfire or Doctrine!'; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $name = $this->file['name']; |
| 83 | 83 | $type = $this->file['type']; |
| 84 | 84 | |
| 85 | - $this->message = 'The "' . $name . '" ' . $type . ' already exists!'; |
|
| 85 | + $this->message = 'The "'.$name.'" '.$type.' already exists!'; |
|
| 86 | 86 | |
| 87 | 87 | return true; |
| 88 | 88 | } |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function fails() |
| 39 | 39 | { |
| 40 | - $filePath = APPPATH . 'views/' . $this->name; |
|
| 40 | + $filePath = APPPATH.'views/'.$this->name; |
|
| 41 | 41 | |
| 42 | 42 | if ( ! @mkdir($filePath, 0775, true)) { |
| 43 | - $this->message = 'The "' . $this->name . '" views folder already exists!'; |
|
| 43 | + $this->message = 'The "'.$this->name.'" views folder already exists!'; |
|
| 44 | 44 | |
| 45 | 45 | return true; |
| 46 | 46 | } |
@@ -34,16 +34,16 @@ |
||
| 34 | 34 | { |
| 35 | 35 | $this->addLibrary('wildfire'); |
| 36 | 36 | |
| 37 | - $file = fopen(APPPATH . 'libraries/Wildfire.php', 'wb'); |
|
| 37 | + $file = fopen(APPPATH.'libraries/Wildfire.php', 'wb'); |
|
| 38 | 38 | $wildfire = $this->renderer->render('Libraries/Wildfire.template'); |
| 39 | 39 | |
| 40 | - file_put_contents(APPPATH . 'libraries/Wildfire.php', $wildfire); |
|
| 40 | + file_put_contents(APPPATH.'libraries/Wildfire.php', $wildfire); |
|
| 41 | 41 | fclose($file); |
| 42 | 42 | |
| 43 | 43 | Tools::ignite(); |
| 44 | 44 | |
| 45 | 45 | $message = 'Wildfire is now installed successfully!'; |
| 46 | 46 | |
| 47 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 47 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 48 | 48 | } |
| 49 | 49 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $library = ucfirst($this->library); |
| 37 | 37 | |
| 38 | - return ! file_exists(APPPATH . 'libraries/' . $library . '.php'); |
|
| 38 | + return ! file_exists(APPPATH.'libraries/'.$library.'.php'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | protected function configure() |
| 47 | 47 | { |
| 48 | 48 | $this |
| 49 | - ->setName('install:' . $this->library) |
|
| 50 | - ->setDescription('Installs ' . ucfirst($this->library)); |
|
| 49 | + ->setName('install:'.$this->library) |
|
| 50 | + ->setDescription('Installs '.ucfirst($this->library)); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | protected function addLibrary($library) |
| 60 | 60 | { |
| 61 | - $autoload = file_get_contents(APPPATH . 'config/autoload.php'); |
|
| 61 | + $autoload = file_get_contents(APPPATH.'config/autoload.php'); |
|
| 62 | 62 | $lines = explode(PHP_EOL, $autoload); |
| 63 | 63 | |
| 64 | 64 | $pattern = '/\$autoload\[\'libraries\'\] = array\((.*?)\)/'; |
@@ -67,17 +67,17 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $libraries = explode(', ', end($match[1])); |
| 69 | 69 | |
| 70 | - if ( ! in_array('\'' . $library . '\'', $libraries)) { |
|
| 71 | - array_push($libraries, '\'' . $library . '\''); |
|
| 70 | + if ( ! in_array('\''.$library.'\'', $libraries)) { |
|
| 71 | + array_push($libraries, '\''.$library.'\''); |
|
| 72 | 72 | |
| 73 | 73 | $libraries = array_filter($libraries); |
| 74 | 74 | |
| 75 | 75 | $pattern = '/\$autoload\[\'libraries\'\] = array\([^)]*\);/'; |
| 76 | - $replacement = '$autoload[\'libraries\'] = array(' . implode(', ', $libraries) . ');'; |
|
| 76 | + $replacement = '$autoload[\'libraries\'] = array('.implode(', ', $libraries).');'; |
|
| 77 | 77 | |
| 78 | 78 | $lines[60] = preg_replace($pattern, $replacement, $lines[60]); |
| 79 | 79 | |
| 80 | - file_put_contents(APPPATH . 'config/autoload.php', implode(PHP_EOL, $lines)); |
|
| 80 | + file_put_contents(APPPATH.'config/autoload.php', implode(PHP_EOL, $lines)); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | * library and creates a "proxies" directory for lazy loading. |
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | - file_put_contents(realpath('vendor') . '/bin/doctrine.php', $cli); |
|
| 46 | - file_put_contents(realpath('vendor') . '/doctrine/orm/bin/doctrine.php', $cli); |
|
| 45 | + file_put_contents(realpath('vendor').'/bin/doctrine.php', $cli); |
|
| 46 | + file_put_contents(realpath('vendor').'/doctrine/orm/bin/doctrine.php', $cli); |
|
| 47 | 47 | |
| 48 | - $file = fopen(APPPATH . 'libraries/Doctrine.php', 'wb'); |
|
| 49 | - file_put_contents(APPPATH . 'libraries/Doctrine.php', $library); |
|
| 48 | + $file = fopen(APPPATH.'libraries/Doctrine.php', 'wb'); |
|
| 49 | + file_put_contents(APPPATH.'libraries/Doctrine.php', $library); |
|
| 50 | 50 | fclose($file); |
| 51 | 51 | |
| 52 | 52 | $this->addLibrary('doctrine'); |
| 53 | 53 | |
| 54 | - if ( ! is_dir(APPPATH . 'models/proxies')) { |
|
| 55 | - mkdir(APPPATH . 'models/proxies'); |
|
| 56 | - chmod(APPPATH . 'models/proxies', 0777); |
|
| 54 | + if ( ! is_dir(APPPATH.'models/proxies')) { |
|
| 55 | + mkdir(APPPATH.'models/proxies'); |
|
| 56 | + chmod(APPPATH.'models/proxies', 0777); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /* |
@@ -61,14 +61,14 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | |
| 63 | 63 | $abstractCommand = file_get_contents( |
| 64 | - realpath('vendor') . '/' . |
|
| 64 | + realpath('vendor').'/'. |
|
| 65 | 65 | 'doctrine/orm/lib/Doctrine/'. |
| 66 | 66 | 'ORM/Tools/Console/Command/'. |
| 67 | 67 | 'SchemaTool/AbstractCommand.php' |
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | 70 | $search = 'use Doctrine\ORM\Tools\SchemaTool;'; |
| 71 | - $replace = $search . "\n" . 'include BASEPATH . \'core/Model.php\';'; |
|
| 71 | + $replace = $search."\n".'include BASEPATH . \'core/Model.php\';'; |
|
| 72 | 72 | |
| 73 | 73 | $contents = $abstractCommand; |
| 74 | 74 | $schemaTool = 'use Doctrine\ORM\Tools\SchemaTool;'; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | file_put_contents( |
| 84 | - realpath('vendor') . '/' . |
|
| 84 | + realpath('vendor').'/'. |
|
| 85 | 85 | 'doctrine/orm/lib/Doctrine/'. |
| 86 | 86 | 'ORM/Tools/Console/Command/'. |
| 87 | 87 | 'SchemaTool/AbstractCommand.php', |
@@ -92,6 +92,6 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $message = 'Doctrine ORM is now installed successfully!'; |
| 94 | 94 | |
| 95 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 95 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 96 | 96 | } |
| 97 | 97 | } |