Exemplo n.º 1
0
 public function __construct($config, $options)
 {
     parent::__construct($config, $options);
     // Set default path for PhantomJS to "vendor/bin/phantomjs" for if it was installed via composer
     if (!isset($this->config['path'])) {
         $this->config['path'] = "vendor/bin/phantomjs";
     }
     // If a directory was provided for the path, use old method of appending PhantomJS
     if (is_dir(realpath($this->config['path']))) {
         // Show warning that this is being deprecated
         $this->writeln("\r\n");
         $this->writeln("WARNING: The PhantomJS path for Phantoman is set to a directory, this is being deprecated in the future. Please update your Phantoman configuration to be the full path to PhantomJS.");
         $this->config['path'] .= '/phantomjs';
     }
     // Add .exe extension if running on the windows
     if ($this->isWindows() && file_exists(realpath($this->config['path'] . '.exe'))) {
         $this->config['path'] .= '.exe';
     }
     // Set default WebDriver port
     if (!isset($this->config['port'])) {
         $this->config['port'] = 4444;
     }
     // Set default debug mode
     if (!isset($this->config['debug'])) {
         $this->config['debug'] = false;
     }
     $this->startServer();
     $resource = $this->resource;
     register_shutdown_function(function () use($resource) {
         if (is_resource($resource)) {
             proc_terminate($resource);
         }
     });
 }
Exemplo n.º 2
0
 /**
  * @param array $config
  * @param array $options
  */
 public function __construct($config, $options)
 {
     parent::__construct($config, $options);
     if (isset($config['warningTimeLimit']) && $config['warningTimeLimit'] > 0) {
         $this->warningTimeLimit = (double) $config['warningTimeLimit'];
     }
     if (isset($config['errorTimeLimit']) && $config['errorTimeLimit'] > 0) {
         $this->errorTimeLimit = (double) $config['errorTimeLimit'];
     }
 }
 /**
  * Class constructor.
  *
  * @param array              $config
  * @param array              $options
  * @param WireMockDownloader $downloader       optional WireMockDownloader object
  * @param WireMockProcess    $process          optional WireMockProcess object
  * @param WireMockArguments  $argumentsManager optional WireMockArguments object
  */
 public function __construct(array $config, array $options, WireMockDownloader $downloader = null, WireMockProcess $process = null, WireMockArguments $argumentsManager = null)
 {
     parent::__construct($config, $options);
     $this->initWireMockDownloader($downloader);
     $this->initWireMockProcess($process);
     $this->initWireMockArgumentsManager($argumentsManager);
     $this->config = $this->argumentsManager->sanitize($this->config);
     echo "Starting local wiremock" . PHP_EOL;
     $this->process->start($this->getJarPath(), $this->config['logs-path'], $this->mapConfigToWireMockArguments($this->config));
     sleep($this->config['start-delay']);
 }
 public function __construct($config, $options)
 {
     if (version_compare(PHP_VERSION, '5.4', '<')) {
         throw new ExtensionException($this, 'Requires PHP built-in web server, available since PHP 5.4.0.');
     }
     parent::__construct($config, $options);
     $this->orgConfig = $config;
     $this->validateConfig();
     if (!array_key_exists('startDelay', $this->config) || !(is_int($this->config['startDelay']) || ctype_digit($this->config['startDelay']))) {
         $this->config['startDelay'] = 1;
     }
 }
 public function __construct($config, $options)
 {
     if (version_compare(PHP_VERSION, '5.4', '<')) {
         throw new ExtensionException($this, 'Requires PHP built-in web server, available since PHP 5.4.0.');
     }
     parent::__construct($config, $options);
     $this->validateConfig();
     if (!array_key_exists('startDelay', $this->config) || !(is_int($this->config['startDelay']) || ctype_digit($this->config['startDelay']))) {
         $this->config['startDelay'] = 1;
     }
     $this->startServer();
     $resource = $this->resource;
     register_shutdown_function(function () use($resource) {
         if (is_resource($resource)) {
             proc_terminate($resource);
         }
     });
 }
Exemplo n.º 6
0
 public function __construct($config, $options)
 {
     parent::__construct($config, $options);
     // Set default path for PhantomJS to "vendor/bin" for if it was installed via composer
     if (!isset($this->config['path'])) {
         $this->config['path'] = "vendor/bin";
     }
     // Set default WebDriver port
     if (!isset($this->config['port'])) {
         $this->config['port'] = 4444;
     }
     $this->startServer();
     $resource = $this->resource;
     register_shutdown_function(function () use($resource) {
         if (is_resource($resource)) {
             proc_terminate($resource);
         }
     });
 }
 /**
  *  Construct a DrushRunserver instance.
  */
 public function __construct($config, $options)
 {
     // ToDo: Add in a config option to allow people to override this should they wish to try playing with PHP 5.3/CGI.
     if (version_compare(PHP_VERSION, '5.4', '<')) {
         throw new ExtensionException($this, 'Requires PHP 5.4 or above.');
     }
     parent::__construct($config, $options);
     // Allow a configurable path to Drush in case it's not installed system-wide.
     if (isset($this->config['drushBinary']) && !is_null($this->config['drushBinary'])) {
         $this->drushBinary = $this->config['drushBinary'];
     }
     // Get the sleep timeout from the config if it's available.
     $this->sleep = isset($this->config['sleep']) ? $this->config['sleep'] : 2;
     $this->startServer();
     $resource = $this->resource;
     register_shutdown_function(function () use($resource) {
         if (is_resource($resource)) {
             proc_terminate($resource);
         }
     });
 }
Exemplo n.º 8
0
 public function __construct($config, $options)
 {
     parent::__construct($config, $options);
     $this->propelLoadApplication();
     $this->propelOutput = new ConsoleOutput(ConsoleOutput::VERBOSITY_DEBUG);
 }
 public function __construct($config, $options)
 {
     parent::__construct($config, $options);
 }
Exemplo n.º 10
0
 public function __construct(array $config, array $options)
 {
     parent::__construct(array_merge($this->defaults, $config), $options);
     $this->diManager = new DependencyInjectionService();
     $this->startHttpMock();
 }