/** * Terminates PhantomJS process. */ public function phantomStop() { $Bootstrap = new GenericFile(sys_get_temp_dir() . DIRECTORY_SEPARATOR . md5('PhantomJS') . '.js'); // Close command $this->_sendJSON(array('action' => 'exit')); $this->_Process->close(); // Delete bootsrap usleep(250000); @unlink($Bootstrap); }