コード例 #1
0
 /**
  * Executed on failure
  *
  * @param OutputInterface $output
  * @param string          $region
  * @param int             $gameId
  * @param string          $encryptionKey
  * @param string          $replayFolderPath
  * @param \Exception      $exception
  *
  * @throws \Exception
  *
  * @return null|bool
  */
 public function onFailure(OutputInterface $output, $region, $gameId, $encryptionKey, $replayFolderPath, \Exception $exception)
 {
     $failureHandler = null;
     try {
         $failureHandler = Config::get('replay.command.handler.failure');
     } catch (ConfigurationKeyNotFoundException $e) {
         // Failure handler is not set
     }
     $throwException = true;
     if (null != $failureHandler) {
         $failureHandlerClass = new $failureHandler();
         if (!$failureHandlerClass instanceof FailureHandlerInterface) {
             throw new \InvalidArgumentException('The failure handler class ' . $failureHandler . ' should implement \\EloGank\\Component\\Handler\\FailureHandlerInterface');
         }
         $throwException = $failureHandlerClass->onFailure($output, $region, $gameId, $encryptionKey, $replayFolderPath, $exception);
     }
     if (Config::get('replay.command.exception.throw') && true === $throwException) {
         throw $exception;
     }
     $output->writeln('');
     $this->error($output, $exception->getMessage());
 }
コード例 #2
0
 /**
  * Executed on failure
  *
  * @param string     $region
  * @param int        $gameId
  * @param string     $encryptionKey
  * @param string     $replayFolderPath
  * @param \Exception $exception
  */
 public function onFailure($region, $gameId, $encryptionKey, $replayFolderPath, \Exception $exception)
 {
     $failureHandler = null;
     try {
         $failureHandler = Config::get('replay.command.handler.failure');
     } catch (ConfigurationKeyNotFoundException $e) {
         // Failure handler is not set
     }
     if (null != $failureHandler) {
         $failureHandlerClass = new $failureHandler();
         if (!$failureHandlerClass instanceof FailureHandlerInterface) {
             throw new \InvalidArgumentException('The failure handler class ' . $failureHandler . ' should implement \\EloGank\\Component\\Handler\\FailureHandlerInterface');
         }
         $failureHandlerClass->onFailure($region, $gameId, $encryptionKey, $replayFolderPath, $exception);
     }
 }
コード例 #3
0
 public function __construct()
 {
     $this->redisClient = new \Predis\Client(array('scheme' => Config::get('redis.scheme'), 'host' => Config::get('redis.host'), 'password' => Config::get('redis.password'), 'port' => Config::get('redis.port')));
     $connection = new \Domnikl\Statsd\Connection\UdpSocket(Config::get('statsd.host'), Config::get('statsd.port'));
     $this->statsdClient = new \Domnikl\Statsd\Client($connection, Config::get('statsd.namespace'));
 }