Ejemplo n.º 1
0
 def stop_server_in_a_thread(self):
     print "Trying to close the PHP process on %s" % (
         self.program_php_server_thread.php_server_process.pid)
     if Compiler.is_linux() or Compiler.is_mac():
         os.killpg(self.program_php_server_thread.php_server_process.pid,
                   signal.SIGTERM)
     else:
         os.system('taskkill /f /im php.exe')
Ejemplo n.º 2
0
 def start_server(self):
     command = '{0} -S localhost:{1} -t {2}'.format(self.php_path,
                                                    self.port, self.webroot)
     if Compiler.is_linux() or Compiler.is_mac():
         self.php_server_process = subprocess.Popen(command,
                                                    stdout=subprocess.PIPE,
                                                    shell=True,
                                                    preexec_fn=os.setsid)
     elif Compiler.is_windows():
         self.php_server_process = subprocess.Popen(command,
                                                    stdout=subprocess.PIPE,
                                                    shell=True)
Ejemplo n.º 3
0
 def start_server(self):
     command = '{0} -S localhost:{1} -t {2}'.format(self.php_path, self.port, self.webroot)
     if Compiler.is_linux() or Compiler.is_mac():
         self.php_server_process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid)
     elif Compiler.is_windows():
         self.php_server_process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
Ejemplo n.º 4
0
 def stop_server_in_a_thread(self):
     print "Trying to close the PHP process on %s" % (self.program_php_server_thread.php_server_process.pid)
     if Compiler.is_linux() or Compiler.is_mac():
         os.killpg(self.program_php_server_thread.php_server_process.pid, signal.SIGTERM)
     else:
         os.system('taskkill /f /im php.exe')