本文整理汇总了PHP中Conf::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Conf::get_instance方法的具体用法?PHP Conf::get_instance怎么用?PHP Conf::get_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conf
的用法示例。
在下文中一共展示了Conf::get_instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mode
/**
* Returns configured logging mode
*
* @return int Logging mode
*/
static function mode()
{
if (isset(self::$mode)) {
return self::$mode;
}
$conf = Conf::get_instance();
$mode = $conf->get('autodiscover', 'debug_mode');
switch ($mode) {
case self::TRACE:
case 'trace':
case 'TRACE':
self::$mode = self::TRACE;
break;
case self::DEBUG:
case 'debug':
case 'DEBUG':
self::$mode = self::DEBUG;
break;
case self::INFO:
case 'info':
case 'INFO':
self::$mode = self::INFO;
break;
case self::WARNING:
case 'warning':
case 'WARNING':
self::$mode = self::WARNING;
break;
case self::ERROR:
default:
self::$mode = self::ERROR;
}
return self::$mode;
}
示例2: __construct
/**
* Initialization of class instance
*/
public function __construct()
{
require_once __DIR__ . '/Conf.php';
require_once __DIR__ . '/Log.php';
$this->conf = Conf::get_instance();
}
示例3: User
<?php
require_once "/usr/share/kolab-webadmin/lib/functions.php";
require_once "/usr/share/kolab-webadmin/lib/api/kolab_api_service_user_types.php";
$conf = Conf::get_instance();
$primary_domain = $conf->get('kolab', 'primary_domain');
$ldappassword = $conf->get('ldap', 'bind_pw');
$_SESSION['user'] = new User();
$valid = $_SESSION['user']->authenticate("cn=Directory Manager", $ldappassword, $primary_domain);
if ($valid === false) {
die("cannot authenticate user cn=Directory Manager");
}
$auth = Auth::get_instance();
$user_types = new kolab_api_service_user_types(null);
$list = $user_types->user_types_list(null, null);
# copy the entry for kolab
if ($list['list'][1]['key'] != 'kolab') {
echo "failure: expected user type kolab at position 1, but found " . $list['list'][1]['key'] . "\n";
die;
}
$kolabUserType = $list['list'][1];
$kolabUserType['id'] = 1;
$kolabUserType['type'] = 'user';
$kolabUserType['attributes']['fields']['objectclass'][] = 'tbitskolabuser';
$kolabUserType['attributes']['form_fields']['tbitskolablastlogin'] = array('type' => 'text-unixtimestamp', 'optional' => 1);
$kolabUserType['attributes']['form_fields']['tbitskolabisdomainadmin'] = array('type' => 'checkbox', 'optional' => 1);
$kolabUserType['attributes']['form_fields']['tbitskolabmaxaccounts'] = array('type' => 'text', 'optional' => 1);
$kolabUserType['attributes']['form_fields']['tbitskolaboverallquota'] = array('type' => 'text-quota', 'optional' => 1);
$kolabUserType['attributes']['form_fields']['tbitskolabdefaultquota'] = array('type' => 'text-quota', 'optional' => 1);
$service_type = new kolab_api_service_type(null);
if (false === $service_type->type_edit(null, $kolabUserType)) {