Вход Регистрация
Файл: gapps/vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php
Строк: 87
<?php

namespace IlluminateFoundationConsole;

use 
Exception;
use 
IlluminateConsoleCommand;
use 
SymfonyComponentProcessProcessUtils;
use 
SymfonyComponentConsoleInputInputOption;
use 
SymfonyComponentProcessPhpExecutableFinder;

class 
ServeCommand extends Command
{
    
/**
     * The console command name.
     *
     * @var string
     */
    
protected $name 'serve';

    
/**
     * The console command description.
     *
     * @var string
     */
    
protected $description 'Serve the application on the PHP development server';

    
/**
     * Execute the console command.
     *
     * @return void
     *
     * @throws Exception
     */
    
public function fire()
    {
        
chdir($this->laravel->publicPath());

        
$host $this->input->getOption('host');

        
$port $this->input->getOption('port');

        
$base ProcessUtils::escapeArgument($this->laravel->basePath());

        
$binary ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));

        
$this->info("Laravel development server started on http://{$host}:{$port}/");

        if (
defined('HHVM_VERSION')) {
            if (
version_compare(HHVM_VERSION'3.8.0') >= 0) {
                
passthru("{$binary} -m server -v Server.Type=proxygen -v Server.SourceRoot={$base}/ -v Server.IP={$host} -v Server.Port={$port} -v Server.DefaultDocument=server.php -v Server.ErrorDocument404=server.php");
            } else {
                throw new 
Exception("HHVM's built-in server requires HHVM >= 3.8.0.");
            }
        } else {
            
passthru("{$binary} -S {$host}:{$port} {$base}/server.php");
        }
    }

    
/**
     * Get the console command options.
     *
     * @return array
     */
    
protected function getOptions()
    {
        return [
            [
'host'nullInputOption::VALUE_OPTIONAL'The host address to serve the application on.''localhost'],

            [
'port'nullInputOption::VALUE_OPTIONAL'The port to serve the application on.'8000],
        ];
    }
}
Онлайн: 1
Реклама