当前位置: 首页>>代码示例>>PHP>>正文


PHP AutoLoader::getInstance方法代码示例

本文整理汇总了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");
 }
开发者ID:kveler,项目名称:webchat,代码行数:29,代码来源:emmacontroller.php

示例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');
     }
 }
开发者ID:rakvium,项目名称:experiments,代码行数:19,代码来源:page_view.php

示例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];
开发者ID:rakvium,项目名称:experiments,代码行数:31,代码来源:autoloader.php

示例4: __construct

 public function __construct()
 {
     $this->autoloader =& AutoLoader::getInstance();
     $this->httpRequest =& HttpRequest::getInstance();
     // nothing here
 }
开发者ID:rakvium,项目名称:experiments,代码行数:6,代码来源:controller.php

示例5: setInitialized

 private function setInitialized($init)
 {
     self::$_initialized = $init;
     AutoLoader::getInstance()->initialize($this);
 }
开发者ID:Kinetical,项目名称:Kinesis,代码行数:5,代码来源:Core.php

示例6: __autoload

function __autoload($className)
{
    $autoLoader = AutoLoader::getInstance();
    $autoLoader->load($className);
}
开发者ID:sigmadesarrollo,项目名称:logisoft,代码行数:5,代码来源:DrupalHttpHandler.php

示例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';
开发者ID:Kinetical,项目名称:Kinesis,代码行数:21,代码来源:bootstrap.php


注:本文中的AutoLoader::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。