Varien_Autoload::getFullPath PHP Method

getFullPath() public static method

Get full path
public static getFullPath ( $className ) : mixed
$className
return mixed
    public static function getFullPath($className)
    {
        if (!isset(self::$_cache[$className])) {
            self::$_cache[$className] = self::searchFullPath(self::getFileFromClassName($className));
            // removing the basepath
            if (self::$_cache[$className] !== false) {
                self::$_cache[$className] = str_replace(self::$_BP . DIRECTORY_SEPARATOR, '', self::$_cache[$className]);
            }
            self::$_numberOfFilesAddedToCache++;
        }
        return self::$_cache[$className];
    }

Usage Example

Beispiel #1
0
 /**
  * Revalidate all currently cached entries
  */
 public function revalidateCache()
 {
     $start = microtime(true);
     $cache = Varien_Autoload::getCache();
     Varien_Autoload::setCache(array());
     foreach ($cache as $className => $path) {
         Varien_Autoload::getFullPath($className);
     }
     $duration = microtime(true) - $start;
     Mage::log('[ClassPathCache] Revalidated ' . count($cache) . ' classes (duration: ' . round($duration, 2) . ' sec)', 6, self::LOG_FILE);
 }