• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP load_class函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中load_class函数的典型用法代码示例。如果您正苦于以下问题:PHP load_class函数的具体用法?PHP load_class怎么用?PHP load_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了load_class函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: filter_regions

/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_regions(&$Form)
{
    load_class('regional/model/_country.class.php', 'Country');
    $CountryCache =& get_CountryCache(NT_('All'));
    $Form->select_country('c', get_param('c'), $CountryCache, T_('Country'), array('allow_none' => true));
    $Form->text('s', get_param('s'), 30, T_('Search'), '', 255);
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:12,代码来源:_region_list.view.php


示例2: __construct

 /**
  * Check & Set URI resource to determine the side of application
  *
  */
 public function __construct()
 {
     parent::__construct();
     $uri =& load_class('URI', 'core');
     $admin = $uri->segment(1);
     $this->is_admin = $admin == 'administrator' || $admin == 'admin' ? true : false;
 }
开发者ID:NaszvadiG,项目名称:bootigniter,代码行数:11,代码来源:AZ_Loader.php


示例3: login

 /**
  * 做一个login
  */
 public function login()
 {
     if (IS_AJAX && 'submit' == I('post.submit')) {
         //login 操作
         $username = I('post.username');
         $userpass = I('post.userpass');
         //表单令牌
         if (token_check() == false) {
             printJson(array('tk' => form_token()), 1, '请求超时,请重试');
         }
         $mod = Factory::getModel('bt_user');
         $where = sprintf("username='%s' AND deleted=0", $username);
         $row = $mod->field('id,userpass,salt')->where($where)->find();
         if (empty($row)) {
             printJson(array('tk' => form_token()), 1, '账号不存在');
         }
         if ($row['userpass'] != md5($userpass . $row['salt'])) {
             printJson(array('tk' => form_token()), 1, '账号或者密码不正确');
         }
         $row['username'] = $username;
         session_regenerate_id();
         $user_cls = load_class('UserModel');
         $user_cls->setSessionUser($row);
         printJson(1);
     }
     $turl = urldecode(I('get.url', url('DiskTop', 'index')));
     $this->assign('turl', $turl);
     $this->display();
 }
开发者ID:zhongyu2005,项目名称:demo,代码行数:32,代码来源:Index.class.php


示例4: cache_select

 public function cache_select()
 {
     $uid = $_SESSION['uid'];
     if (isset($GLOBALS['setcache'])) {
         $ids = get_cache('cache_all-' . $uid);
     } else {
         if (!isset($GLOBALS['ids']) || empty($GLOBALS['ids'])) {
             $where = array('keyid' => 'cache_all');
             $result = $this->db->get_list('setting', $where, '*', 0, 100);
             $ids = array();
             foreach ($result as $r) {
                 $ids[] = $r['id'];
             }
         } else {
             $ids = array_map('intval', $GLOBALS['ids']);
         }
         set_cache('cache_all-' . $uid, $ids);
     }
     if (empty($ids)) {
         MSG('缓存更新完成', '?m=core&f=cache_all&v=index' . $this->su(), 2000);
     }
     $id = array_shift($ids);
     $r = $this->db->get_one('setting', array('id' => $id));
     $caches = load_class($r['f'], $r['m']);
     if ($caches->{$r}['v']()) {
         set_cache('cache_all-' . $uid, $ids);
         MSG($r['data'] . L('update success'), '?m=core&f=cache_all&v=cache_select&setcache=1&' . $this->su(), 200);
     } else {
         MSG(L('operation failure'));
     }
 }
开发者ID:another3000,项目名称:wuzhicms,代码行数:31,代码来源:cache_all.php


示例5: load_class

 /**
  * Base loader method, uses a directive, unlike the global loader function
  * @param string Class directive as `[class].[type]`
  * @return class object
  **/
 protected function load_class($class)
 {
     $class = strtolower($class);
     $type = null;
     $_pieces = explode(self::DIRECTIVE_DELIMITER, $class);
     switch (count($_pieces)) {
         case 1:
             $class = $_pieces[0];
             $type = $class;
             break;
         case 2:
             $class = $_pieces[1];
             $type = $_pieces[0];
             break;
         case 0:
             throw new RuntimeException('class to load not specified');
             break;
         default:
             throw new RuntimeException('class directive not supported');
             break;
     }
     if (!isset($this->{$class})) {
         $this->{$class} =& load_class($class, true, $type);
     }
     $this->is_loaded[] = $class;
     return $this->{$class};
 }
开发者ID:WurdahMekanik,项目名称:hlf-ndxz,代码行数:32,代码来源:core.php


示例6: _initialize

 function _initialize()
 {
     $CFG =& load_class('Config', 'core');
     // If hooks are not enabled in the config file
     // there is nothing else to do
     if ($CFG->item('enable_hooks') == FALSE) {
         return;
     }
     // Grab the "hooks" definition file.
     // If there are no hooks, we're done.
     if (defined('ENVIRONMENT') and is_file(ARCHPATH . 'config/' . ENVIRONMENT . '/hooks.php')) {
         include ARCHPATH . 'config/' . ENVIRONMENT . '/hooks.php';
     } elseif (is_file(ARCHPATH . 'config/hooks.php')) {
         include ARCHPATH . 'config/hooks.php';
     }
     if (defined('ENVIRONMENT') and is_file(APPPATH . 'config/' . ENVIRONMENT . '/hooks.php')) {
         include APPPATH . 'config/' . ENVIRONMENT . '/hooks.php';
     } elseif (is_file(APPPATH . 'config/hooks.php')) {
         include APPPATH . 'config/hooks.php';
     }
     if (!isset($hook) or !is_array($hook)) {
         return;
     }
     $this->hooks =& $hook;
     $this->enabled = TRUE;
 }
开发者ID:rip-projects,项目名称:ark-php,代码行数:26,代码来源:MY_Hooks.php


示例7: parse_bbcode

 public static function parse_bbcode($text)
 {
     if (!$text) {
         return false;
     }
     return self::parse_links(load_class('Services_BBCode')->parse($text));
 }
开发者ID:lincoln2015,项目名称:18duchengxuyuan_server,代码行数:7,代码来源:cls_format.inc.php


示例8: _initialize

 /**
  * Initialize the Hooks Preferences
  *
  * @access	private
  * @return	void
  */
 function _initialize()
 {
     $CFG =& load_class('Config', 'core');
     // If hooks are not enabled in the config file
     // there is nothing else to do
     if ($CFG->item('enable_hooks') == FALSE) {
         return;
     }
     $look_in_dirs = $CFG->look_in_dirs();
     // Grab the "hooks" definition file.
     // If there are no hooks, we're done.
     if (defined('ENVIRONMENT') and is_file(APPPATH . 'config/' . ENVIRONMENT . '/hooks.php')) {
         include APPPATH . 'config/' . ENVIRONMENT . '/hooks.php';
     } else {
         $hook_files = array(NTS_SYSTEM_APPPATH . 'config/hooks.php', APPPATH . 'config/hooks.php');
         reset($look_in_dirs);
         foreach ($look_in_dirs as $dir) {
             $hf = $dir . '/config/hooks.php';
             if (file_exists($hf)) {
                 require $hf;
             }
         }
     }
     if (!isset($hook) or !is_array($hook)) {
         return;
     }
     $this->hooks =& $hook;
     $this->enabled = TRUE;
 }
开发者ID:RCMmedia,项目名称:rubicon,代码行数:35,代码来源:MY_Hooks.php


示例9: __construct

 /**
  * Class constructor
  * @return    void
  */
 public function __construct()
 {
     $CFG =& load_class('Config', 'core');
     log_message('info', 'Hooks Class Initialized');
     if ($CFG->item('enable_hooks') === FALSE) {
         return;
     }
     if (file_exists(COMMONPATH . 'config/hooks.php')) {
         include COMMONPATH . 'config/hooks.php';
     }
     if (file_exists(COMMONPATH . 'config/' . ENVIRONMENT . '/hooks.php')) {
         include COMMONPATH . 'config/' . ENVIRONMENT . '/hooks.php';
     }
     if (file_exists(APPPATH . 'config/hooks.php')) {
         include APPPATH . 'config/hooks.php';
     }
     if (file_exists(APPPATH . 'config/' . ENVIRONMENT . '/hooks.php')) {
         include APPPATH . 'config/' . ENVIRONMENT . '/hooks.php';
     }
     if (!isset($hook) || !is_array($hook)) {
         return;
     }
     $this->hooks =& $hook;
     $this->enabled = TRUE;
 }
开发者ID:patilstar,项目名称:HMVC-WITH-CI,代码行数:29,代码来源:Core_Hooks.php


示例10: __construct

 public function __construct()
 {
     self::$obj =& $this;
     foreach (is_load() as $key => $value) {
         $this->{$key} =& load_class($value);
     }
 }
开发者ID:Topthinking,项目名称:ci_study,代码行数:7,代码来源:core.php


示例11: index

 function index()
 {
     $form = load_class('form');
     echo '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>Plupload - Events example</title>';
     echo $form->upload('insert_file_callback');
     //include T('attachment','upload','default');
 }
开发者ID:another3000,项目名称:wuzhicms,代码行数:7,代码来源:upload.php


示例12: getRoute

 /**
  * Get Route including 404 check
  *
  * @see core/CodeIgniter.php
  *
  * @return array   [class, method, pararms]
  */
 public function getRoute()
 {
     $RTR =& load_class('Router', 'core');
     $URI =& load_class('URI', 'core');
     $e404 = FALSE;
     $class = ucfirst($RTR->class);
     $method = $RTR->method;
     if (empty($class) or !file_exists(APPPATH . 'controllers/' . $RTR->directory . $class . '.php')) {
         $e404 = TRUE;
     } else {
         require_once APPPATH . 'controllers/' . $RTR->directory . $class . '.php';
         if (!class_exists($class, FALSE) or $method[0] === '_' or method_exists('CI_Controller', $method)) {
             $e404 = TRUE;
         } elseif (method_exists($class, '_remap')) {
             $params = array($method, array_slice($URI->rsegments, 2));
             $method = '_remap';
         } elseif (!in_array(strtolower($method), array_map('strtolower', get_class_methods($class)), TRUE)) {
             $e404 = TRUE;
         }
     }
     if ($e404) {
         // If 404, CodeIgniter instance is not created yet. So create it here.
         // Because we need CI->output->_status
         $CI =& get_instance();
         if ($CI instanceof CIPHPUnitTestNullCodeIgniter) {
             CIPHPUnitTest::createCodeIgniterInstance();
         }
         show_404($RTR->directory . $class . '/' . $method . ' is not found');
     }
     if ($method !== '_remap') {
         $params = array_slice($URI->rsegments, 2);
     }
     return [$class, $method, $params];
 }
开发者ID:kenjis,项目名称:ci-hmvc-ci-phpunit-test,代码行数:41,代码来源:CIPHPUnitTestRouter.php


示例13: 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


示例14: __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


示例15: __construct

 public function __construct()
 {
     $this->config =& load_class('Config', 'core');
     $this->config->load('triggers', TRUE);
     $this->uri =& load_class('URI', 'core');
     log_message('debug', "Router Class Initialized");
 }
开发者ID:68kb,项目名称:68kb,代码行数:7,代码来源:MY_Router.php


示例16: createTrace

 public function createTrace($type = null, $message = null, $file = null, $line = null, $custom_data = array())
 {
     if (empty($type)) {
         $e = error_get_last();
         if (!empty($e)) {
             $message = $e['message'];
             $file = $e['file'];
             $type = $e['type'];
             $line = $e['line'];
         }
     }
     if (!empty($type)) {
         $levels = array(E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice');
         // Set error type
         $type = isset($levels[$type]) ? $levels[$type] : 'Unknown';
         // Fetch router
         $router =& load_class('Router', 'core');
         // Set up the trace file (1 level is better than none)
         $trace = array();
         $trace[0] = array();
         $trace[0]['function'] = $router->fetch_method();
         $trace[0]['class'] = $router->fetch_class();
         $trace[0]['type'] = $type;
         $trace[0]['args'] = array();
         $trace[0]['file'] = $file;
         $trace[0]['line'] = $line;
         // Send to airbrake
         self::sendToTracker($type . ': ' . $message, $type, $trace, $custom_data);
     }
 }
开发者ID:iweave,项目名称:unmark,代码行数:30,代码来源:Exceptional.php


示例17: __construct

 function __construct()
 {
     //allow mongo to use 64bit ints
     ini_set('mongo.native_long', 1);
     // Fetch CodeIgniter instance
     $ci = get_instance();
     // Load Mongo configuration file
     $ci->load->config('mongo');
     // Fetch Mongo server and database configuration
     $server = $ci->config->item('mongo_server');
     $username = $ci->config->item('mongo_username');
     $password = $ci->config->item('mongo_password');
     $dbname = $ci->config->item('mongo_dbname');
     try {
         if ($ci->config->item('mongo_auth') === FALSE) {
             parent::__construct("mongodb://" . $server . "/" . $dbname);
         } else {
             parent::__construct("mongodb://{$username}:{$password}@{$server}/{$dbname}");
         }
         $this->db = $this->{$dbname};
     } catch (MongoConnectionException $e) {
         //Don't show Mongo Exceptions as they can contain authentication info
         $_error =& load_class('Exceptions', 'core');
         exit($_error->show_error('MongoDB Connection Error', 'A MongoDB error occured while trying to connect to the database!', 'error_db'));
     } catch (Exception $e) {
         $_error =& load_class('Exceptions', 'core');
         exit($_error->show_error('MongoDB Error', $e->getMessage(), 'error_db'));
     }
 }
开发者ID:nodecast,项目名称:projectNarwhal,代码行数:29,代码来源:Mongo.php


示例18: _initialize

	/**
	 * Initialize the Hooks Preferences
	 *
	 * @access	private
	 * @return	void
	 */
	function _initialize()
	{
		$CFG =& load_class('Config', 'core');

		// If hooks are not enabled in the config file
		// there is nothing else to do

		if ($CFG->item('enable_hooks') == FALSE)
		{
			return;
		}

		// Grab the "hooks" definition file.
		// If there are no hooks, we're done.

		@include(APPPATH.'config/hooks'.EXT);

		if ( ! isset($hook) OR ! is_array($hook))
		{
			return;
		}

		$this->hooks =& $hook;
		$this->enabled = TRUE;
	}
开发者ID:rodrigowebe,项目名称:FUEL-CMS,代码行数:31,代码来源:MY_Hooks.php


示例19: post_controller_constructor_cache

 /**
  * Called just after each controller instanciation
  * Displays or not the full page cache
  *
  */
 function post_controller_constructor_cache()
 {
     $CI =& get_instance();
     $CFG =& load_class('Config');
     $URI =& load_class('URI');
     $OUT =& load_class('Output');
     // No cache if :
     // - If some POST data are sent
     // - Admin URL
     // - User logged in
     if (!empty($_POST) or Connect()->logged_in() != FALSE or $URI->segments[1] == config_item('admin_url')) {
         // Regenerate the page
         return FALSE;
     }
     // Retrieve the complete URI with language code
     $URI->_fetch_uri_string();
     /*
      * HERE : 	Outputs the Cache()->get_page_cache()
      * 			If cache file not found returns false, but do not write the cache file
      *			Writin gof the cache file is done by Base_Controller()->render() depending on the page settings.
      *
      */
     /*
     		if ($OUT->_display_cache($CFG, $URI) == TRUE)
     			exit;
     */
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:32,代码来源:Cache.php


示例20: pay_callback

 function pay_callback()
 {
     $api = load_class('pay_callback', 'order');
     if ($api->update('20150120237490658')) {
         echo 'ok';
     }
 }
开发者ID:haizhilin2013,项目名称:wuzhicms,代码行数:7,代码来源:test.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP load_conf_from_db函数代码示例发布时间:2022-05-15
下一篇:
PHP load_child_theme_textdomain函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap