This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/libraries/Console/Command/ServeCommand.php
2016-03-25 02:31:57 +01:00

29 lines
602 B
PHP

<?php
/**
* Holds the serve command controller.
*
* @package Sakura
*/
namespace Sakura\Console\Command;
use CLIFramework\Command;
use Sakura\Config;
class ServeCommand extends Command
{
public function brief()
{
return 'Sets up a local development server.';
}
public function execute()
{
$document_root = addslashes(ROOT . 'public/');
$router_proxy = addslashes(ROOT . 'server.php');
$php_dir = PHP_BINDIR;
$host = Config::local('dev', 'host');
exec("{$php_dir}/php -S {$host} -t {$document_root} {$router_proxy}");
}
}