當前位置: 首頁>>代碼示例>>PHP>>正文


PHP is_loaded函數代碼示例

本文整理匯總了PHP中is_loaded函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_loaded函數的具體用法?PHP is_loaded怎麽用?PHP is_loaded使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了is_loaded函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadLibraries

 private function loadLibraries()
 {
     $loaded_libraries =& is_loaded();
     return array_map(function ($item) {
         return array('name' => $item);
     }, $loaded_libraries);
 }
開發者ID:JCSama,項目名稱:Z-Ray-Plugin-for-CodeIgniter,代碼行數:7,代碼來源:zray.php

示例2: reset_instance

/**
 * Reset CodeIgniter instance
 */
function reset_instance()
{
    // Reset loaded classes
    load_class('', '', NULL, TRUE);
    is_loaded('', TRUE);
    // Close db connection
    $CI =& get_instance();
    if (isset($CI->db)) {
        if ($CI->db->dsn !== 'sqlite::memory:' && $CI->db->database !== ':memory:') {
            $CI->db->close();
            $CI->db = null;
        } else {
            // Don't close if SQLite in-memory database
            // If we close it, all tables and stored data will be gone
            load_class_instance('db', $CI->db);
        }
    }
    // Load core classes
    load_class('Benchmark', 'core');
    load_class('Hooks', 'core');
    load_class('Config', 'core');
    //	load_class('Utf8', 'core');
    load_class('URI', 'core');
    load_class('Router', 'core');
    load_class('Output', 'core');
    load_class('Security', 'core');
    load_class('Input', 'core');
    load_class('Lang', 'core');
    CIPHPUnitTest::loadLoader();
    // Remove CodeIgniter instance
    $CI = new CIPHPUnitTestNullCodeIgniter();
}
開發者ID:ricpelo,項目名稱:codeigniter-heroku,代碼行數:35,代碼來源:functions.php

示例3: array

 function &load_class($class, $directory = 'libraries', $prefix = 'CI_')
 {
     static $_classes = array();
     if (isset($_classes[$class])) {
         return $_classes[$class];
     }
     $name = FALSE;
     foreach (array(APPPATH, BASEPATH) as $path) {
         if (file_exists($path . $directory . '/' . $class . '.php')) {
             $name = $prefix . $class;
             if (class_exists($name) === FALSE) {
                 require $path . $directory . '/' . $class . '.php';
             }
             break;
         }
     }
     if (file_exists(APPPATH . $directory . '/' . config_item('subclass_prefix') . $class . '.php')) {
         $name = config_item('subclass_prefix') . $class;
         if (class_exists($name) === FALSE) {
             require APPPATH . $directory . '/' . config_item('subclass_prefix') . $class . '.php';
         }
     }
     if ($name === FALSE) {
         exit('Unable to locate the specified class: ' . $class . '.php');
     }
     is_loaded($class);
     $_classes[$class] = new $name();
     return $_classes[$class];
 }
開發者ID:pepegarcia,項目名稱:publicidadoficialdemo-1,代碼行數:29,代碼來源:Common.php

示例4: __construct

	/**
	 * Class constructor
	 *
	 * @return	void
	 */
	public function __construct()
	{
		self::$instance =& $this;

		// Assign all the class objects that were instantiated by the
		// bootstrap file (CodeIgniter.php) to local class variables
		// so that CI can run as one big super object.
		foreach (is_loaded() as $var => $class)
		{
			$this->$var =& load_class($class);
		}

		$this->load =& load_class('Loader', 'core');
		$this->load->initialize();
		log_message('info', 'Controller Class Initialized');
                user_logged_in();
                //echo $user_type = $this->session->userdata['department'];
                $valid_method = get_restricted_department();
                $user_type = strtolower($this->session->userdata['department']);
                if(in_array($user_type, $valid_method)) {
					user_authentication($user_type);
                }
                
               
	}
開發者ID:anujjaha,項目名稱:ncybera,代碼行數:30,代碼來源:Controller.php

示例5: Controller

 /**
  * Constructor
  *
  * Calls the initialize() function
  */
 function Controller()
 {
     parent::CI_Base();
     // Assign all the class objects that were instantiated by the
     // bootstrap file (CodeIgniter.php) to local class variables
     // so that CI can run as one big super object.
     foreach (is_loaded() as $var => $class) {
         $this->{$var} =& load_class($class);
     }
     // In PHP 5 the Loader class is run as a discreet
     // class.  In PHP 4 it extends the Controller @PHP4
     if (is_php('5.0.0') == TRUE) {
         $this->load =& load_class('Loader', 'core');
         $this->load->_base_classes =& is_loaded();
         $this->load->_ci_autoloader();
     } else {
         $this->_ci_autoloader();
         // sync up the objects since PHP4 was working from a copy
         foreach (array_keys(get_object_vars($this)) as $attribute) {
             if (is_object($this->{$attribute})) {
                 $this->load->{$attribute} =& $this->{$attribute};
             }
         }
     }
     log_message('debug', "Controller Class Initialized");
 }
