config = $config; $this->create(); } /** * @return Filesystem */ public function entity(): Filesystem { if (!$this->filesystem instanceof Filesystem) { $this->filesystem = new Filesystem($this->adapter); } return $this->filesystem; } /** * @param $baseInfo * @param $drive * @param $fullPath * @return mixed */ public function getUrl($baseInfo, $drive, $fullPath) { $baseInfo = $this->baseUrl($baseInfo, $fullPath); if ($drive != Attachment::DRIVE_LOCAL && !RegularHelper::verify('url', $baseInfo['url'])) { $baseInfo['url'] = 'http://' . $baseInfo['url']; } return $baseInfo; } /** * @param $baseInfo * @param $drive * @param $fullPath * @return mixed */ public function getDomainName($baseInfo, $drive, $fullPath) { $baseInfo = $this->domainName($baseInfo, $fullPath); if ($drive != Attachment::DRIVE_LOCAL && !RegularHelper::verify('url', $baseInfo['domain_name'])) { $baseInfo['domain_name'] = 'http://' . $baseInfo['domain_name']; } return $baseInfo; } /** * 返回路由 * * @param $baseInfo * @param $fullPath * @return $baseInfo */ abstract protected function baseUrl($baseInfo, $fullPath); /** * 返回域名 * * @param $baseInfo * @param $fullPath * @return $baseInfo */ abstract protected function domainName($baseInfo, $fullPath); /** * @return mixed */ abstract protected function create(); }