本文整理汇总了PHP中AutoLoader::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP AutoLoader::getInstance方法的具体用法?PHP AutoLoader::getInstance怎么用?PHP AutoLoader::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutoLoader
的用法示例。
在下文中一共展示了AutoLoader::getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: constructor
/**
* @see IController::constructor()
*/
public function constructor()
{
// Link loader to controller
// and the controller instance to itself
$this->load = Loader::$instance;
self::$instance =& $this;
// Method and argument back references.
if (isset($_GET["m"])) {
$m = filter_var($_GET["m"], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
}
if (isset($_GET["a"])) {
$a = filter_var($_GET["a"], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
}
if (isset($m)) {
$this->method = $m;
}
if (isset($a)) {
$this->arg = $a;
}
AutoLoader::getInstance();
/*
* Changing the working directory to "application"
* since we don't really need anything from the system folder.
*/
chdir("application");
}
示例2: setData
public function setData(&$data)
{
$this->data =& $data;
$this->data['is_admin'] = false;
if ($this->httpRequest->arg(0) == 'admin') {
$this->data['is_admin'] = true;
}
$this->data['headline'] = $this->data['title'];
$autoloader = AutoLoader::getInstance();
if (!$this->data['title']) {
$this->data['title'] = $autoloader->config('default_title');
}
if (!$this->data['keywords']) {
$this->data['keywords'] = $autoloader->config('default_keywords');
}
if (!$this->data['description']) {
$this->data['description'] = $autoloader->config('default_description');
}
}
示例3: defined
<?php
defined('__XS_STANDALONE') or define('__XS_STANDALONE', true);
define('__XS_PRIVATE', __DIR__);
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
session_start();
$autoloader = AutoLoader::getInstance();
class AutoLoader
{
private static $_instance;
private static $db;
private static $config = array();
private static $controller = '';
private static $action = '';
private static $params = array();
private static $controllerClass;
public static function getInstance()
{
if (!self::$_instance instanceof self) {
self::$_instance = new self();
}
return self::$_instance;
}
public function config($name, $val = '')
{
if ($val) {
$this->config[$name] = $val;
} else {
return $this->config[$name];
示例4: __construct
public function __construct()
{
$this->autoloader =& AutoLoader::getInstance();
$this->httpRequest =& HttpRequest::getInstance();
// nothing here
}
示例5: setInitialized
private function setInitialized($init)
{
self::$_initialized = $init;
AutoLoader::getInstance()->initialize($this);
}
示例6: __autoload
function __autoload($className)
{
$autoLoader = AutoLoader::getInstance();
$autoLoader->load($className);
}
示例7: error_reporting
<?php
//error_reporting( E_ERROR | E_RECOVERABLE_ERROR | E_PARSE | E_USER_ERROR | E_CORE_ERROR );
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
//error_reporting(0);
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return (double) $usec + (double) $sec;
}
$time_start = microtime(true);
include 'modules/AutoLoader.php';
AutoLoader::getInstance()->register();
include 'modules/Core.php';
$webRequest = new MVC\WebRequest();
$webRequest->route();
echo $webRequest->getResponse();
$time_end = microtime(true);
$time = round($time_end - $time_start, 2);
echo "<br/>";
echo $time . ' seconds';