Merge out from the pre_0.1 branch

git-svn-id: file:///svn-source/pmgr/branches/sandbox_0.1@810 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-28 20:48:52 +00:00
76 changed files with 2627 additions and 376 deletions

View File

@@ -32,6 +32,14 @@
*
*/
function sandbox() {
return preg_match("%^/[^/]*sand/%", $_SERVER['REQUEST_URI']);
}
function server_request_var($var) {
return (preg_match("/^HTTP/", $var));
}
function INTERNAL_ERROR($message, $exit = true, $drop = 0) {
echo '<DIV class="internal-error" style="color:#000; background:#c22; padding:0.5em 1.5em 0.5em 1.5em;">' . "\n";
echo '<H1 style="color:#000; margin-bottom:0.2em; font-size:2em;">INTERNAL ERROR:</H1>' . "\n";
@@ -62,9 +70,18 @@ function INTERNAL_ERROR($message, $exit = true, $drop = 0) {
echo "</OL>\n";
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\nHTTP Request:\n";
echo '<P><PRE style="color:#000; background:#c22;">' . "\n";
echo '<P><PRE style="color:#000; background:#c22; padding:0.5em 0 0 0;">' . "\n";
print_r($_REQUEST);
echo "\n</PRE>\n";
echo "</PRE>\n";
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\nServer:\n";
echo '<P><PRE style="color:#000; background:#c22; padding:0.5em 0 0 0;">' . "\n";
print_r(array_intersect_key($_SERVER, array_flip(array_filter(array_keys($_SERVER), 'server_request_var'))));
echo "</PRE>\n";
echo '<HR style="margin-top:1.0em; margin-bottom:0.5em;">' . "\n";
echo 'Started: ' . date('c', $_SERVER['REQUEST_TIME']) . "<BR>\n";
echo 'Current: ' . date('c') . "<BR>\n";
echo '</DIV>';
if ($exit)

View File

@@ -12,7 +12,7 @@ class DATABASE_CONFIG {
);
function __construct() {
if (preg_match("%^/[^/]*sand/%", $_SERVER['REQUEST_URI']))
if (sandbox())
$this->default['database'] = 'pmgr_sand';
}
}

View File

@@ -36,20 +36,4 @@ $default_path = array('controller' => 'maps', 'action' => 'view', '1');
*/
Router::connect('/', $default_path);
/*
* Route for admin functionality
*/
Router::connect('/admin',
array('admin_route' => true) + $default_path);
Router::connect('/admin/:controller/:action/*',
array('admin_route' => true, 'action' => null));
/*
* Route for development functionality
*/
Router::connect('/dev',
array('dev_route' => true) + $default_path);
Router::connect('/dev/:controller/:action/*',
array('dev_route' => true, 'action' => null));
?>