Esempio n. 1
0
 /**
  * Execute all servers
  *
  * @param Request $request
  */
 public function runAll(Request $request)
 {
     foreach ($this->options->getServers() as $name => $server) {
         $command = [];
         $command[] = 'php';
         $command[] = '-f';
         $command[] = escapeshellarg($request->getScriptName());
         $command[] = 'react';
         $command[] = 'start';
         $command[] = escapeshellarg($name);
         $command[] = '>/dev/null 2>/dev/null &';
         system(implode(" ", $command));
     }
 }
Esempio n. 2
0
 public function testCanConstructRequestAndGetParams()
 {
     $_SERVER['argv'] = array('foo.php', 'foo' => 'baz', 'bar');
     $_ENV["FOO_VAR"] = "bar";
     $request = new Request();
     $params = $request->getParams();
     $this->assertEquals(2, count($params));
     $this->assertEquals($params->toArray(), array('foo' => 'baz', 'bar'));
     $this->assertEquals($request->getParam('foo'), 'baz');
     $this->assertEquals($request->getScriptName(), 'foo.php');
     $this->assertEquals(1, count($request->env()));
     $this->assertEquals($request->env()->get('FOO_VAR'), 'bar');
     $this->assertEquals($request->getEnv('FOO_VAR'), 'bar');
 }