当前位置: 首页>>代码示例>>PHP>>正文


PHP KAutoloader::_classMap方法代码示例

本文整理汇总了PHP中KAutoloader::_classMap方法的典型用法代码示例。如果您正苦于以下问题:PHP KAutoloader::_classMap方法的具体用法?PHP KAutoloader::_classMap怎么用?PHP KAutoloader::_classMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KAutoloader的用法示例。


在下文中一共展示了KAutoloader::_classMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadClassMapFromCache

 public static function loadClassMapFromCache()
 {
     if (self::$_classMap) {
         return true;
     }
     if (!file_exists(self::$_classMapFileLocation)) {
         return false;
     }
     // if cached map was not loaded but exists on the disk, load it
     self::$_classMap = unserialize(file_get_contents(self::$_classMapFileLocation));
     if (!is_array(self::$_classMap)) {
         $permission = substr(decoct(fileperms(self::$_classMapFileLocation)), 2);
         error_log("PHP Class map could not be loaded from path [" . self::$_classMapFileLocation . "] file permissions [{$permission}]");
         die('PHP Class map could not be loaded');
     }
     return true;
 }
开发者ID:DBezemer,项目名称:server,代码行数:17,代码来源:KAutoloader.php

示例2: loadClassMap

 /**
  * Load and cache the class map
  */
 private static function loadClassMap()
 {
     if (!self::$_classMapFileLocation || !file_exists(self::$_classMapFileLocation) || self::$_noCache == true) {
         // cached map doesn't exists, rebuild the cache map
         foreach (self::$_classPath as $dir) {
             if (strpos($dir, DIRECTORY_SEPARATOR . "*") == strlen($dir) - 2) {
                 $dir = substr($dir, 0, strlen($dir) - 2);
                 $recursive = true;
             } else {
                 $recursive = false;
             }
             self::scanDirectory($dir, $recursive);
         }
         if (self::$_noCache === false && self::$_classMapFileLocation) {
             // save the cached map
             $bytesWritten = file_put_contents(self::$_classMapFileLocation, serialize(self::$_classMap));
             if (!$bytesWritten) {
                 $folderPermission = substr(decoct(fileperms(dirname(self::$_classMapFileLocation))), 2);
                 error_log("PHP Class map could not be saved to path [" . self::$_classMapFileLocation . "] folder permisisons [{$folderPermission}]");
                 die("PHP Class map could not be saved");
             }
         }
     } else {
         if (count(self::$_classMap) == 0) {
             // if cached map was not loaded but exists on the disk, load it
             self::$_classMap = unserialize(file_get_contents(self::$_classMapFileLocation));
             if (!is_array(self::$_classMap)) {
                 $permission = substr(decoct(fileperms(self::$_classMapFileLocation)), 2);
                 error_log("PHP Class map could not be loaded from path [" . self::$_classMapFileLocation . "] file permisisons [{$permission}]");
                 die('PHP Class map could not be loaded');
             }
         }
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:37,代码来源:KAutoloader.php

示例3: loadClassMap

 /**
  * Load and cache the class map
  */
 private static function loadClassMap()
 {
     if (!file_exists(self::$_classMapFileLocation) || self::$_noCache == true) {
         // cached map doesn't exists, rebuild the cache map
         foreach (self::$_classPath as $dir) {
             if (strpos($dir, DIRECTORY_SEPARATOR . "*") == strlen($dir) - 2) {
                 $dir = substr($dir, 0, strlen($dir) - 2);
                 $recursive = true;
             } else {
                 $recursive = false;
             }
             self::scanDirectory($dir, $recursive);
         }
         if (self::$_noCache === false) {
             // save the cached map
             file_put_contents(self::$_classMapFileLocation, serialize(self::$_classMap));
         }
     } else {
         if (count(self::$_classMap) == 0) {
             // if cached map was not loaded but exists on the disk, load it
             self::$_classMap = unserialize(file_get_contents(self::$_classMapFileLocation));
         }
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:27,代码来源:KAutoloader.php


注:本文中的KAutoloader::_classMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。