Application\Cli::registerServices PHP Method

registerServices() public method

public registerServices ( )
    public function registerServices()
    {
        $self = $this;
        $this->_dependencyInjector->remove('url');
        $this->_dependencyInjector->configure = new Configure();
        $this->_dependencyInjector->set('db', function () use($self) {
            $mysql = new Mysql((array) $self->configure->database);
            $mysql->attachEvent('db:beforeQuery', function (DbInterface $source) use($self) {
                $self->logger->debug('SQL: ' . $source->getSQL());
            });
            return $mysql;
        });
        $this->_dependencyInjector->redis = function () {
            $redis = new \Redis();
            $redis->connect('localhost');
            return $redis;
        };
    }