'Local', 2 => 'Qiniu', 3 => 'Oss', ); public function local($file) { $host = Dever::host() . 'data/'; if (strstr($file, $host)) { return str_replace($host, Dever::data(), $file); } else { $local = Dever::file('tmp/' . md5($file)); file_put_contents($local, file_get_contents($file), LOCK_EX); return $local; } } }