public function init($configArrayOrPathToConfig)
    {
        $config = include(dirname(__DIR__).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'default.php');
        if (is_array($configArrayOrPathToConfig)) {
            $config = array_replace_recursive($config,$configArrayOrPathToConfig);
        }
        if (is_string($configArrayOrPathToConfig) && is_readable($configArrayOrPathToConfig)) {
            $config = array_replace_recursive($config,(array)include($configArrayOrPathToConfig));
        }
        $this->config = $config;
        $this->connect = new Connection();
        foreach ($this->config['connections'] as $connectionName=>$connectionConfig) {
            if (!isset($connectionConfig['type'])) continue;
            $method = 'set'.ucfirst($connectionConfig['type']);
            if (method_exists($this->connect,$method)) {
                $this->connect->$method($connectionName,$connectionConfig);
            }
        }
        $this->api = new Api();
        return $this;
    }