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, ''),
            ];
        }
    }