$v) if (!defined($k)) define($k, $v); ob_start(); ob_clean(); header("Content-Type: text/html"); $strResource = $_SERVER["REQUEST_URI"]; if (strlen($strResource) > 0) $strResource = substr($strResource, 1); $strPluginsDirectory = "plugins"; $varPaths = array("."); if (is_dir($strPluginsDirectory)) foreach (scandir($strPluginsDirectory) as $strPluginName) { if ($strPluginName == ".") continue; if ($strPluginName == "..") continue; $strPluginDirectory = "{$strPluginsDirectory}/{$strPluginName}"; if (is_dir($strPluginDirectory)) $varPaths[] = "{$strPluginDirectory}"; } foreach ($varPaths as $strPath) { $strTargetFilePath = "{$strPath}/{$strResource}"; if (is_file($strTargetFilePath)) { $varMimeTypes = array( array("/\.css$/", "text/css"), array("/\.js$/", "application/javascript"), ); foreach ($varMimeTypes as $varMimeType) if (preg_match($varMimeType[0], $strTargetFilePath)) header("Content-Type: {$varMimeType[1]}"); ob_clean(); echo file_get_contents($strTargetFilePath); ob_end_flush(); exit; } } $varCollection = array( "lib" => array(), "init.php" => array(), "head.php" => array(), "header.php" => array(), "footer.php" => array(), ); foreach ($varPaths as $strPath) { $x = null; if (is_dir($x = "{$strPath}/lib")) $varCollection["lib"][] = $x; foreach (["init.php", "head.php", "header.php", "footer.php"] as $strScript) if (is_file($x = "{$strPath}/{$strScript}")) $varCollection[$strScript][] = $x; } foreach ($varCollection["lib"] as $strLibraryDirPath) foreach (scandir($strLibraryDirPath) as $strLibraryFileName) { $strLibraryFilePath = "{$strLibraryDirPath}/{$strLibraryFileName}"; if (preg_match("/\.php$/", $strLibraryFilePath)) if (is_file($strLibraryFilePath)) require $strLibraryFilePath; } $strBodyTagAttributes = ""; function requireAll($strScriptName) { global $varCollection; foreach ($varCollection[$strScriptName] as $strScript) { if (is_file($strScript)) { error_log($strScript); require $strScript; } } } // Require all init scripts found: requireAll("init.php"); ?>
getMessage(); echo $strMessage; echo "\n\n"; $strFile = $x->getFile(); $intLine = $x->getLine(); echo "#-1 {$strFile}({$intLine}): {$strMessage}\n"; echo $x->getTraceAsString(); ob_end_flush(); exit; } ?>