Consistency improvements

This commit is contained in:
Timothy Warren 2012-05-17 16:22:39 -04:00
parent d4d700efe6
commit 9da461d135
10 changed files with 21 additions and 20 deletions

View File

@ -41,6 +41,11 @@ define('SHOW_DEBUG_BACKTRACE', TRUE);
| slash.
|
*/
// Determine the default site url
$ri = $_SERVER['REQUEST_URI'];
$ind_pos = stripos($ri, "index.php");
$default_path = ($ind_pos !== FALSE) ? substr($ri, 0, $ind_pos) : $ri;
$default_baseurl = "//" . str_replace("//", "/", $_SERVER['HTTP_HOST']. $default_path);
define('BASE_URL', $default_baseurl);
/*

View File

@ -42,17 +42,11 @@ define('MM_SYS_PATH', __DIR__.'/sys/');
define('MM_APP_PATH', __DIR__.'/app/');
define('MM_MOD_PATH', MM_APP_PATH.'modules/');
// Determine the default site url
$ri = $_SERVER['REQUEST_URI'];
$ind_pos = stripos($ri, "index.php");
$default_path = ($ind_pos !== FALSE) ? substr($ri, 0, $ind_pos) : $ri;
$default_baseurl = "//" . str_replace("//", "/", $_SERVER['HTTP_HOST']. $default_path);
// Require the basic configuratio file
// Require the basic configuration file
require(MM_APP_PATH .'config/config.php');
// Require the most important files
require(MM_SYS_PATH . "common.php");
require(MM_SYS_PATH . 'common.php');
// And away we go!
init();

View File

@ -119,4 +119,5 @@ class MM_Controller extends miniMVC {
}
}
}
// End of controller.php

View File

@ -121,4 +121,5 @@ class DB extends Query_Builder {
echo $buffer;
}
}
// End of db.php

View File

@ -32,4 +32,5 @@ class MM_Model extends miniMVC {
parent::__construct($args);
}
}
// End of model.php

View File

@ -147,4 +147,5 @@ class MM_Output extends MM {
$this->headers = [];
}
}
// End of Output.php

View File

@ -537,4 +537,5 @@ class MM_Page extends MM_Output {
return $string;
}
}
// End of page.php

View File

@ -147,4 +147,5 @@ class MM_Data_Store {
return $this->current;
}
}
// End of data store.php

View File

@ -12,11 +12,6 @@
*/
// --------------------------------------------------------------------------
/**
* Define a session id to namespace sessions
*/
define(SESS_ID, 'MM_SESSION');
// --------------------------------------------------------------------------
/**
* Class to improve handling of PHP sessions
@ -49,8 +44,8 @@ class MM_Session {
session_start();
// Save a reference to the session for later access
$_SESSION[SESS_ID] = (isset($_SESSION[SESS_ID]) ?: [];
$this->sess =& $_SESSION[SESS_ID];
$_SESSION['MM_SESSION'] = (isset($_SESSION['MM_SESSION']) ?: [];
$this->sess =& $_SESSION['MM_SESSION'];
}
// --------------------------------------------------------------------------
@ -92,4 +87,5 @@ class MM_Session {
sess_destroy();
}
}
// End of php_session.php
// End of session.php