Various formatting fixes
This commit is contained in:
parent
dda867c208
commit
a91b2a414e
17
sys/db.php
17
sys/db.php
@ -8,15 +8,16 @@ class db extends PDO {
|
||||
private static $instance;
|
||||
|
||||
public static function get_instance()
|
||||
{
|
||||
if ( ! isset(self::$instance)) {
|
||||
echo 'Creating new instance of db class.';
|
||||
$className = __CLASS__;
|
||||
self::$instance = new $className;
|
||||
}
|
||||
{
|
||||
if ( ! isset(self::$instance))
|
||||
{
|
||||
echo 'Creating new instance of db class.';
|
||||
$className = __CLASS__;
|
||||
self::$instance = new $className;
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
function __construct($dbname="default", $options=array())
|
||||
{
|
||||
|
@ -7,42 +7,39 @@ class miniMVC{
|
||||
private static $instance;
|
||||
private static $count;
|
||||
|
||||
//var $output = new Output;
|
||||
//var $page = new Page;
|
||||
|
||||
public static function get_instance()
|
||||
{
|
||||
if( ! isset(self::$count))
|
||||
{
|
||||
self::$count = 0;
|
||||
}
|
||||
{
|
||||
if( ! isset(self::$count))
|
||||
{
|
||||
self::$count = 0;
|
||||
}
|
||||
|
||||
if ( ! isset(self::$instance))
|
||||
{
|
||||
self::$count++;
|
||||
self::$instance = new miniMVC;
|
||||
}
|
||||
if ( ! isset(self::$instance))
|
||||
{
|
||||
self::$count++;
|
||||
self::$instance = new miniMVC;
|
||||
}
|
||||
|
||||
$self =& self::$instance;
|
||||
$self =& self::$instance;
|
||||
|
||||
return $self;
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor - Any classes loaded here become subclasses of miniMVC
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
self::$instance =& $this;
|
||||
}
|
||||
/**
|
||||
* Constructor - Any classes loaded here become subclasses of miniMVC
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
self::$instance =& $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic function called when cloning an object
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
trigger_error('Clone is not allowed.', E_USER_ERROR);
|
||||
}
|
||||
{
|
||||
trigger_error('Clone is not allowed.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP magic method to facilitate dynamic methods
|
||||
|
10
sys/page.php
10
sys/page.php
@ -41,8 +41,6 @@ class Page
|
||||
private function _headers($xhtml, $html5)
|
||||
{
|
||||
$this->mm->output->set_header("Cache-Control", "must-revalidate, public");
|
||||
|
||||
$this->mm->output->set_header("Vary", "Accept");
|
||||
$mime = "";
|
||||
|
||||
//Variable for accept keyword
|
||||
@ -100,9 +98,9 @@ class Page
|
||||
$doctype_string = '';
|
||||
}
|
||||
|
||||
$doctype_string = "<?xml version='1.0' encoding='$charset' ?>\n"
|
||||
$doctype_string = "<?xml version='1.0' encoding='$charset' ?>"
|
||||
. $doctype_string
|
||||
. "\n<html xmlns='http://www.w3.org/1999/xhtml'" . " xml:lang='en'>";
|
||||
. "<html xmlns='http://www.w3.org/1999/xhtml'" . " xml:lang='en'>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -321,7 +319,7 @@ class Page
|
||||
*/
|
||||
public function set_head_tag($tag)
|
||||
{
|
||||
$this->head_tags .= $tag . "\n";
|
||||
$this->head_tags .= $tag;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -470,7 +468,7 @@ class Page
|
||||
function render($view, $data=array())
|
||||
{
|
||||
$this->build_header();
|
||||
$this->load_view($view, $data);
|
||||
$this->mm->load_view($view, $data);
|
||||
$this->build_footer();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user