Extracts the Region and Bucket from the configs

@return \stdClass

@throws DriverException
324027
protected function getRegionAndBucket()
    {
        $aSpaces = json_decode($this->getSetting('buckets'), true);
        if (empty($aSpaces)) {
            throw new DriverException('S3 Buckets have not been defined.');
        } elseif (empty($aSpaces[Environment::get()])) {
            throw new DriverException('No bucket defined for the ' . Environment::get() . ' environment.');
        } else {
            $sRegionSpace = explode(':', $aSpaces[Environment::get()]);
            return (object) [
                'region' => getFromArray(0, $sRegionSpace, ''),
                'bucket' => getFromArray(1, $sRegionSpace, ''),
            ];
        }
    }
1098704
public static function configGetAll()
    {
		$data = self::getDbConnection()->fetchAll('SELECT * FROM config WHERE `class` = ?', array( get_called_class() ));
		$res = array();
		foreach ($data as $id => $v)
		{
			$res[$v['key']] = unserialize($v['value']);
		}
		return $res;
    }
237235
public function regionslist()
    {
        $id = $this->getRequest()->param("ID");
        $data = $this->getList($id)->map("Code", "Name")->toArray();

        return json_encode($data);
    }
733692
private function processOptions()
    {
        $options = $this->getOptions();

        if(empty($options)) {
            throw new \Exception('Options must be set');
        }

        if(!isset($options['bucket']) || empty($options['bucket'])) {
            throw new \Exception('Bucket name must be set for Couchbase driver');
        }

        foreach($options['servers'] as $server) {
            if(empty($server) || !is_string($server)) {
                continue;
            }
            $this->servers[] = $server;
        }
        $this->bucket       = $options['bucket'];
        $this->user         = isset($options['user'])       ? $options['user']              : '';
        $this->pass         = isset($options['pass'])       ? $options['pass']              : '';
        $this->persistent   = isset($options['persistent']) ? (bool) $options['persistent'] : false;
        $this->timeout      = isset($options['timeout'])    ? (int) $options['timeout']     : self::DEFAULT_TIMEOUT_VALUE;

        return $this;
    }
1094393
private function getRegionUrls()
    {
        $regionObject = new Regions();
        $this->mwsServiceUrls = $regionObject->mwsServiceUrls;
        $this->regionMappings = $regionObject->regionMappings;
        $this->profileEndpointUrls = $regionObject->profileEndpointUrls;
    }
863682
static private function getDriver() {
        if (self::$_driver != null) return self::$_driver;
        
        $driver = Utils::spare(Config::get('cache.driver'), 'file');

        switch (strtolower($driver)) {
            case 'memcached':
                self::$_driver = new \Lollipop\Cache\MemcachedAdapter();
                break;
                
            case 'file':
            default:
                self::$_driver = new \Lollipop\Cache\FileAdapter();
                break;
        }
        
        return self::$_driver;
    }
829810
public function getConfig()
    {
        if ($this->cache instanceof Cache\CacheInterface && !empty($configs = $this->cache->getConfig())) {
            return $configs;
        }

        $configs = $this->moduleHandler->getModulesConfig();
        foreach ($this->files as $file) {
            $config = require $file;
            if (!is_array($config)) {
                throw new Exception\RuntimeException(sprintf('The config in "%s" file must be array data type', $file));
            }
            $configs = ArrayUtils::merge($configs, require $file);
        }

        return $this->cleanUp($configs);
    }
76389
public function buckets() {
        if (!$this->id) {
            throw new Exception("The server has no ID, can\'t get buckets");
        }

        $bucket = new Bucket($this->patrol);

        $bucket->defaults([
            'server_id' => $this->id
        ]);

        return $bucket->all();
    }
1069837
public function getDefaultDriverClass()
    {
        $oDriver          = $this->getDefaultDriver();
        $sDriverNamespace = ArrayHelper::getFromArray('namespace', (array) $oDriver->data);
        $sDriverClass     = ArrayHelper::getFromArray('class', (array) $oDriver->data);
        return '\\' . $sDriverNamespace . $sDriverClass;
    }
878184
public function getRegion()
    {
        $region = $this->getRegionFromLocale($this->getLocale());
        if (!$region) {
            $region = $this->findRegion();
        }

        return $region;
    }
