@@ -29,7 +29,7 @@ class ServerRunCommand extends ContainerAwareCommand
2929 */
3030 public function isEnabled ()
3131 {
32- if (version_compare (phpversion (), '5.4.0 ' , '< ' )) {
32+ if (version_compare (phpversion (), '5.4.0 ' , '< ' ) || defined ( ' HHVM_VERSION ' ) ) {
3333 return false ;
3434 }
3535
@@ -96,12 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9696 ->locateResource (sprintf ('@FrameworkBundle/Resources/config/router_%s.php ' , $ env ))
9797 ;
9898
99- if (defined ('HHVM_VERSION ' )) {
100- $ builder = $ this ->createHhvmProcessBuilder ($ input , $ output , $ env );
101- } else {
102- $ builder = $ this ->createPhpProcessBuilder ($ input , $ output , $ env );
103- }
104-
99+ $ builder = $ this ->createPhpProcessBuilder ($ input , $ output , $ env );
105100 $ builder ->setWorkingDirectory ($ input ->getOption ('docroot ' ));
106101 $ builder ->setTimeout (null );
107102 $ builder ->getProcess ()->run (function ($ type , $ buffer ) use ($ output ) {
@@ -121,59 +116,4 @@ private function createPhpProcessBuilder(InputInterface $input, OutputInterface
121116
122117 return new ProcessBuilder (array (PHP_BINARY , '-S ' , $ input ->getArgument ('address ' ), $ router ));
123118 }
124-
125- private function createHhvmProcessBuilder (InputInterface $ input , OutputInterface $ output , $ env )
126- {
127- list ($ ip , $ port ) = explode (': ' , $ input ->getArgument ('address ' ));
128-
129- $ docroot = realpath ($ input ->getOption ('docroot ' ));
130- $ bootstrap = 'prod ' === $ env ? 'app.php ' : 'app_dev.php ' ;
131- $ config = <<<EOF
132- Server {
133- IP = $ ip
134- Port = $ port
135- SourceRoot = $ docroot
136- RequestTimeoutSeconds = -1
137- RequestMemoryMaxBytes = -1
138- }
139-
140- VirtualHost {
141- * {
142- Pattern = .*
143- RewriteRules {
144- * {
145- pattern = .?
146-
147- # app bootstrap
148- to = $ bootstrap
149-
150- # append the original query string
151- qsa = true
152- }
153- }
154- }
155- }
156-
157- StaticFile {
158- Extensions {
159- css = text/css
160- gif = image/gif
161- html = text/html
162- jpe = image/jpeg
163- jpeg = image/jpeg
164- jpg = image/jpeg
165- png = image/png
166- tif = image/tiff
167- tiff = image/tiff
168- txt = text/plain
169- php = text/plain
170- }
171- }
172- EOF ;
173-
174- $ configFile = $ this ->getContainer ()->get ('kernel ' )->getCacheDir ().'/hhvm-server- ' .md5 ($ config ).'.hdf ' ;
175- file_put_contents ($ configFile , $ config );
176-
177- return new ProcessBuilder (array (PHP_BINARY , '--mode ' , 'server ' , '--config ' , $ configFile ));
178- }
179119}
0 commit comments