public function __construct($config = [], $driver = '', $driverConfig = null)
{
/* 获取配置 */
$this->config = array_merge($this->config, $config);
/* 设置上传驱动 */
$this->setDriver($driver, $driverConfig);
/* 调整配置,把字符串配置参数转换为数组 */
if (!empty($this->config['mimes'])) {
if (is_string($this->mimes)) {
$this->config['mimes'] = explode(',', $this->mimes);
}
$this->config['mimes'] = array_map('strtolower', $this->mimes);
}
if (!empty($this->config['exts'])) {
if (is_string($this->exts)) {
$this->config['exts'] = explode(',', $this->exts);
}
$this->config['exts'] = array_map('strtolower', $this->exts);
}
}