Added getPath function
This commit is contained in:
parent
6c4237ec9b
commit
cc5474ef80
67
index.php
67
index.php
@ -65,6 +65,9 @@
|
|||||||
$varMimeTypes = array(
|
$varMimeTypes = array(
|
||||||
array("/\.css$/", "text/css"),
|
array("/\.css$/", "text/css"),
|
||||||
array("/\.js$/", "application/javascript"),
|
array("/\.js$/", "application/javascript"),
|
||||||
|
array("/\.png$/", "image/png"),
|
||||||
|
array("/\.jpg$/", "image/jpeg"),
|
||||||
|
array("/\.jpeg$/", "image/jpeg"),
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($varMimeTypes as $varMimeType)
|
foreach ($varMimeTypes as $varMimeType)
|
||||||
@ -126,45 +129,49 @@
|
|||||||
requireAll("init.php");
|
requireAll("init.php");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<?php requireAll("head.php"); ?>
|
<?php requireAll("head.php"); ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body data-path="<?= Request::getPath(); ?>">
|
||||||
<div class="app-header">
|
<div class="app">
|
||||||
<?php requireAll("header.php"); ?>
|
<div class="app-header">
|
||||||
</div>
|
<?php requireAll("header.php"); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="app-body">
|
<div class="app-body">
|
||||||
<?php
|
<?php
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
require Request::getScript();
|
require Request::getScript();
|
||||||
}
|
}
|
||||||
catch (Exception $x)
|
catch (Exception $x)
|
||||||
{
|
{
|
||||||
ob_clean();
|
ob_clean();
|
||||||
header("Content-Type: text/plain");
|
header("Content-Type: text/plain");
|
||||||
|
|
||||||
$strMessage = $x->getMessage();
|
$strMessage = $x->getMessage();
|
||||||
echo $strMessage;
|
echo $strMessage;
|
||||||
echo "\n\n";
|
echo "\n\n";
|
||||||
|
|
||||||
$strFile = $x->getFile();
|
$strFile = $x->getFile();
|
||||||
$intLine = $x->getLine();
|
$intLine = $x->getLine();
|
||||||
|
|
||||||
echo "#-1 {$strFile}({$intLine}): {$strMessage}\n";
|
echo "#-1 {$strFile}({$intLine}): {$strMessage}\n";
|
||||||
echo $x->getTraceAsString();
|
echo $x->getTraceAsString();
|
||||||
|
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="app-footer">
|
<div class="app-footer">
|
||||||
<?php requireAll("footer.php"); ?>
|
<?php requireAll("footer.php"); ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -98,6 +98,13 @@
|
|||||||
return Request::$varPathParts;
|
return Request::$varPathParts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getPath()
|
||||||
|
{
|
||||||
|
$strPath = "/";
|
||||||
|
$strPath .= implode("/", Request::getPathParts());
|
||||||
|
return $strPath;
|
||||||
|
}
|
||||||
|
|
||||||
// Safely returns a request argument by its index or null if it doesn't exist (without error)
|
// Safely returns a request argument by its index or null if it doesn't exist (without error)
|
||||||
public static function getArg($intIndex)
|
public static function getArg($intIndex)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user