|
@@ -21,6 +21,19 @@ class View
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function http($file)
|
|
|
+ {
|
|
|
+ $base = Dever::data();
|
|
|
+ $host = Dever::host() . 'data/';
|
|
|
+ if (strstr($file, $base)) {
|
|
|
+ return str_replace($base, $host, $file);
|
|
|
+ } else {
|
|
|
+ $local = Dever::file('tmp/' . md5($file));
|
|
|
+ file_put_contents($local, file_get_contents($file), LOCK_EX);
|
|
|
+ return str_replace($base, $host, $local);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public function file($content, $domain, $local = false)
|
|
|
{
|