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


PHP Assets::cache_url方法代碼示例

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


在下文中一共展示了Assets::cache_url方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setPaths

 /**
  * Set paths and urls for future processing
  */
 public static function setPaths()
 {
     // Set Assets Path
     if (!is_dir(self::$assets_dir)) {
         throw new Assets\AssetsException('The provided directory "' . self::$assets_dir . '" does not exist.');
     }
     // Set cache path and url
     self::$cache_path = self::$assets_dir . self::$cache_dir;
     self::$cache_url = self::$base_url . self::$cache_dir;
 }
開發者ID:bradstinson,項目名稱:assets,代碼行數:13,代碼來源:Assets.php

示例2: _paths

 /**
  * Setup paths
  */
 private static function _paths()
 {
     // Start benchmark
     if (self::$_enable_benchmark) {
         self::$_ci->benchmark->mark("Assets::paths()_start");
     }
     // Set the assets base path
     self::$base_path = reduce_double_slashes(realpath(self::$assets_dir));
     // Now set the assets base URL
     if (!self::$base_url) {
         self::$base_url = reduce_double_slashes(config_item('base_url') . '/' . self::$assets_dir);
     } else {
         self::$base_url = self::$base_url . self::$assets_dir;
     }
     // Auto protocol
     if (stripos(self::$base_url, '//') === 0) {
         $slash = '/';
     } else {
         $slash = '';
     }
     // And finally the paths and URL's to the css and js assets
     self::$js_path = reduce_double_slashes(self::$base_path . '/' . self::$js_dir);
     self::$js_url = $slash . reduce_double_slashes(self::$base_url . '/' . self::$js_dir);
     self::$css_path = reduce_double_slashes(self::$base_path . '/' . self::$css_dir);
     self::$css_url = $slash . reduce_double_slashes(self::$base_url . '/' . self::$css_dir);
     self::$img_path = reduce_double_slashes(self::$base_path . '/' . self::$img_dir);
     self::$img_url = $slash . reduce_double_slashes(self::$base_url . '/' . self::$img_dir);
     self::$cache_path = reduce_double_slashes(self::$base_path . '/' . self::$cache_dir);
     self::$cache_url = $slash . reduce_double_slashes(self::$base_url . '/' . self::$cache_dir);
     if (!self::$freeze) {
         // Check if all directories exist
         if (!is_dir(self::$js_path)) {
             if (!@mkdir(self::$js_path, 0755)) {
                 exit('Error with JS directory.');
             }
         }
         if (!is_dir(self::$css_path)) {
             if (!@mkdir(self::$css_path, 0755)) {
                 exit('Error with CSS directory.');
             }
         }
         if (!is_dir(self::$cache_path)) {
             if (!@mkdir(self::$cache_path, 0777)) {
                 exit('Error with CACHE directory.');
             }
         }
         // Try to make the cache direcory writable
         if (is_dir(self::$cache_path) and !is_really_writable(self::$cache_path)) {
             @chmod(self::$cache_path, 0777);
         }
         // If it's still not writable throw error
         if (!is_dir(self::$cache_path) or !is_really_writable(self::$cache_path)) {
             exit('Error with CACHE directory.');
         }
     }
     // End benchmark
     if (self::$_enable_benchmark) {
         self::$_ci->benchmark->mark("Assets::paths()_end");
     }
 }
開發者ID:NaszvadiG,項目名稱:Base-CodeIgniter-App,代碼行數:63,代碼來源:assets.php

示例3: _paths

 /**
  * Setup paths
  * @return [type] [description]
  */
 private static function _paths()
 {
     // Set the assets base path
     self::$base_path = reduce_double_slashes(realpath(self::$assets_dir));
     // Now set the assets base URL
     self::$base_url = reduce_double_slashes(config_item('base_url') . '/' . self::$assets_dir);
     // And finally the paths and URL's to the css and js assets
     self::$js_path = reduce_double_slashes(self::$base_path . '/' . self::$js_dir);
     self::$js_url = reduce_double_slashes(self::$base_url . '/' . self::$js_dir);
     self::$css_path = reduce_double_slashes(self::$base_path . '/' . self::$css_dir);
     self::$css_url = reduce_double_slashes(self::$base_url . '/' . self::$css_dir);
     self::$img_path = reduce_double_slashes(self::$base_path . '/' . self::$img_dir);
     self::$img_url = reduce_double_slashes(self::$base_url . '/' . self::$img_dir);
     self::$cache_path = reduce_double_slashes(self::$base_path . '/' . self::$cache_dir);
     self::$cache_url = reduce_double_slashes(self::$base_url . '/' . self::$cache_dir);
     // Check if all directories exist
     if (!is_dir(self::$js_path)) {
         if (!@mkdir(self::$js_path, 0755)) {
             exit('Error with JS directory.');
         }
     }
     if (!is_dir(self::$css_path)) {
         if (!@mkdir(self::$css_path, 0755)) {
             exit('Error with CSS directory.');
         }
     }
     if (!is_dir(self::$cache_path)) {
         if (!@mkdir(self::$cache_path, 0777)) {
             exit('Error with CACHE directory.');
         }
     }
     // Try to make the cache direcory writable
     if (is_dir(self::$cache_path) and !is_really_writable(self::$cache_path)) {
         @chmod(self::$cache_path, 0777);
     }
     // If it's still not writable throw error
     if (!is_dir(self::$cache_path) or !is_really_writable(self::$cache_path)) {
         exit('Error with CACHE directory.');
     }
 }
開發者ID:Autobahnpanzer,項目名稱:mamrudsmuskovics,代碼行數:44,代碼來源:assets.php


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