Files
panchengyong c1e74d8e68 chore(php): 统一 ScottPan 文件头与注释域名替换
- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明

Made-with: Cursor
2026-03-29 11:22:58 +08:00

57 lines
1.5 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | Author: ScottPan Team
// +----------------------------------------------------------------------
namespace crmeb\services\express;
use crmeb\basic\BaseManager;
use crmeb\services\AccessTokenServeService;
use think\Container;
use think\facade\Config;
/**
* Class Express
* @package crmeb\services\express
* @mixin \crmeb\services\express\storage\Express
*/
class Express extends BaseManager
{
/**
* 空间名
* @var string
*/
protected string $namespace = '\\crmeb\\services\\express\\storage\\';
/**
* 默认驱动
* @return mixed
*/
protected function getDefaultDriver()
{
return Config::get('express.default', 'express');
}
/**
* 获取类的实例
* @param $class
* @return mixed|void
*/
protected function invokeClass($class)
{
if (!class_exists($class)) {
throw new \RuntimeException('class not exists: ' . $class);
}
$this->getConfigFile();
if (!$this->config) {
$this->config = Config::get($this->configFile . '.stores.' . $this->name, []);
}
$handleAccessToken = new AccessTokenServeService($this->config['access_key'] ?? '', $this->config['secret_key'] ?? '', app()->cache);
$handle = Container::getInstance()->invokeClass($class, [$this->name, $handleAccessToken, $this->configFile]);
$this->config = [];
return $handle;
}
}