本文整理汇总了PHP中ClassLoader::isCacheChanged方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassLoader::isCacheChanged方法的具体用法?PHP ClassLoader::isCacheChanged怎么用?PHP ClassLoader::isCacheChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassLoader
的用法示例。
在下文中一共展示了ClassLoader::isCacheChanged方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runApp
$app->getRouter()->setRequestedRoute($route);
runApp($app);
}
}
runApp($app);
if (!empty($_GET['stat'])) {
$stat->display();
}
function dump_livecart_trace(Exception $e)
{
echo "<br/><strong>" . get_class($e) . " ERROR:</strong> " . $e->getMessage() . "\n\n";
echo "<br /><strong>FILE TRACE:</strong><br />\n\n";
echo ApplicationException::getFileTrace($e->getTrace());
exit;
}
if (!isset($classLoaderCache) || ClassLoader::isCacheChanged()) {
$classLoaderCache = array('realPath' => ClassLoader::getRealPathCache(), 'mountPoint' => ClassLoader::getMountPointCache());
file_put_contents($classLoaderCacheFile, '<?php return ' . var_export($classLoaderCache, true) . '; ?>');
}
session_write_close();
function remove_recursion(&$object, &$stack = array())
{
if ((is_object($object) || is_array($object)) && $object) {
if (!in_array($object, $stack, true)) {
$stack[] = $object;
foreach ($object as &$subobject) {
remove_recursion($subobject, $stack);
}
} else {
$object = "***RECURSION***";
}
示例2: getRealPath
/**
* Gets a translated (physical) path by using a package path
*
* @param string $path
* @return string
*/
public static function getRealPath($path)
{
if (!isset(self::$realPathCache[$path])) {
if (self::$realPathCache) {
self::$isCacheChanged = true;
}
self::$realPathCache[$path] = null;
$mounted = self::mapToMountPoint($path);
foreach ($mounted as $possiblePath) {
$replaced = str_replace('*', '', $possiblePath);
if (is_file($replaced . '.php') || is_dir($replaced)) {
self::$realPathCache[$path] = $possiblePath;
break;
}
}
if (!self::$realPathCache[$path]) {
self::$realPathCache[$path] = array_shift($mounted);
}
}
return self::$realPathCache[$path];
}