12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace qiniu\basic;
- abstract class BaseStorage
- {
-
- protected $error;
-
- protected function setError(?string $error = null)
- {
- $this->error = $error ?: '未知错误';
- return false;
- }
-
- public function getError()
- {
- $error = $this->error;
- $this->error = null;
- return $error;
- }
-
- protected $name;
-
- protected $configFile;
-
- public function __construct(string $name, array $config = [], string $configFile = null)
- {
- $this->name = $name;
- $this->configFile = $configFile;
- $this->initialize($config);
- }
-
- abstract protected function initialize(array $config);
- }
|