本文整理汇总了PHP中Conf::remote_path方法的典型用法代码示例。如果您正苦于以下问题:PHP Conf::remote_path方法的具体用法?PHP Conf::remote_path怎么用?PHP Conf::remote_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conf
的用法示例。
在下文中一共展示了Conf::remote_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tocpcss
public function tocpcss($path)
{
if (!is_dir($this->devpath . $path)) {
if (strpos(strtolower($path), '.css') == strlen($path) - 4) {
if (file_exists($this->propath . $path) && filemtime($this->devpath . $path) < filemtime($this->propath . $path)) {
return;
}
File::creat_dir_with_filepath($this->propath . $path);
//如果传入的是JS文件则压缩
$buffer = file_get_contents($this->devpath . $path);
if ($this->needcomp) {
$buffer = preg_replace("!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!", "", $buffer);
$arr = array("\r\n", "\r", "\n", "\t", " ", " ", " ");
$buffer = str_replace($arr, "", $buffer);
}
if (empty(Conf::$remote_path)) {
Conf::$remote_path = '/';
} else {
if (strlen(Conf::$remote_path) - 1 != strrpos(Conf::$remote_path, '/')) {
Conf::$remote_path = Conf::$remote_path . '/';
}
}
$buffer = str_replace("img@", Conf::$remote_path . "media/images/", $buffer);
$buffer = str_replace("vid@", Conf::$remote_path . "media/videos/", $buffer);
$buffer = str_replace("sou@", Conf::$remote_path . "media/sounds/", $buffer);
$buffer = str_replace("ani@", Conf::$remote_path . "media/animations/", $buffer);
file_put_contents($this->propath . $path, $buffer);
} else {
@copy($this->devpath . $path, $this->propath . $path);
}
return;
}
//如果传入的参数是目录
$handle = File::scandir($this->devpath . $path);
foreach ($handle as $file) {
if ($file != '.' && $file != '..') {
$dir = $path . '/' . $file;
//当前文件$dir为文件目录+文件
$this->tocpcss($dir);
}
}
return;
}