8000 [FrameworkBundle] Add HHVM support for built-in web server by RickySu · Pull Request #10017 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Add HHVM support for built-in web server #10017

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
put hhvm config in app/cache
  • Loading branch information
RickySu committed Jan 14, 2014
commit 8aac1e26ce3e64852945be7fd89286e8c66e7c54
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,12 @@ protected function executeWithHHVM(InputInterface $input, OutputInterface $outpu
}
}
EOF;
$tmpfile = tempnam(sys_get_temp_dir(), 'symfony_hhvm_config');
$tmpfile = $this->getContainer()->get('kernel')->getCacheDir().DIRECTORY_SEPARATOR.'hhvm-server-'.md5($config).'.hdf';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DIRECTORY_SEPARATOR is not necessary for portability. Using / would be more readable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that this statement is true as of PHP 5.3 (but PHP 5.2 is not an issue anymore)

file_put_contents($tmpfile, $config);
$builder = new ProcessBuilder(array(PHP_BINARY, '-ms', "-c$tmpfile"));
$builder->setWorkingDirectory($docroot);
$builder->setTimeout(null);
$builder->getProcess()->run(function ($type, $buffer) use ($output, &$tmpfile) {
if (null !== $tmpfile) {
unlink($tmpfile);
$tmpfile = null;
}
$builder->getProcess()->run(function ($type, $buffer) use ($output) {
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$output->write($buffer);
}
Expand Down
0