本文整理汇总了PHP中Tinebase_Config类的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Config类的具体用法?PHP Tinebase_Config怎么用?PHP Tinebase_Config使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tinebase_Config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRegistryData
/**
* Returns registry data of admin.
* @see Tinebase_Application_Json_Abstract
*
* @return mixed array 'variable name' => 'data'
*/
public function getRegistryData()
{
$appConfigDefaults = Admin_Controller::getInstance()->getConfigSettings();
$smtpConfig = Tinebase_Config::getInstance()->getConfigAsArray(Tinebase_Config::SMTP);
$registryData = array('manageSAM' => $this->_manageSAM, 'manageImapEmailUser' => $this->_manageImapEmailUser, 'manageSmtpEmailUser' => $this->_manageSmtpEmailUser, 'primarydomain' => array_key_exists('primarydomain', $smtpConfig) ? $smtpConfig['primarydomain'] : '', 'secondarydomains' => array_key_exists('secondarydomains', $smtpConfig) ? $smtpConfig['secondarydomains'] : '', 'defaultPrimaryGroup' => Tinebase_Group::getInstance()->getDefaultGroup()->toArray(), 'defaultInternalAddressbook' => $appConfigDefaults[Admin_Model_Config::DEFAULTINTERNALADDRESSBOOK] !== NULL ? Tinebase_Container::getInstance()->get($appConfigDefaults[Admin_Model_Config::DEFAULTINTERNALADDRESSBOOK])->toArray() : NULL);
return $registryData;
}
示例2: getDBParams
/**
* convert tine20config to dbal config
*
* @return array
*/
public static function getDBParams()
{
$dbParams = Tinebase_Config::getInstance()->get('database')->toArray();
$dbParams['driver'] = $dbParams['adapter'];
$dbParams['user'] = $dbParams['username'];
return $dbParams;
}
示例3: __construct
public function __construct($certificate, $dontSkip = FALSE)
{
$config = Tinebase_Config::getInstance()->get('modssl');
if (is_object($config)) {
$this->casfile = $config->casfile;
$this->crlspath = $config->crlspath;
}
$this->status = array('isValid' => true, 'errors' => array());
$this->certificate = self::_fixPemCertificate($certificate);
$c = openssl_x509_parse($this->certificate);
// define certificate properties
$this->serialNumber = $c['serialNumber'];
$this->version = $c['version'];
$this->subject = $c['subject'];
$this->cn = $c['subject']['CN'];
$this->issuer = $c['issuer'];
$this->issuerCn = $c['issuer']['CN'];
$this->hash = $this->_calcHash();
// $dateTimezone = new DateTimeZone(Tinebase_Core::getUserTimezone());
// $locale = new Zend_Locale($_translation->getAdapter()->getLocale());
// Date valid from
$this->validFrom = Tinebase_Translation::dateToStringInTzAndLocaleFormat(new Tinebase_DateTime($c['validFrom_time_t']));
// Date valid to
$this->validTo = Tinebase_Translation::dateToStringInTzAndLocaleFormat(new Tinebase_DateTime($c['validTo_time_t']));
$this->_parsePurpose($c['purposes']);
$this->_parseExtensions($c['extensions']);
if (strtolower($this->casfile) != 'skip') {
$this->_validityCheck();
// skip validation, we trust the server's result
}
if (strtolower($this->crlspath) != 'skip' | $dontSkip) {
$this->_testRevoked();
// skip test,
}
}
示例4: 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;
}
示例5: update_0
/**
* update to 6.1
* - changepw config option has moved
*/
public function update_0()
{
$changepwSetting = Tinebase_User::getBackendConfiguration('changepw', TRUE);
if (!$changepwSetting) {
Tinebase_Config::getInstance()->set(Tinebase_Config::PASSWORD_CHANGE, FALSE);
}
$this->setApplicationVersion('Tinebase', '6.1');
}
示例6: testGetClientRegistryConfig
/**
* test client config retrival
*
*/
public function testGetClientRegistryConfig()
{
$clientConfig = $this->_instance->getClientRegistryConfig();
$this->assertTrue($clientConfig instanceof Tinebase_Config_Struct, 'clientconfig is not a struct');
$this->assertTrue($clientConfig->Calendar instanceof Tinebase_Config_Struct, 'calendar clientconfig is not a struct');
$this->assertEquals($this->_instance->calendar->fixedCalendars, $clientConfig->Calendar->fixedCalendars->value, 'fixed calendar config not correct');
$this->assertFalse(array_key_exists('SMTP', $clientConfig->Tinebase), 'SMTP is not a client config');
}
示例7: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*/
public function setUp()
{
$smtpConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::SMTP, new Tinebase_Config_Struct())->toArray();
if (empty($smtpConfig)) {
$this->markTestSkipped('No SMTP config found: this is needed to send notifications.');
}
$this->_mailer = Tinebase_Smtp::getDefaultTransport();
}
示例8: update_1
/**
* move ods export config to import export definitions
*
* @return void
*/
public function update_1()
{
// remove Tinebase_Config::ODSEXPORTCONFIG
Tinebase_Config::getInstance()->deleteConfigForApplication('odsexportconfig', 'Timetracker');
// get import export definitions and save them in db
Setup_Controller::getInstance()->createImportExportDefinitions(Tinebase_Application::getInstance()->getApplicationByName('Timetracker'));
$this->setApplicationVersion('Timetracker', '3.2');
}
示例9: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->_backend = Tinebase_User::getInstance();
if (!array_key_exists('Tinebase_EmailUser_Imap_Dbmail', $this->_backend->getPlugins())) {
$this->markTestSkipped('Dbmail MySQL plugin not enabled');
}
$this->_config = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP, new Tinebase_Config_Struct())->toArray();
$this->objects['users'] = array();
}
示例10: __construct
/**
* the constructor
*
*/
public function __construct()
{
$smtpConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::SMTP, new Tinebase_Config_Struct(array()))->toArray();
$this->_fromAddress = isset($smtpConfig['from']) && !empty($smtpConfig['from']) ? $smtpConfig['from'] : '';
// try to sanitize sender address
if (empty($this->_fromAddress) && isset($smtpConfig['primarydomain']) && !empty($smtpConfig['primarydomain'])) {
$this->_fromAddress = 'noreply@' . $smtpConfig['primarydomain'];
}
}
示例11: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->_backend = Tinebase_User::getInstance();
if (!array_key_exists('Tinebase_EmailUser_Imap_Cyrus', $this->_backend->getPlugins())) {
$this->markTestSkipped('Cyrus IMAP plugin not enabled');
}
$this->_config = Tinebase_Config::getInstance()->getConfigAsArray(Tinebase_Config::IMAP);
$this->objects['users'] = array();
}
示例12: setUp
/**
* (non-PHPdoc)
* @see tests/tine20/Crm/AbstractTest::setUp()
*/
public function setUp()
{
parent::setUp();
$smtpConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::SMTP, new Tinebase_Config_Struct())->toArray();
if (empty($smtpConfig)) {
$this->markTestSkipped('No SMTP config found: this is needed to send notifications.');
}
$this->_leadController = Crm_Controller_Lead::getInstance();
}
示例13: __construct
/**
* the constructor
*
* @param array $_options
*/
public function __construct(array $_options = array())
{
// get email user backend config options (host, dbname, username, password, port)
$emailConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP, new Tinebase_Config_Struct())->toArray();
// merge _config and email backend config
$this->_config = array_merge($this->_config, $emailConfig);
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . print_r($this->_config, TRUE));
}
}
示例14: update_2
/**
* update function (-> 3.3)
* - renamed config useAsDefault -> useSystemAccount
*/
public function update_2()
{
$imapConfig = Tinebase_Config::getInstance()->getConfigAsArray(Tinebase_Config::IMAP);
if (array_key_exists('useAsDefault', $imapConfig)) {
$imapConfig['useSystemAccount'] = $imapConfig['useAsDefault'];
unset($imapConfig['useAsDefault']);
Tinebase_Config::getInstance()->setConfigForApplication(Tinebase_Config::IMAP, Zend_Json::encode($imapConfig));
}
$this->setApplicationVersion('Felamimail', '3.3');
}
示例15: update_2
/**
* update function (-> 3.3)
* - renamed config useAsDefault -> useSystemAccount
*/
public function update_2()
{
$imapConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::IMAP, new Tinebase_Config_Struct())->toArray();
if (isset($imapConfig['useAsDefault']) || array_key_exists('useAsDefault', $imapConfig)) {
$imapConfig['useSystemAccount'] = $imapConfig['useAsDefault'];
unset($imapConfig['useAsDefault']);
Tinebase_Config::getInstance()->set(Tinebase_Config::IMAP, $imapConfig);
}
$this->setApplicationVersion('Felamimail', '3.3');
}