本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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();
}
示例5: loadConfig
private function loadConfig()
{
get('debug')->register('Osimo', array('events' => false, 'object_creation' => false));
ConfigManager::instance()->load();
}
示例6: OsimoDB
/**
* OsimoDB Constructor.
*
* @param Array $options (optional)
*/
private function OsimoDB()
{
parent::OsimoModule(ConfigManager::instance()->get('database'));
$this->autoconnect = true;
}
示例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;
}
}