Resque\Logger\Handler\Connector\MongoDBConnector::resolve PHP Method

resolve() public method

public resolve ( Command $command, Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, array $args )
$command Symfony\Component\Console\Command\Command
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
$args array
    public function resolve(Command $command, InputInterface $input, OutputInterface $output, array $args)
    {
        $mongodb = null;
        $dsn = strtr('mongodb://host:port', $args);
        $options = array();
        if (class_exists('MongoClient')) {
            $mongodb = new \MongoClient($dsn, $options);
        } elseif (class_exists('Mongo')) {
            $mongodb = new \Mongo($dsn, $options);
        }
        return new MongoDBHandler($mongodb, $this->replacePlaceholders($args['dbname']), $this->replacePlaceholders($args['collection']));
    }
MongoDBConnector