mirror of
https://github.com/restoreddev/phpapprentice.git
synced 2025-10-24 03:16:07 +02:00
Initial commit for public repo
This commit is contained in:
24
src/Command/BuildCommand.php
Normal file
24
src/Command/BuildCommand.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Apprentice\Command;
|
||||
|
||||
use Apprentice\Build;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class BuildCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('build')
|
||||
->setDescription('Builds PHP templates into HTML files.')
|
||||
->setHelp('Help!');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$build = new Build;
|
||||
$build->buildAll();
|
||||
}
|
||||
}
|
||||
23
src/Command/ServerCommand.php
Normal file
23
src/Command/ServerCommand.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Apprentice\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class ServerCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('server')
|
||||
->setDescription('Runs PHP server that automatically builds files')
|
||||
->setHelp('Help!');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$output->writeln('Starting development server on localhost:8080');
|
||||
system('php -S localhost:8080 -t docs src/util/router.php');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user