@@ -32,18 +32,18 @@ |
||
| 32 | 32 | 'robots' => 'robots.txt', |
| 33 | 33 | ]; |
| 34 | 34 | foreach ($files as $templates => $filename) { |
| 35 | - $text = \PSFS\base\Template::getInstance()->dump("generator/html/". $templates . '.html.twig'); |
|
| 36 | - if(false === file_put_contents($path . DIRECTORY_SEPARATOR . $filename, $text)) { |
|
| 37 | - $output->writeln('Can\t create the file ' . $filename); |
|
| 38 | - } else { |
|
| 39 | - $output->writeln($filename . ' created successfully'); |
|
| 35 | + $text = \PSFS\base\Template::getInstance()->dump("generator/html/".$templates.'.html.twig'); |
|
| 36 | + if (false === file_put_contents($path.DIRECTORY_SEPARATOR.$filename, $text)) { |
|
| 37 | + $output->writeln('Can\t create the file '.$filename); |
|
| 38 | + }else { |
|
| 39 | + $output->writeln($filename.' created successfully'); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | //Export base locale translations |
| 44 | - if(!file_exists(BASE_DIR.DIRECTORY_SEPARATOR.'locale')) { |
|
| 44 | + if (!file_exists(BASE_DIR.DIRECTORY_SEPARATOR.'locale')) { |
|
| 45 | 45 | \PSFS\base\config\Config::createDir(BASE_DIR.DIRECTORY_SEPARATOR.'locale'); |
| 46 | - \PSFS\Services\GeneratorService::copyr(SOURCE_DIR . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'locale', BASE_DIR . DIRECTORY_SEPARATOR . 'locale'); |
|
| 46 | + \PSFS\Services\GeneratorService::copyr(SOURCE_DIR.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'locale', BASE_DIR.DIRECTORY_SEPARATOR.'locale'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $output->writeln("Document root generado en ".$path); |
@@ -6,7 +6,9 @@ discard block |
||
| 6 | 6 | use Symfony\Component\Console\Input\InputInterface; |
| 7 | 7 | use Symfony\Component\Console\Output\OutputInterface; |
| 8 | 8 | |
| 9 | - if (!isset($console)) $console = new Application(); |
|
| 9 | + if (!isset($console)) { |
|
| 10 | + $console = new Application(); |
|
| 11 | + } |
|
| 10 | 12 | $console |
| 11 | 13 | ->register('psfs:create:root') |
| 12 | 14 | ->setDefinition(array( |
@@ -16,7 +18,9 @@ discard block |
||
| 16 | 18 | ->setCode(function(InputInterface $input, OutputInterface $output) { |
| 17 | 19 | // Creates the html path |
| 18 | 20 | $path = $input->getArgument('path'); |
| 19 | - if (empty($path)) $path = WEB_DIR; |
|
| 21 | + if (empty($path)) { |
|
| 22 | + $path = WEB_DIR; |
|
| 23 | + } |
|
| 20 | 24 | \PSFS\base\config\Config::createDir($path); |
| 21 | 25 | $paths = array("js", "css", "img", "media", "font"); |
| 22 | 26 | foreach ($paths as $htmlPath) { |