| @@ 128-132 (lines=5) @@ | ||
| 125 | */ |
|
| 126 | protected function validateConfig(array $config) |
|
| 127 | { |
|
| 128 | foreach (['key', 'secret', 'bucket', 'region', 'path'] as $option) { |
|
| 129 | if (!Arr::isSetAndNotEmptyString($config, $option)) { |
|
| 130 | throw new Exception('AWS S3 ' . $option . ' is mandatory'); |
|
| 131 | } |
|
| 132 | } |
|
| 133 | } |
|
| 134 | ||
| 135 | /** |
|
| @@ 75-79 (lines=5) @@ | ||
| 72 | throw new Exception('SoftLayer SDK not loaded: use composer to install "softlayer/objectstorage"'); |
|
| 73 | } |
|
| 74 | // check for mandatory options |
|
| 75 | foreach (['user', 'secret', 'container', 'host', 'path'] as $option) { |
|
| 76 | if (!Arr::isSetAndNotEmptyString($config, $option)) { |
|
| 77 | throw new Exception('SoftLayer ' . $option . ' is mandatory'); |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||
| 81 | $this->user = $config['user']; |
|
| 82 | $this->secret = $config['secret']; |
|