本文整理汇总了PHP中Tinebase_Core::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Core::getConfig方法的具体用法?PHP Tinebase_Core::getConfig怎么用?PHP Tinebase_Core::getConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Core
的用法示例。
在下文中一共展示了Tinebase_Core::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
/**
* create new user session
*
* @param string $_loginname
* @param string $_password
* @param string $_ipAddress
* @param string $_clientIdString
* @param string $securitycode the security code(captcha)
* @return bool
*/
public function login($_loginname, $_password, $_ipAddress, $_clientIdString = NULL, $securitycode = NULL)
{
if (isset(Tinebase_Core::getConfig()->captcha->count) && Tinebase_Core::getConfig()->captcha->count != 0) {
if ($_SESSION['tinebase']['code'] != $securitycode) {
return FALSE;
}
}
$authResult = Tinebase_Auth::getInstance()->authenticate($_loginname, $_password);
$accessLog = new Tinebase_Model_AccessLog(array('sessionid' => session_id(), 'ip' => $_ipAddress, 'li' => Tinebase_DateTime::now()->get(Tinebase_Record_Abstract::ISO8601LONG), 'result' => $authResult->getCode(), 'clienttype' => $_clientIdString), TRUE);
$user = NULL;
if ($accessLog->result == Tinebase_Auth::SUCCESS) {
$user = $this->_getLoginUser($authResult->getIdentity(), $accessLog);
if ($user !== NULL) {
$this->_checkUserStatus($user, $accessLog);
}
}
if ($accessLog->result === Tinebase_Auth::SUCCESS && $user !== NULL && $user->accountStatus === Tinebase_User::STATUS_ENABLED) {
$this->_initUser($user, $accessLog, $_password);
$result = true;
} else {
$this->_loginFailed($_loginname, $accessLog);
$_SESSION['tinebase']['code'] = 'code';
$result = false;
}
Tinebase_AccessLog::getInstance()->create($accessLog);
return $result;
}
示例2: factory
/**
* factory function to return a selected phone backend class
*
* @param string $_type
* @return Phone_Backend_Interface
* @throws Phone_Exception_InvalidArgument
* @throws Phone_Exception_NotFound
*/
public static function factory($_type)
{
switch ($_type) {
case self::ASTERISK:
if (!isset(self::$_backends[$_type])) {
if (isset(Tinebase_Core::getConfig()->asterisk)) {
$asteriskConfig = Tinebase_Core::getConfig()->asterisk;
$url = $asteriskConfig->managerbaseurl;
$username = $asteriskConfig->managerusername;
$password = $asteriskConfig->managerpassword;
} else {
throw new Phone_Exception_NotFound('No settings found for asterisk backend in config file!');
}
self::$_backends[$_type] = Phone_Backend_Asterisk::getInstance($url, $username, $password);
}
$instance = self::$_backends[$_type];
break;
case self::CALLHISTORY:
if (!isset(self::$_backends[$_type])) {
self::$_backends[$_type] = new Phone_Backend_Snom_Callhistory();
}
$instance = self::$_backends[$_type];
break;
case self::SNOM_WEBSERVER:
if (!isset(self::$_backends[$_type])) {
self::$_backends[$_type] = new Phone_Backend_Snom_Webserver();
}
$instance = self::$_backends[$_type];
break;
default:
throw new Phone_Exception_InvalidArgument('Unsupported phone backend (' . $_type . ').');
}
return $instance;
}
示例3: getThemeConfig
public static function getThemeConfig()
{
$extJS = 'ext-all.css';
$themePath = 'tine20';
$favicon = 'images/favicon.ico';
$title = 'Tine 2.0';
$themeConfig = Tinebase_Core::getConfig()->theme;
if ($themeConfig instanceof Tinebase_Config_Struct && $themeConfig->active) {
if ($themeConfig->path) {
$themePath = $themeConfig->path;
//is useBlueAsBase set?
if ($themeConfig->useBlueAsBase) {
$extJS = 'ext-all-notheme.css';
}
//is there a customized favicon?
if (file_exists('themes/' . $themePath . '/resources/images/favicon.ico')) {
$favicon = 'themes/' . $themePath . '/resources/images/favicon.ico';
}
}
}
//Do we have a branding favicon?
$favicon = Tinebase_Config::getInstance()->get(Tinebase_Config::BRANDING_FAVICON) ? Tinebase_Config::getInstance()->get(Tinebase_Config::BRANDING_FAVICON) : $favicon;
//Do we have a branding title?
$title = Tinebase_Config::getInstance()->get(Tinebase_Config::BRANDING_TITLE) ? Tinebase_Config::getInstance()->get(Tinebase_Config::BRANDING_TITLE) : $title;
$result = array('favicon' => $favicon, 'extJs' => '<link rel="stylesheet" type="text/css" href="library/ExtJS/resources/css/' . $extJS . '" />', 'themePath' => '<link rel="stylesheet" type="text/css" href="themes/' . $themePath . '/resources/css/' . $themePath . '.css" />', 'title' => $title);
return $result;
}
示例4: __construct
/**
* constructor
*
* @see http://framework.zend.com/manual/en/zend.queue.adapters.html for config options
*/
private function __construct()
{
if (isset(Tinebase_Core::getConfig()->actionqueue)) {
$options = Tinebase_Core::getConfig()->actionqueue->toArray();
$adapter = array_key_exists('adapter', $options) ? $options['adapter'] : 'Db';
unset($options['adapter']);
$options['name'] = array_key_exists('name', $options) ? $options['name'] : 'tine20actionqueue';
switch ($adapter) {
case 'Redis':
$options['adapterNamespace'] = 'Rediska_Zend_Queue_Adapter';
$options['driverOptions'] = array_key_exists('driverOptions', $options) ? $options['driverOptions'] : array('namespace' => 'Application_');
break;
case 'Db':
// use default db settings if empty
$options['driverOptions'] = array_key_exists('driverOptions', $options) ? $options['driverOptions'] : Tinebase_Core::getConfig()->database->toArray();
if (!array_key_exists('type', $options['driverOptions'])) {
$options['driverOptions']['type'] = array_key_exists('adapter', $options['driverOptions']) ? $options['driverOptions']['adapter'] : 'pdo_mysql';
}
break;
}
try {
$this->_queue = new Zend_Queue($adapter, $options);
} catch (Zend_Db_Adapter_Exception $zdae) {
throw new Tinebase_Exception_Backend_Database('Could not connect to queue DB: ' . $zdae->getMessage());
}
}
}
示例5: __construct
/**
* the constructor
*
* @param Zend_Db_Adapter_Abstract $_db (optional)
* @param array $_options (optional)
*/
public function __construct($_dbAdapter = NULL, $_options = array())
{
parent::__construct($_dbAdapter, $_options);
// set default adapter
$config = Tinebase_Core::getConfig();
$adapter = $config->{Tinebase_Auth_CredentialCache_Adapter_Config::CONFIG_KEY} ? 'Config' : 'Cookie';
$this->setCacheAdapter($adapter);
}
示例6: __construct
/**
* the constructor
*/
public function __construct()
{
$this->_fileObjectBackend = new Tinebase_Tree_FileObject();
$this->_treeNodeBackend = new Tinebase_Tree_Node();
if (!Tinebase_Core::isFilesystemAvailable()) {
throw new Tinebase_Exception_Backend('No base path (filesdir) configured or path not writeable');
}
$this->_basePath = Tinebase_Core::getConfig()->filesdir;
}
示例7: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
if (empty(Tinebase_Core::getConfig()->filesdir)) {
$this->markTestSkipped('filesystem base path not found');
}
Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
Tinebase_FileSystem::getInstance()->initializeApplication(Tinebase_Application::getInstance()->getApplicationByName('Addressbook'));
clearstatcache();
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:15,代码来源:RecordAttachmentsTest.php
示例8: update_0
/**
* update from 2.0 -> 2.1
* - get crm default settings from config and write them to db
*
* @return void
*/
public function update_0()
{
$config = Tinebase_Core::getConfig();
if (isset($config->crm)) {
$defaults = array('leadstate_id' => isset($config->crm->defaultstate) ? Tinebase_Core::getConfig()->crm->defaultstate : 1, 'leadtype_id' => isset($config->crm->defaulttype) ? Tinebase_Core::getConfig()->crm->defaulttype : 1, 'leadsource_id' => isset($config->crm->defaultsource) ? Tinebase_Core::getConfig()->crm->defaultsource : 1);
Tinebase_Config::getInstance()->setConfigForApplication(Tinebase_Config::APPDEFAULTS, Zend_Json::encode($defaults), 'Crm');
}
$this->setApplicationVersion('Crm', '2.1');
}
示例9: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
if (empty(Tinebase_Core::getConfig()->filesdir)) {
$this->markTestSkipped('filesystem base path not found');
}
Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
$this->_basePath = 'tine20:///' . Tinebase_Application::getInstance()->getApplicationByName('Tinebase')->getId() . '/internal/phpunit';
Tinebase_FileSystem::getInstance()->initializeApplication(Tinebase_Application::getInstance()->getApplicationByName('Tinebase'));
clearstatcache();
}
示例10: __construct
/**
* the constructor
*
* don't use the constructor. use the singleton
*/
private function __construct()
{
$this->_applicationName = 'Billing';
$this->_backend = new Billing_Backend_Bank();
$this->_modelName = 'Billing_Model_Bank';
$this->_currentAccount = Tinebase_Core::getUser();
$this->_purgeRecords = FALSE;
$this->_doContainerACLChecks = FALSE;
$this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());
}
示例11: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
if (!extension_loaded('redis')) {
$this->markTestSkipped('redis extension not found');
}
if (!isset(Tinebase_Core::getConfig()->actionqueue) || !isset(Tinebase_Core::getConfig()->actionqueue->backend) || ucfirst(strtolower(Tinebase_Core::getConfig()->actionqueue->backend)) != Tinebase_ActionQueue::BACKEND_REDIS) {
$this->markTestSkipped('no redis actionqueue configured');
}
Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
}
示例12: getInstance
/**
* the singleton pattern
*
* @return Felamimail_Controller_Cache_Folder
*/
public static function getInstance()
{
if (self::$_instance === NULL) {
$adapter = Tinebase_Core::getConfig()->messagecache;
$adapter = empty($adapter) ? 'sql' : $adapter;
$classname = 'Felamimail_Controller_Cache_' . ucfirst($adapter) . '_Folder';
self::$_instance = $classname::getInstance();
}
return self::$_instance;
}
示例13: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
if (empty(Tinebase_Core::getConfig()->filesdir)) {
$this->markTestSkipped('filesystem base path not found');
}
Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
$this->_controller = new Tinebase_FileSystem();
$this->_basePath = '/' . Tinebase_Application::getInstance()->getApplicationByName('Tinebase')->getId() . '/folders/' . Tinebase_Model_Container::TYPE_SHARED;
$this->_controller->initializeApplication(Tinebase_Application::getInstance()->getApplicationByName('Tinebase'));
}
示例14: tearDown
public function tearDown()
{
// kill daemon
$daemonpid = file_get_contents($this->_daemonPid);
$killCommand = 'kill ' . $daemonpid;
exec($killCommand);
unlink($this->_daemonLog);
unlink($this->_configIni);
// restore actionqueueconfig
Tinebase_Core::getConfig()->actionqueue = $this->_actionQueueConfigBackup;
}
示例15: getDefaultKey
/**
* getDefaultKey() - get default cache key
* @return string
* @throws Tinebase_Exception_NotFound
*/
public function getDefaultKey()
{
$result = NULL;
$config = Tinebase_Core::getConfig();
if ($config->{self::CONFIG_KEY}) {
$result = $config->{self::CONFIG_KEY};
} else {
throw new Tinebase_Exception_NotFound('No credential cache key found in config!');
}
return $result;
}