當前位置: 首頁>>代碼示例>>PHP>>正文


PHP NextendFilesystem::readFile方法代碼示例

本文整理匯總了PHP中NextendFilesystem::readFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP NextendFilesystem::readFile方法的具體用法?PHP NextendFilesystem::readFile怎麽用?PHP NextendFilesystem::readFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NextendFilesystem的用法示例。


在下文中一共展示了NextendFilesystem::readFile方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
 }
開發者ID:Nguyenkain,項目名稱:Elearning,代碼行數:34,代碼來源:cache.php

示例2: generateAjaxCSS

 function generateAjaxCSS($loadedCSS)
 {
     $css = '';
     if (count($this->_cssFiles)) {
         $lesscache = $this->_lesscache;
         foreach ($this->_cssFiles as $k => $file) {
             if (!in_array($k, $loadedCSS)) {
                 if (is_array($file)) {
                     $lesscache->addContext($file[1], $file[2]);
                 } else {
                     $css .= preg_replace('#url\\([\'"]([^"\'\\)]+)[\'"]\\)#', 'url(' . NextendFilesystem::pathToAbsoluteURL(dirname($k)) . '/$1)', NextendFilesystem::readFile($k));
                 }
             }
         }
         if ($lesscache) {
             $filename = $lesscache->getCache();
             if ($filename) {
                 $lessfile = NextendFilesystem::absoluteURLToPath($lesscache->getCache());
                 $css .= preg_replace('#url\\([\'"]([^"\'\\)]+)[\'"]\\)#', 'url(' . NextendFilesystem::pathToAbsoluteURL(dirname($lessfile)) . '/$1)', NextendFilesystem::readFile($lessfile));
             }
         }
     }
     $css .= $this->_css;
     return $css;
 }
開發者ID:sangikumar,項目名稱:IP,代碼行數:25,代碼來源:css.php

示例3: ss2_css_image_replace

 function ss2_css_image_replace($ms)
 {
     global $zip;
     if (substr($ms[1], 0, 2) == '//') {
         $ms[1] = 'http:' . $ms[1];
     }
     $path = NextendFilesystem::absoluteURLToPath($ms[1]);
     if (NextendFilesystem::fileexists($path)) {
         if (nextendIsJoomla()) {
             $rel = str_replace('plugins/', 'images/', NextendFilesystem::pathToRelativePath($path));
         } else {
             if (nextendIsWordpress()) {
                 $rel = str_replace(NEXTEND_SMART_SLIDER2 . 'plugins/', 'images/', $path);
             }
         }
         $zip->addFile(NextendFilesystem::readFile($path), $rel);
         return 'url(' . $rel . ')';
     }
 }
開發者ID:pguilford,項目名稱:vcomcc,代碼行數:19,代碼來源:sliders.php

示例4: generateAjaxCSS

 function generateAjaxCSS($loadedCSS)
 {
     $css = '';
     if (count($this->_cssFiles)) {
         foreach ($this->_cssFiles as $file) {
             if (!in_array($file, $loadedCSS)) {
                 $css .= NextendFilesystem::readFile($file);
             }
         }
     }
     $css .= $this->_css;
     return $css;
 }
開發者ID:01J,項目名稱:bealtine,代碼行數:13,代碼來源:css.php


注:本文中的NextendFilesystem::readFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。