開發者ID:unisexx,項目名稱:adf16,代碼行數:31,代碼來源:Controller.php

示例6: array

 function &load_class($class, $directory = 'libraries', $prefix = 'CI_')
 {
     static $_classes = array();
     // Does the class exist?  If so, we're done...
     if (isset($_classes[$class])) {
         return $_classes[$class];
     }
     $name = false;
     // Look for the class first in the local application/libraries folder
     // then in the native system/libraries folder
     foreach (array(APPPATH, STACKCIEXTPATH, BASEPATH) as $path) {
         if (file_exists($path . $directory . '/' . $class . '.php')) {
             $name = $prefix . $class;
             if (class_exists($name) === false) {
                 require $path . $directory . '/' . $class . '.php';
             }
             break;
         }
     }
     // Is the request a class extension?  If so we load it too
     if (file_exists(APPPATH . $directory . '/' . config_item('subclass_prefix') . $class . '.php')) {
         $name = config_item('subclass_prefix') . $class;
         if (class_exists($name) === false) {
             require APPPATH . $directory . '/' . config_item('subclass_prefix') . $class . '.php';
         }
     }
     // Did we find the class?
     if ($name === false) {
         throw new Exception(sprintf('Unable to locate the specified class: %s.php', $class));
     }
     // Keep track of what we just loaded
     is_loaded($class);
     $_classes[$class] = new $name();
     return $_classes[$class];
 }
開發者ID:andrewkrug,項目名稱:repucaution,代碼行數:35,代碼來源:Common.php

示例7: array

function &__load($class, $directory = 'core', $prefix = TF_PREFIX, $from_child = FALSE)
{
    static $_classes = array();
    $class = strtoupper($class);
    $class_name = '';
    $the_path = $from_child === TRUE ? TFUSE_CHILD : TFUSE;
    #check to see if class is already loaded. if true, return class instance from memory
    if (isset($_classes[$class])) {
        return $_classes[$class];
    }
    #look in the classes directory and attempt to load
    $class_name = $prefix . $class;
    if (file_exists($the_path . '/' . $directory . '/' . $class . '.php')) {
        if (class_exists($class_name, FALSE) === FALSE) {
            require_once $the_path . '/' . $directory . '/' . $class . '.php';
        }
    }
    #check if the class has been found, else die
    if (class_exists($class_name, FALSE) === FALSE) {
        exit('Class not found: ' . $class_name);
    }
    #load the class
    is_loaded($class);
    #load the class in the memory array
    $_classes[$class] = new $class_name();
    #finally return the object instance
    return $_classes[$class];
}
開發者ID:shimion,項目名稱:stlucks,代碼行數:28,代碼來源:Common.php

示例8: load_plugin

/**
 * Turns a plugin on and creates the row to show loading
 * @global resource
 * @param string $name name of plugin
 * @return boolean|string
 */
function load_plugin($name)
{
    global $database;
    if ($name == "") {
        return 'error_plugin_no_name';
    } else {
        if (!alpha($name, 'alpha-underscore')) {
            return 'error_plugin_name';
        } else {
            if (!is_loaded($name)) {
                // Insert plugin
                $database->query("INSERT INTO `plugins` SET `name` = '{$name}'");
                // That plugin has been loaded.
                plugin_loaded($name);
                // Include
                include BASEPATH . '../plugins/' . $name . '.php';
                // Install plugin
                if (function_exists('install_' . $name)) {
                    // set it up
                    $function = 'install_' . $name;
                    // initiate it
                    $function();
                }
                // Return true
                return true;
            }
        }
    }
    return 'error_already_loaded';
}
開發者ID:amenski,項目名稱:BookSharing,代碼行數:36,代碼來源:hooks.php

示例9: load_class_inc

function load_class_inc($class, $directory = 'libraries')
{
    static $_classes = array();
    // Does the class exist?  If so, we're done...
    if (isset($_classes[$class])) {
        return $_classes[$class];
    }
    $name = FALSE;
    // Look for the class first in the local application/libraries folder
    // then in the native system/libraries folder
    foreach (array(APPPATH, LIBS_PATH, BASEPATH) as $path) {
        if (file_exists($path . $directory . '/' . $class . '.php')) {
            $name = $prefix . $class;
            if (class_exists($name) === FALSE) {
                require $path . $directory . '/' . $class . '.php';
            }
            break;
        }
    }
    // Did we find the class?
    if ($name === FALSE) {
        exit('Unable to locate the specified class: ' . $class . '.php');
    }
    // Keep track of what we just loaded
    is_loaded($class);
}
開發者ID:PoppyLi,項目名稱:PCMS,代碼行數:26,代碼來源:MY_Common.php

