@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $field = strtolower($column->getField()); |
| 54 | - $method = 'set_' . $field; |
|
| 54 | + $method = 'set_'.$field; |
|
| 55 | 55 | |
| 56 | 56 | $this->data['camel'][$field] = lcfirst(camelize($method)); |
| 57 | 57 | $this->data['underscore'][$field] = underscore($method); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | 'field' => $field |
| 74 | 74 | ]; |
| 75 | 75 | |
| 76 | - if (! in_array($field, $columnFields)) { |
|
| 76 | + if ( ! in_array($field, $columnFields)) { |
|
| 77 | 77 | $field = $this->describe->getPrimaryKey($referencedTable); |
| 78 | 78 | |
| 79 | 79 | $dropdown['field'] = $field; |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public static function hasLayout() |
| 21 | 21 | { |
| 22 | - $header = APPPATH . 'views/layout/header.php'; |
|
| 23 | - $footer = APPPATH . 'views/layout/footer.php'; |
|
| 22 | + $header = APPPATH.'views/layout/header.php'; |
|
| 23 | + $footer = APPPATH.'views/layout/footer.php'; |
|
| 24 | 24 | |
| 25 | 25 | return file_exists($header) && file_exists($footer); |
| 26 | 26 | } |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | public static function ignite() |
| 34 | 34 | { |
| 35 | 35 | $autoloadPath = 'realpath(\'vendor\') . \'/autoload.php\''; |
| 36 | - $configPath = APPPATH . 'config'; |
|
| 37 | - $templatePath = __DIR__ . '/../Templates'; |
|
| 36 | + $configPath = APPPATH.'config'; |
|
| 37 | + $templatePath = __DIR__.'/../Templates'; |
|
| 38 | 38 | |
| 39 | 39 | // Gets data from application/config/config.php |
| 40 | 40 | $config = new Config('config', $configPath); |
@@ -52,16 +52,16 @@ discard block |
||
| 52 | 52 | $drivers = $autoload->get('drivers', 81, 'array'); |
| 53 | 53 | |
| 54 | 54 | // Includes "session" driver. |
| 55 | - if (! in_array('session', $drivers)) { |
|
| 55 | + if ( ! in_array('session', $drivers)) { |
|
| 56 | 56 | array_push($drivers, 'session'); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Gets the currently included helpers |
| 60 | - $defaultHelpers = [ 'form', 'url' ]; |
|
| 60 | + $defaultHelpers = ['form', 'url']; |
|
| 61 | 61 | $helpers = $autoload->get('helper', 91, 'array'); |
| 62 | 62 | |
| 63 | 63 | foreach ($defaultHelpers as $helper) { |
| 64 | - if (! in_array($helper, $helpers)) { |
|
| 64 | + if ( ! in_array($helper, $helpers)) { |
|
| 65 | 65 | array_push($helpers, $helper); |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -77,14 +77,14 @@ discard block |
||
| 77 | 77 | 'name' => 'Htaccess' |
| 78 | 78 | ], |
| 79 | 79 | [ |
| 80 | - 'file' => APPPATH . 'config/pagination.php', |
|
| 80 | + 'file' => APPPATH.'config/pagination.php', |
|
| 81 | 81 | 'name' => 'Pagination' |
| 82 | 82 | ] |
| 83 | 83 | ]; |
| 84 | 84 | |
| 85 | 85 | foreach ($templates as $template) { |
| 86 | 86 | $file = new File($template['file']); |
| 87 | - $path = $templatePath . '/' . $template['name'] . '.tpl'; |
|
| 87 | + $path = $templatePath.'/'.$template['name'].'.tpl'; |
|
| 88 | 88 | |
| 89 | 89 | if ($template['file'] == '.htaccess') { |
| 90 | 90 | $file->chmod(0777); |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public static function isCommandEnabled() |
| 104 | 104 | { |
| 105 | - $doctrine = APPPATH . 'libraries/Doctrine.php'; |
|
| 106 | - $wildfire = APPPATH . 'libraries/Wildfire.php'; |
|
| 105 | + $doctrine = APPPATH.'libraries/Doctrine.php'; |
|
| 106 | + $wildfire = APPPATH.'libraries/Wildfire.php'; |
|
| 107 | 107 | |
| 108 | 108 | return file_exists($doctrine) || file_exists($wildfire); |
| 109 | 109 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $library = ($this->library == 'doctrine') ? 'Wildfire' : 'Doctrine'; |
| 35 | 35 | |
| 36 | - return ! file_exists(APPPATH . 'libraries/' . $library . '.php'); |
|
| 36 | + return ! file_exists(APPPATH.'libraries/'.$library.'.php'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | protected function configure() |
| 45 | 45 | { |
| 46 | 46 | $this |
| 47 | - ->setName('install:' . $this->library) |
|
| 48 | - ->setDescription('Installs ' . ucfirst($this->library)); |
|
| 47 | + ->setName('install:'.$this->library) |
|
| 48 | + ->setDescription('Installs '.ucfirst($this->library)); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function addLibrary($library) |
| 58 | 58 | { |
| 59 | - $autoload = new Config('autoload', APPPATH . 'config'); |
|
| 59 | + $autoload = new Config('autoload', APPPATH.'config'); |
|
| 60 | 60 | |
| 61 | 61 | $libraries = $autoload->get('libraries', 60, 'array'); |
| 62 | 62 | |
| 63 | - if (! in_array($library, $libraries)) { |
|
| 63 | + if ( ! in_array($library, $libraries)) { |
|
| 64 | 64 | array_push($libraries, $library); |
| 65 | 65 | |
| 66 | 66 | $autoload->set('libraries', 60, $libraries, 'array'); |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function fails() |
| 51 | 51 | { |
| 52 | - $hasDoctrine = file_exists(APPPATH . 'libraries/Doctrine.php'); |
|
| 53 | - $hasWildfire = file_exists(APPPATH . 'libraries/Wildfire.php'); |
|
| 52 | + $hasDoctrine = file_exists(APPPATH.'libraries/Doctrine.php'); |
|
| 53 | + $hasWildfire = file_exists(APPPATH.'libraries/Wildfire.php'); |
|
| 54 | 54 | |
| 55 | - if (! $hasWildfire && ! $hasDoctrine) { |
|
| 55 | + if ( ! $hasWildfire && ! $hasDoctrine) { |
|
| 56 | 56 | $this->message = 'Please install Wildfire or Doctrine!'; |
| 57 | 57 | |
| 58 | 58 | return true; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $name = $this->file['name']; |
| 75 | 75 | $type = $this->file['type']; |
| 76 | 76 | |
| 77 | - $this->message = 'The "' . $name . '" ' . $type . ' already exists!'; |
|
| 77 | + $this->message = 'The "'.$name.'" '.$type.' already exists!'; |
|
| 78 | 78 | |
| 79 | 79 | return true; |
| 80 | 80 | } |
@@ -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 | - if (! @mkdir($filePath, 0775, true)) { |
|
| 43 | - $this->message = 'The "' . $this->name . '" views folder already exists!'; |
|
| 42 | + if ( ! @mkdir($filePath, 0775, true)) { |
|
| 43 | + $this->message = 'The "'.$this->name.'" views folder already exists!'; |
|
| 44 | 44 | |
| 45 | 45 | return true; |
| 46 | 46 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function execute(InputInterface $input, OutputInterface $output) |
| 58 | 58 | { |
| 59 | - $layoutPath = APPPATH . 'views/layout'; |
|
| 59 | + $layoutPath = APPPATH.'views/layout'; |
|
| 60 | 60 | |
| 61 | 61 | $data = []; |
| 62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $css = '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css'; |
| 68 | 68 | |
| 69 | - if (! is_dir('bower_components/font-awesome') && system('bower install font-awesome')) { |
|
| 69 | + if ( ! is_dir('bower_components/font-awesome') && system('bower install font-awesome')) { |
|
| 70 | 70 | $css = '<?php echo base_url(\'bower_components/font-awesome/css/font-awesome.min.css\'); ?>'; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $js = 'https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.js'; |
| 80 | 80 | $jquery = 'https://code.jquery.com/jquery-2.1.1.min.js'; |
| 81 | 81 | |
| 82 | - if (! is_dir('bower_components/bootstrap') && system('bower install bootstrap')) { |
|
| 82 | + if ( ! is_dir('bower_components/bootstrap') && system('bower install bootstrap')) { |
|
| 83 | 83 | $css = '<?php echo base_url(\'bower_components/bootstrap/dist/css/bootstrap.min.css\'); ?>'; |
| 84 | 84 | $js = '<?php echo base_url(\'bower_components/bootstrap/dist/js/bootstrap.min.js\'); ?>'; |
| 85 | 85 | $jquery = '<?php echo base_url(\'bower_components/jquery/dist/jquery.min.js\'); ?>'; |
@@ -90,17 +90,17 @@ discard block |
||
| 90 | 90 | array_push($data['scripts'], $js); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if (! @mkdir($layoutPath, 0777, true)) { |
|
| 93 | + if ( ! @mkdir($layoutPath, 0777, true)) { |
|
| 94 | 94 | $message = 'The layout directory already exists!'; |
| 95 | 95 | |
| 96 | - return $output->writeln('<error>' . $message . '</error>'); |
|
| 96 | + return $output->writeln('<error>'.$message.'</error>'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $header = $this->renderer->render('Views/Layout/header.tpl', $data); |
| 100 | 100 | $footer = $this->renderer->render('Views/Layout/footer.tpl', $data); |
| 101 | 101 | |
| 102 | - $headerFile = new File($layoutPath . '/header.php'); |
|
| 103 | - $footerFile = new File($layoutPath . '/footer.php'); |
|
| 102 | + $headerFile = new File($layoutPath.'/header.php'); |
|
| 103 | + $footerFile = new File($layoutPath.'/footer.php'); |
|
| 104 | 104 | |
| 105 | 105 | $headerFile->putContents($header); |
| 106 | 106 | $footerFile->putContents($footer); |
@@ -110,6 +110,6 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $message = 'The layout folder has been created successfully!'; |
| 112 | 112 | |
| 113 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 113 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 114 | 114 | } |
| 115 | 115 | } |
@@ -36,33 +36,33 @@ discard block |
||
| 36 | 36 | system('composer require doctrine/orm'); |
| 37 | 37 | |
| 38 | 38 | $cli = $this->renderer->render('DoctrineCLI.tpl'); |
| 39 | - $doctrine = new File(APPPATH . 'libraries/Doctrine.php'); |
|
| 39 | + $doctrine = new File(APPPATH.'libraries/Doctrine.php'); |
|
| 40 | 40 | $template = $this->renderer->render('Libraries/Doctrine.tpl'); |
| 41 | 41 | $vendor = realpath('vendor'); |
| 42 | 42 | |
| 43 | 43 | // Modifies the contents of vendor/bin/doctrine.php, creates the |
| 44 | 44 | // Doctrine library and creates a "proxies" directory for lazy loading. |
| 45 | - file_put_contents($vendor . '/bin/doctrine.php', $cli); |
|
| 46 | - file_put_contents($vendor . '/doctrine/orm/bin/doctrine.php', $cli); |
|
| 45 | + file_put_contents($vendor.'/bin/doctrine.php', $cli); |
|
| 46 | + file_put_contents($vendor.'/doctrine/orm/bin/doctrine.php', $cli); |
|
| 47 | 47 | |
| 48 | 48 | $doctrine->putContents($template); |
| 49 | 49 | $doctrine->close(); |
| 50 | 50 | |
| 51 | 51 | $this->addLibrary('doctrine'); |
| 52 | 52 | |
| 53 | - if (! is_dir(APPPATH . 'models/proxies')) { |
|
| 54 | - mkdir(APPPATH . 'models/proxies'); |
|
| 55 | - chmod(APPPATH . 'models/proxies', 0777); |
|
| 53 | + if ( ! is_dir(APPPATH.'models/proxies')) { |
|
| 54 | + mkdir(APPPATH.'models/proxies'); |
|
| 55 | + chmod(APPPATH.'models/proxies', 0777); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $abstractCommandPath = $vendor . '/doctrine/orm/lib/Doctrine/ORM/' . |
|
| 58 | + $abstractCommandPath = $vendor.'/doctrine/orm/lib/Doctrine/ORM/'. |
|
| 59 | 59 | 'Tools/Console/Command/SchemaTool/AbstractCommand.php'; |
| 60 | 60 | |
| 61 | 61 | // Includes the Base Model class in Doctrine CLI |
| 62 | 62 | $abstractCommand = file_get_contents($abstractCommandPath); |
| 63 | 63 | |
| 64 | 64 | $search = 'use Doctrine\ORM\Tools\SchemaTool;'; |
| 65 | - $replace = $search . "\n" . 'include BASEPATH . \'core/Model.php\';'; |
|
| 65 | + $replace = $search."\n".'include BASEPATH . \'core/Model.php\';'; |
|
| 66 | 66 | |
| 67 | 67 | $contents = $abstractCommand; |
| 68 | 68 | $schemaTool = 'use Doctrine\ORM\Tools\SchemaTool;'; |
@@ -80,6 +80,6 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $message = 'Doctrine ORM is now installed successfully!'; |
| 82 | 82 | |
| 83 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 83 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 84 | 84 | } |
| 85 | 85 | } |