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/app/Console/Command/ServeCommand.php

31 lines
661 B
PHP
Raw Normal View History

2016-02-19 22:49:00 +01:00
<?php
/**
* Holds the serve command controller.
2016-02-20 12:20:58 +01:00
*
2016-02-19 22:49:00 +01:00
* @package Sakura
*/
namespace Sakura\Console\Command;
use CLIFramework\Command;
class ServeCommand extends Command
{
public function brief()
{
return 'Sets up a local development server.';
}
public function execute()
{
2016-03-25 02:31:57 +01:00
$document_root = addslashes(ROOT . 'public/');
$router_proxy = addslashes(ROOT . 'server.php');
$php_dir = PHP_BINDIR;
2016-07-26 19:29:53 +02:00
$host = config('dev.host');
2016-03-25 02:31:57 +01:00
2016-07-30 15:48:09 +02:00
$this->getLogger()->writeln("Starting Sakura development server on {$host}.");
2016-03-25 02:31:57 +01:00
exec("{$php_dir}/php -S {$host} -t {$document_root} {$router_proxy}");
2016-02-19 22:49:00 +01:00
}
}