8000 [FrameworkBundle] removed support for HHVM built-in web server as it is deprecated now by fabpot · Pull Request #10786 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] removed support for HHVM built-in web server as it is deprecated now #10786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[FrameworkBundle] removed support for HHVM built-in web server as it …
…is deprecated now
  • Loading branch information
fabpot committed Apr 25, 2014
commit 7f7e2d8954aafb2d21ff45c4bc3e4b6bcca630a5
64 changes: 2 additions & 62 deletions src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ServerRunCommand extends ContainerAwareCommand
*/
public function isEnabled()
{
if (version_compare(phpversion(), '5.4.0', '<')) {
if (version_compare(phpversion(), '5.4.0', '<') || defined('HHVM_VERSION')) {
return false;
}

Expand Down Expand Up @@ -96,12 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
->locateResource(sprintf('@FrameworkBundle/Resources/config/router_%s.php', $env))
;

if (defined('HHVM_VERSION')) {
$builder = $this->createHhvmProcessBuilder($input, $output, $env);
} else {
$builder = $this->createPhpProcessBuilder($input, $output, $env);
}

$builder = $this->createPhpProcessBuilder($input, $output, $env);
$builder->setWorkingDirectory($input->getOption('docroot'));
$builder->setTimeout(null);
$builder->getProcess()->run(function ($type, $buffer) use ($output) {
Expand All @@ -121,59 +116,4 @@ private function createPhpProcessBuilder(InputInterface $input, OutputInterface

return new ProcessBuilder(array(PHP_BINARY, '-S', $input->getArgument('address'), $router));
}

private function createHhvmProcessBuilder(InputInterface $input, OutputInterface $output, $env)
{
list($ip, $port) = explode(':', $input->getArgument('address'));

$docroot = realpath($input->getOption('docroot'));
$bootstrap = 'prod' === $env ? 'app.php' : 'app_dev.php';
$config = <<<EOF
Server {
IP = $ip
Port = $port
SourceRoot = $docroot
RequestTimeoutSeconds = -1
RequestMemoryMaxBytes = -1
}

VirtualHost {
* {
Pattern = .*
RewriteRules {
* {
pattern = .?

# app bootstrap
to = $bootstrap

# append the original query string
qsa = true
}
}
}
}

StaticFile {
Extensions {
css = text/css
gif = image/gif
html = text/html
jpe = image/jpeg
jpeg = image/jpeg
jpg = image/jpeg
png = image/png
tif = image/tiff
tiff = image/tiff
txt = text/plain
php = text/plain
}
}
EOF;

$configFile = $this->getContainer()->get('kernel')->getCacheDir().'/hhvm-server-'.md5($config).'.hdf';
file_put_contents($configFile, $config);

return new ProcessBuilder(array(PHP_BINARY, '--mode', 'server', '--config', $configFile));
}
}
0