@@ -29,11 +29,11 @@ |
||
| 29 | 29 | 'robots' => 'robots.txt', |
| 30 | 30 | ]; |
| 31 | 31 | foreach ($files as $templates => $filename) { |
| 32 | - $text = \PSFS\base\Template::getInstance()->dump("generator/html/". $templates . '.html.twig'); |
|
| 33 | - if(false === file_put_contents($path . DIRECTORY_SEPARATOR . $filename, $text)) { |
|
| 34 | - $output->writeln('Can\t create the file ' . $filename); |
|
| 35 | - } else { |
|
| 36 | - $output->writeln($filename . ' created successfully'); |
|
| 32 | + $text = \PSFS\base\Template::getInstance()->dump("generator/html/".$templates.'.html.twig'); |
|
| 33 | + if (false === file_put_contents($path.DIRECTORY_SEPARATOR.$filename, $text)) { |
|
| 34 | + $output->writeln('Can\t create the file '.$filename); |
|
| 35 | + }else { |
|
| 36 | + $output->writeln($filename.' created successfully'); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | $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( |
@@ -15,7 +17,9 @@ discard block |
||
| 15 | 17 | ->setDescription('Comando de creación del Document Root del projecto') |
| 16 | 18 | ->setCode(function(InputInterface $input, OutputInterface $output) { |
| 17 | 19 | $path = $input->getArgument('path'); |
| 18 | - if (empty($path)) $path = BASE_DIR.DIRECTORY_SEPARATOR.'html'; |
|
| 20 | + if (empty($path)) { |
|
| 21 | + $path = BASE_DIR.DIRECTORY_SEPARATOR.'html'; |
|
| 22 | + } |
|
| 19 | 23 | \PSFS\base\config\Config::createDir($path); |
| 20 | 24 | $paths = array("js", "css", "img", "media", "font"); |
| 21 | 25 | foreach ($paths as $htmlPath) { |