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


PHP ConfigManager::instance方法代码示例

本文整理汇总了PHP中ConfigManager::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigManager::instance方法的具体用法?PHP ConfigManager::instance怎么用?PHP ConfigManager::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigManager的用法示例。


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

示例1: ConfigManager

 /**
  * Get the current instance of the ConfigManager or a new one if there is no
  * instance alive.
  * @return ConfigManager
  */
 public static function &getInstance()
 {
     if (ConfigManager::$instance == null) {
         ConfigManager::$instance = new ConfigManager();
     }
     return ConfigManager::$instance;
 }
开发者ID:p1r0,项目名称:MuffinPHP,代码行数:12,代码来源:ConfigManager.php

示例2: singleton

 public static function singleton($args = NULL)
 {
     $name = __CLASS__;
     if (!self::$instance) {
         if (!empty($args)) {
             self::$instance = new $name($args);
         } else {
             self::$instance = null;
         }
     }
     return self::$instance;
 }
开发者ID:jbaicoianu,项目名称:elation,代码行数:12,代码来源:configmanager_class.php

示例3: OsimoPaths

	public function OsimoPaths(){
		parent::OsimoModule();
		$config = array(
			'site_folder' => ConfigManager::instance()->get('site_folder')
		);
		$this->set_options($config);
		
		$this->site_folder = $this->parseFolderPath($this->site_folder);

		$this->site_root = $_SERVER['DOCUMENT_ROOT'].$this->site_folder;
		
		$this->init();
	}
开发者ID:Rastrian,项目名称:Osimo-Forum-System-v2,代码行数:13,代码来源:paths.module.php

示例4: OsimoCache

	function OsimoCache(){
		parent::OsimoModule();
		try{
			$config = ConfigManager::instance()->get('cache');
			$this->set_options($config);
		} catch (Exception $e) {
			$this->enabled = false;
		}			
		
		
		/* Register the cache debugging defaults */
		get('debug')->register('OsimoCache',array(
			'events'=>false
		));
		
		if(class_exists('Memcache')){
			$this->memcache = new Memcache;
		}
		else{
			$this->enabled = false;
		}
		
		$this->init();
	}
开发者ID:Rastrian,项目名称:Osimo-Forum-System-v2,代码行数:24,代码来源:cache.module.php

示例5: loadConfig

 private function loadConfig()
 {
     get('debug')->register('Osimo', array('events' => false, 'object_creation' => false));
     ConfigManager::instance()->load();
 }
开发者ID:Rastrian,项目名称:Osimo-Forum-System-v2,代码行数:5,代码来源:osimo.class.php

示例6: OsimoDB

 /**
  * OsimoDB Constructor.
  *
  * @param Array $options (optional)
  */
 private function OsimoDB()
 {
     parent::OsimoModule(ConfigManager::instance()->get('database'));
     $this->autoconnect = true;
 }
开发者ID:Rastrian,项目名称:Osimo-Forum-System-v2,代码行数:10,代码来源:db2.module.php

示例7: createAdminAccount

function createAdminAccount() {
	ConfigManager::instance()->register_user_config($_SESSION['installConfig']);
	OsimoDB::instance()->init();
	
	try {
		$userID = UserManager::register_user($_POST['user']['username'], $_POST['user']['password'], $_POST['user']['email'], false);
		UserManager::update_user_info($userID, array('is_admin' => 1, 'is_confirmed' => 1));
		
		return true;
	} catch (OsimoException $e) {
		echo json_encode(array("error" => $e->getMessage())); exit;
	}
}
开发者ID:Rastrian,项目名称:Osimo-Forum-System-v2,代码行数:13,代码来源:ajax.php


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