本文整理汇总了PHP中NextendFilesystem::createFile方法的典型用法代码示例。如果您正苦于以下问题:PHP NextendFilesystem::createFile方法的具体用法?PHP NextendFilesystem::createFile怎么用?PHP NextendFilesystem::createFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NextendFilesystem
的用法示例。
在下文中一共展示了NextendFilesystem::createFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCache
function getCache()
{
if (count($this->_files) == 0 && $this->_text == '') {
return false;
}
if ($this->_cacheTime == 'static' || $this->_cacheTime == 0) {
$folder = $this->_path . 'static' . DIRECTORY_SEPARATOR;
$currentcachetime = 0;
} else {
$time = time();
$currentcachetime = $time - $time % $this->_cacheTime;
$folder = $this->_path . $this->_prename . $currentcachetime . DIRECTORY_SEPARATOR;
}
$this->createCacheSubFolder($folder, $currentcachetime);
$hash = $this->createHash();
$cachefile = $folder . $hash . '.' . $this->_filetype;
$cachefilegzip = $folder . $hash . '.php';
if (!NextendFilesystem::existsFile($cachefile)) {
$cached = "/* " . date('l jS \\of F Y h:i:s A') . "*/\n\n";
for ($i = 0; $i < count($this->_files); $i++) {
$cached .= $this->parseFile(NextendFilesystem::readFile($this->_files[$i]), $this->_files[$i], $i);
}
$cached .= $this->_text;
NextendFilesystem::createFile($cachefile, $this->parseCached($cached));
if ($this->_gzip) {
$php = '<?php ' . $this->getgzipHeader($currentcachetime) . 'if (extension_loaded("zlib") && (ini_get("output_handler") != "ob_gzhandler")) {' . 'ini_set("zlib.output_compression", 1);' . '}' . 'readfile("' . str_replace('\\', '/', $cachefile) . '");';
NextendFilesystem::createFile($cachefilegzip, $php);
}
}
if ($this->_gzip) {
return NextendFilesystem::pathToAbsoluteURL($cachefilegzip);
}
return NextendFilesystem::pathToAbsoluteURL($cachefile);
}
示例2: saveIm
function saveIm($file)
{
ob_start();
imagepng($this->_im);
NextendFilesystem::createFile($file, ob_get_clean());
imagedestroy($this->_im);
$this->_im = null;
}