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. | 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); 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_APP_PATH', __DIR__.'/app/');
define('MM_MOD_PATH', MM_APP_PATH.'modules/'); define('MM_MOD_PATH', MM_APP_PATH.'modules/');
// Determine the default site url // Require the basic configuration file
$ri = $_SERVER['REQUEST_URI']; require(MM_APP_PATH .'config/config.php');
$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(MM_APP_PATH.'config/config.php');
// Require the most important files // Require the most important files
require(MM_SYS_PATH . "common.php"); require(MM_SYS_PATH . 'common.php');
// And away we go! // And away we go!
init(); init();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,7 +11,7 @@
* @license http://philsturgeon.co.uk/code/dbad-license * @license http://philsturgeon.co.uk/code/dbad-license
*/ */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// ! JSObject Trait // ! JSObject Trait
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

View File

@ -62,7 +62,7 @@ class MM_Data_Store {
{ {
$file_string = json_encode($this->current, JSON_PRETTY_PRINT); $file_string = json_encode($this->current, JSON_PRETTY_PRINT);
file_put_contents(MM_APP_PATH .'config/data_store.json', $file_string); file_put_contents(MM_APP_PATH . 'config/data_store.json', $file_string);
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -147,4 +147,5 @@ class MM_Data_Store {
return $this->current; return $this->current;
} }
} }
// End of data store.php // 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 * Class to improve handling of PHP sessions
@ -49,8 +44,8 @@ class MM_Session {
session_start(); session_start();
// Save a reference to the session for later access // Save a reference to the session for later access
$_SESSION[SESS_ID] = (isset($_SESSION[SESS_ID]) ?: []; $_SESSION['MM_SESSION'] = (isset($_SESSION['MM_SESSION']) ?: [];
$this->sess =& $_SESSION[SESS_ID]; $this->sess =& $_SESSION['MM_SESSION'];
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -92,4 +87,5 @@ class MM_Session {
sess_destroy(); sess_destroy();
} }
} }
// End of php_session.php
// End of session.php