/** * (non-PHPDoc) * * @see \phpbu\App\Backup\Sync::setup() * @param array $config * @throws \phpbu\App\Backup\Sync\Exception */ public function setup(array $config) { if (!class_exists('\\Barracuda\\Copy\\API')) { throw new Exception('Copy api not loaded: use composer "barracuda/copy": "1.1.*" to install'); } if (!Arr::isSetAndNotEmptyString($config, 'app.key')) { throw new Exception('API access key is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'app.secret')) { throw new Exception('API access secret is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'user.key')) { throw new Exception('User access key is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'user.secret')) { throw new Exception('User access secret is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'path')) { throw new Exception('copy.com path is mandatory'); } $this->appKey = $config['app.key']; $this->appSecret = $config['app.secret']; $this->userKey = $config['user.key']; $this->userSecret = $config['user.secret']; $this->path = Str::withTrailingSlash(Str::replaceDatePlaceholders($config['path'])); }
/** * (non-PHPDoc) * * @see \phpbu\App\Backup\Sync::setup() * @param array $config * @throws \phpbu\App\Backup\Sync\Exception */ public function setup(array $config) { if (!class_exists('\\Mackey\\Yandex\\Client')) { throw new Exception('Yandex.Disk sdk not loaded: use composer to install "arhitector/yandex"'); } if (!Arr::isSetAndNotEmptyString($config, 'token')) { throw new Exception('API access token is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'path')) { throw new Exception('yandex.disk path is mandatory'); } $this->token = $config['token']; $this->path = Str::withTrailingSlash(Str::replaceDatePlaceholders($config['path'])); }
/** * (non-PHPDoc) * * @see \phpbu\App\Backup\Sync::setup() * @param array $config * @throws \phpbu\App\Backup\Sync\Exception */ public function setup(array $config) { if (!class_exists('\\Dropbox\\Client')) { throw new Exception('Dropbox sdk not loaded: use composer "dropbox/dropbox-sdk": "1.1.*" to install'); } if (!Arr::isSetAndNotEmptyString($config, 'token')) { throw new Exception('API access token is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'path')) { throw new Exception('dropbox path is mandatory'); } $this->token = $config['token']; $this->path = Str::withTrailingSlash(Str::replaceDatePlaceholders($config['path'])); }
/** * (non-PHPDoc) * * @see \phpbu\App\Backup\Sync::setup() * @param array $config * @throws \phpbu\App\Backup\Sync\Exception */ public function setup(array $config) { if (!class_exists('\\ObjectStorage')) { throw new Exception('SoftLayer SDK not loaded: use composer "softlayer/objectstorage": "dev-master" to install'); } if (!Arr::isSetAndNotEmptyString($config, 'user')) { throw new Exception('SoftLayer user is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'secret')) { throw new Exception('SoftLayer password is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'container')) { throw new Exception('SoftLayer container name is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'host')) { throw new Exception('SoftLayer host is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'path')) { throw new Exception('SoftLayer path is mandatory'); } $this->user = $config['user']; $this->secret = $config['secret']; $this->container = $config['container']; $this->host = $config['host']; $this->path = Str::withLeadingSlash(Str::withTrailingSlash(Str::replaceDatePlaceholders($config['path']))); }
/** * (non-PHPDoc) * * @see \phpbu\App\Backup\Sync::setup() * @param array $config * @throws \phpbu\App\Backup\Sync\Exception */ public function setup(array $config) { if (!class_exists('\\Aws\\S3\\S3Client')) { throw new Exception('Amazon SDK not loaded: use composer "aws/aws-sdk-php": "2.7.*" to install'); } if (!Arr::isSetAndNotEmptyString($config, 'key')) { throw new Exception('AWS key is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'secret')) { throw new Exception('AWS secret is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'bucket')) { throw new Exception('AWS S3 bucket name is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'region')) { throw new Exception('AWS S3 region is mandatory'); } if (!Arr::isSetAndNotEmptyString($config, 'path')) { throw new Exception('AWS S3 path / object-key is mandatory'); } $this->key = $config['key']; $this->secret = $config['secret']; $this->bucket = $config['bucket']; $this->region = $config['region']; $this->path = Str::withTrailingSlash(Str::replaceDatePlaceholders($config['path'])); $this->acl = Arr::getValue($config, 'acl', 'private'); }