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


PHP Tinebase_Config::getInstance方法代码示例

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


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

示例1: 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;
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:12,代码来源:SchemaTool.php

示例2: 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;
 }
开发者ID:rodrigofns,项目名称:ExpressoLivre3,代码行数:13,代码来源:Json.php

示例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,
     }
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:35,代码来源:X509.php

示例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;
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:27,代码来源:View.php

示例5: 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();
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:12,代码来源:NotificationTest.php

示例6: 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');
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:12,代码来源:Release6.php

示例7: 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');
 }
开发者ID:rodrigofns,项目名称:ExpressoLivre3,代码行数:13,代码来源:Release3.php

示例8: 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();
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:15,代码来源:DbmailTest.php

示例9: __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'];
     }
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:13,代码来源:Smtp.php

示例10: 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();
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:13,代码来源:NotificationsTests.php

示例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();
 }
开发者ID:rodrigofns,项目名称:ExpressoLivre3,代码行数:15,代码来源:CyrusTest.php

示例12: __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));
     }
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:15,代码来源:Standard.php

示例13: 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');
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:14,代码来源:Release3.php

示例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');
 }
开发者ID:rodrigofns,项目名称:ExpressoLivre3,代码行数:14,代码来源:Release3.php

示例15: sendPendingAlarms

 /**
  * send pending alarms
  *
  * @param mixed $_eventName
  * @return void
  * 
  * @todo sort alarms (by model/...)?
  * @todo what to do about Tinebase_Model_Alarm::STATUS_FAILURE alarms?
  */
 public function sendPendingAlarms($_eventName)
 {
     $eventName = is_array($_eventName) ? $_eventName['eventName'] : $_eventName;
     $job = Tinebase_AsyncJob::getInstance()->startJob($eventName);
     if (!$job) {
         return;
     }
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' No ' . $eventName . ' is running. Starting new one.');
     }
     try {
         // get all pending alarms
         $filter = new Tinebase_Model_AlarmFilter(array(array('field' => 'alarm_time', 'operator' => 'before', 'value' => Tinebase_DateTime::now()->subMinute(1)->get(Tinebase_Record_Abstract::ISO8601LONG)), array('field' => 'sent_status', 'operator' => 'equals', 'value' => Tinebase_Model_Alarm::STATUS_PENDING)));
         $limit = Tinebase_Config::getInstance()->get(Tinebase_Config::ALARMS_EACH_JOB, 100);
         $pagination = $limit > 0 ? new Tinebase_Model_Pagination(array('limit' => $limit)) : null;
         $alarms = $this->_backend->search($filter, $pagination);
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Sending ' . count($alarms) . ' alarms (limit: ' . $limit . ').');
         }
         // loop alarms and call sendAlarm in controllers
         foreach ($alarms as $alarm) {
             list($appName, $i, $itemName) = explode('_', $alarm->model);
             $appController = Tinebase_Core::getApplicationInstance($appName, $itemName);
             if ($appController instanceof Tinebase_Controller_Alarm_Interface) {
                 $alarm->sent_time = Tinebase_DateTime::now();
                 try {
                     // NOTE: we set the status here, so controller can adopt the status itself
                     $alarm->sent_status = Tinebase_Model_Alarm::STATUS_SUCCESS;
                     $appController->sendAlarm($alarm);
                 } catch (Exception $e) {
                     Tinebase_Exception::log($e);
                     $alarm->sent_message = $e->getMessage();
                     $alarm->sent_status = Tinebase_Model_Alarm::STATUS_FAILURE;
                 }
                 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
                     Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Updating alarm status: ' . $alarm->sent_status);
                 }
                 $this->update($alarm);
             }
         }
         $job = Tinebase_AsyncJob::getInstance()->finishJob($job);
     } catch (Exception $e) {
         // save new status 'failure'
         $job = Tinebase_AsyncJob::getInstance()->finishJob($job, Tinebase_Model_AsyncJob::STATUS_FAILURE, $e->getMessage());
         if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) {
             Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' Job failed: ' . $e->getMessage());
         }
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . $e->getTraceAsString());
         }
     }
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Job ' . $eventName . ' finished.');
     }
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:64,代码来源:Alarm.php


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