示例10: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     self::$instance =& $this;
     // Assign all the class objects that were instantiated by the
     // bootstrap file (CodeIgniter.php) to local class variables
     // so that CI can run as one big super object.
     foreach (is_loaded() as $var => $class) {
         $this->{$var} =& load_class($class);
     }
     $this->load =& load_class('Loader', 'core');
     $this->load->initialize();
     if ($this->input->get('lang')) {
         $lang = $this->input->get('lang');
         if ($lang == 'en') {
             $this->session->set_userdata('lang', 'en');
         } else {
             $this->session->set_userdata('lang', 'fr');
         }
     }
     $this->language = 'french';
     if ($this->session->userdata('lang') == 'en') {
         $this->language = 'english';
     } else {
         $this->language = 'french';
     }
     $this->lang->load('site', $this->language);
     log_message('debug', "Controller Class Initialized");
 }
開發者ID:n0rp3d,項目名稱:klever,代碼行數:31,代碼來源:Controller.php

示例11: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     self::$instance =& $this;
     // Assign all the class objects that were instantiated by the
     // bootstrap file (CodeIgniter.php) to local class variables
     // so that CI can run as one big super object.
     foreach (is_loaded() as $var => $class) {
         $this->{$var} =& load_class($class);
     }
     $this->load =& load_class('Loader', 'core');
     $this->load->initialize();
     log_message('debug', "Controller Class Initialized");
     //add by Chaiphet S. Check Authorization
     $authorize = $this->session->userdata('userSession');
     if ($this->authorization->checkAuthorize(get_class($this))) {
         if ($authorize == null) {
             $msg = 'Status 501: You have no authentication or your session is time out to access ' . get_class($this);
             $msg .= '<br>Please <a href="' . site_url('authentication') . '">log in</a>';
             show_error($msg, 501);
         } else {
             if (!isset($authorize['controller']) || $authorize['controller'] == null || !in_array(get_class($this), $authorize['controller'])) {
                 show_error('Status 502: You have no authorize to access ' . get_class($this), 502);
             }
         }
     }
 }
開發者ID:rabbiters,項目名稱:TestGitHub,代碼行數:29,代碼來源:Controller.php

示例12: __construct

 /**
  * FA_Controller constructor.
  */
 public function __construct()
 {
     self::$instance =& $this;
     foreach (is_loaded() as $var => $class) {
         $this->{$var} =& load_class($class);
     }
     /**
      * **************************************
      *  Hook "pre_init_controller"
      * **************************************
      */
     $this->hook->action(FA, 'pre_init_controller');
     $this->module = $this->router->module();
     $this->controller = $this->router->controller();
     $this->action = $this->router->action();
     /**
      * Loader class
      */
     $this->load =& load_class('Loader', 'core');
     $this->load->initialize();
     /**
      * Declare model object
      */
     $this->model = new \stdClass();
     /**
      * Declare lib object
      */
     $this->lib = new \stdClass();
     /**
      * Log info
      */
     log_message(MSG_INFO, 'Controller Class Initialized');
 }
開發者ID:kimtung,項目名稱:a,代碼行數:36,代碼來源:FA_Controller.php

示例13: initialize

 /**
  * Initialize the Loader
  *
  * This method is called once in CI_Controller.
  *
  * @param 	array
  * @return 	object
  */
 public function initialize()
 {
     $this->_ci_classes = array();
     $this->_ci_loaded_files = array();
     $this->_ci_models = array();
     $this->_base_classes =& is_loaded();
     $this->_ci_autoloader();
     return $this;
 }
開發者ID:yancanchen,項目名稱:sdf-cms,代碼行數:17,代碼來源:MY_Loader.php

示例14: __construct

 public function __construct()
 {
     self::$instance =& $this;
     foreach (is_loaded() as $var => $class) {
         $this->{$var} =& load_class($class);
     }
     $this->load =& load_class('Loader', 'core');
     $this->load->initialize();
     log_message('debug', "Controller Class Initialized");
 }
開發者ID:adamus1red,項目名稱:SWI,代碼行數:10,代碼來源:Controller.php

示例15: initialize

 /**
  * Initialize the Loader
  *
  * This method is called once in CI_Controller.
  *
  * @param   array
  * @return  object
  */
 public function initialize()
 {
     // 必須在子類中做如下初始化,不可直接 parent::initialize()
     $this->_ci_classes = array();
     $this->_ci_loaded_files = array();
     $this->_ci_models = array();
     $this->_base_classes =& is_loaded();
     $this->_ci_autoloader();
     return $this;
 }
開發者ID:haixingdev,項目名稱:HMVC,代碼行數:18,代碼來源:MY_Loader.php


注:本文中的is_loaded函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。