$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***"; }
/** * 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]; }