Tool.php 467 B

12345678910111213141516171819202122
  1. <?php namespace Upload\Lib;
  2. use Dever;
  3. class Tool
  4. {
  5. private $config = array
  6. (
  7. 1 => 'Local',
  8. 2 => 'Qiniu',
  9. 3 => 'Oss',
  10. );
  11. public function get($config)
  12. {
  13. $save = $this->config[$config['type']] ?? false;
  14. if (!$save) {
  15. Dever::error('存储位置错误');
  16. }
  17. $tool = 'Upload\\Lib\\Tool\\' . $save;
  18. $tool = new $tool($config);
  19. return $tool;
  20. }
  21. }