getDriver())->putFile($this->getPath(), $file); } /** * get upload driver * * @author JaguarJack * @email njphper@gmail.com * @time 2020/1/25 * @return string */ protected function getDriver() { return $this->driver; } /** * set driver * * @author JaguarJack * @email njphper@gmail.com * @time 2020/1/25 * @param $driver * @throws \Exception * @return $this */ public function setDriver($driver) { if (!in_array($driver, [self::OSS, self::QCLOUD, self::QIQNIU, self::LOCAL])) { throw new \Exception(sprintf('Upload Driver [%s] Not Supported', $driver)); } $this->driver = $driver; return $this; } /** * * @author JaguarJack * @email njphper@gmail.com * @time 2020/1/25 * @return string */ protected function getPath() { return $this->path; } /** * * @author JaguarJack * @email njphper@gmail.com * @time 2020/1/25 * @param string $path * @return $this */ public function setPath(string $path) { $this->path = $path; return $this; } }