37964
public function getDriver()
    {
        // Attempt to retrieve the driver config
        $config = new Config($this->configDirectory);
        $driverClass = $config->getDriver();
        // Validate Driver Class
        $reflection = new ReflectionClass($driverClass);
        // Ensure class is built with the correct interface
        if (false === $reflection->implementsInterface('Signalert\Storage\DriverInterface')) {
            throw new SignalertResolverException;
        }
        // If it all checks out, resolve the class and instantiate
        return $reflection->newInstance();

    }
137623
public function getDrivers()
    {
        $drivers = array();

        $files = $this->finder->files()->in($this->driverPath)->name($this->fileTypes);

        foreach ($files as $file) {
            $driver = str_replace('.yml', '', $file->getRelativePathname());
            $service = $this->getService($driver);

            if ($service and $servers = $service->getServers()) {
                foreach ($servers as $server) {
                    $drivers[$driver . ':' . $server] = $driver . ':' . $server;
                }
            }
        }

        return $drivers;
    }
319447
public function getDriver(): string
    {
        // Extract driver name from current config
        $driver = $this->getConfig('driver');

        try {
            if (!\is_string($driver)) {
                throw new Exception('Wrong type of "driver" item in config, must be a string');
            }

            if (!\in_array($driver, self::ALLOWED_DRIVERS, false)) {
                $allowed = implode(',', self::ALLOWED_DRIVERS);
                throw new Exception("Driver \"$driver\" is not in allowed list [" . $allowed . ']');
            }
        } catch (Exception $e) {
            // __constructor
        }

        return __NAMESPACE__ . '\\Drivers\\' . ucfirst(strtolower($driver));
    }
908549
public function extract()
    {
        $array_recurse = function ($val) use (&$array_recurse) {
            if (is_scalar($val)) {
                return $val;
            }

            if (is_array($val)) {
                if (is_array(current($val)) || (is_object(current($val)) && current($val) instanceof FlexibleEntityInterface)) {
                    return array_map($array_recurse, $val);
                } else {
                    return $val;
                }
            }

            if (is_object($val) && $val instanceof FlexibleEntityInterface) {
                return $val->extract();
            }

            return $val;
        };


        return array_map($array_recurse, array_merge($this->container, $this->getCustomFields()));
    }
459060
private function getConfiguration()
    {
        return array_merge(
            [
                'fileMimeTypeField' => false,
                'fileNameField'     => false,
                'filePathField'     => false,
                'fileSizeField'     => false,
            ],
            $this->classMetadata->getExtension(UploadableDriver::EXTENSION_NAME),
            [
                'uploadable'        => true,
                'allowOverwrite'    => $this->allowOverwrite,
                'appendNumber'      => $this->appendNumber,
                'path'              => $this->path,
                'pathMethod'        => $this->pathMethod,
                'callback'          => $this->callback,
                'filenameGenerator' => $this->filenameGenerator,
                'maxSize'           => (float) $this->maxSize,
                'allowedTypes'      => $this->allowedTypes,
                'disallowedTypes'   => $this->disallowedTypes,
            ]
        );
    }
1073821
public function getCache()
    {
        if (null === self::$cache) {
            if (!empty($this->appConfig['cache']['driver'])) {
                // Options definition.
                if (empty($this->appConfig['cache']['options'])) {
                    $options = array();
                } else {
                    $options = $this->appConfig['cache']['options'];
                }

                // Driver definition.
                if ('memcached' !== $this->appConfig['cache']['driver']) {
                    $className = $this->appConfig['cache']['driver'];
                } else {
                    $className = '\Towel\Cache\TowelMemcached';
                }

                // Driver instantiation
                $cacheDriver = new $className();
                $cacheDriver->setOptions($options);
            }

            self::$cache = new TowelCache($cacheDriver);
        }

        return self::$cache;
    }
949816
private function getMetadataDriver()
    {
        if (null === $this->driver) {
            $metadataDirs = $this->getMetadataDirs();

            $annotationDriver = new AnnotationDriver($this->reader);
            if (!empty($metadataDirs)) {
                $fileLocator = new FileLocator($metadataDirs);
                $ymlDriver = new YamlDriver($fileLocator);
                $this->driver = new DriverChain(array(
                    $ymlDriver,
                    $annotationDriver,
                ));

                $ymlDriver->setDriver($this->driver);
            }
            else {
                $this->driver = $annotationDriver;
            }
        }

        return $this->driver;
    }