Exemple #1
0
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #2
0
<?php

// framework location
define('IMLI_FRAMEWORK', dirname(dirname(__FILE__)));
define('IMLI_THEME_URL', get_stylesheet_directory_uri());
$config["classPath"] = array(IMLI_FRAMEWORK . "/php");
$config["libPath"] = array(IMLI_FRAMEWORK . "/php/libs");
if (function_exists("spl_autoload_register")) {
    spl_autoload_register("loader");
} else {
    function __autoload($class)
    {
        loader($class);
    }
}
$controller = ImliController::get_instance();
$controller->run();
/*
 * Function: loader
 * Function for loading PHP classes
 */
function loader($class)
{
    global $config;
    if (strpos($class, "ImliAdmin") === 0) {
        foreach ($config["classPath"] as $location) {
            if (file_exists("{$location}/Admin/{$class}.php")) {
                require "{$location}/Admin/{$class}.php";
                return true;
            }
        }