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


PHP Tinebase_Exception::log方法代码示例

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


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

示例1: validate

 public function validate($username, $password)
 {
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Options: ' . print_r($this->_options, true));
     }
     $url = isset($this->_options['url']) ? $this->_options['url'] : 'https://localhost/validate/check';
     $adapter = new Zend_Http_Client_Adapter_Socket();
     $adapter->setStreamContext($this->_options = array('ssl' => array('verify_peer' => isset($this->_options['ignorePeerName']) ? false : true, 'allow_self_signed' => isset($this->_options['allowSelfSigned']) ? true : false)));
     $client = new Zend_Http_Client($url, array('maxredirects' => 0, 'timeout' => 30));
     $client->setAdapter($adapter);
     $params = array('user' => $username, 'pass' => $password);
     $client->setParameterPost($params);
     try {
         $response = $client->request(Zend_Http_Client::POST);
     } catch (Zend_Http_Client_Adapter_Exception $zhcae) {
         Tinebase_Exception::log($zhcae);
         return Tinebase_Auth::FAILURE;
     }
     $body = $response->getBody();
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Request: ' . $client->getLastRequest());
     }
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Response: ' . $body);
     }
     if ($response->getStatus() !== 200) {
         return Tinebase_Auth::FAILURE;
     }
     $result = Tinebase_Helper::jsonDecode($body);
     if (isset($result['result']) && $result['result']['status'] === true && $result['result']['value'] === true) {
         return Tinebase_Auth::SUCCESS;
     } else {
         return Tinebase_Auth::FAILURE;
     }
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:35,代码来源:PrivacyIdea.php

示例2: getCoreData

 public function getCoreData()
 {
     try {
         $result = CoreData_Controller::getInstance()->getCoreData()->toArray();
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
         $result = array();
     }
     return array('results' => $result, 'totalcount' => count($result));
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:10,代码来源:Json.php

示例3: update_1

 /**
  * update to 7.2
  * - add uid field
  */
 public function update_1()
 {
     $this->validateTableVersion('tasks', 6);
     // first add with notnull == false ...
     $declaration = new Setup_Backend_Schema_Field_Xml('
         <field>
             <name>uid</name>
             <type>text</type>
             <length>255</length>
             <notnull>false</notnull>
         </field>
     ');
     try {
         $this->_backend->addCol('tasks', $declaration);
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
     }
     $tasksBackend = new Tinebase_Backend_Sql(array('modelName' => 'Tasks_Model_Task', 'tableName' => 'tasks'));
     $allTasks = $tasksBackend->getAll();
     // add uid to all tasks
     foreach ($allTasks as $task) {
         $task->uid = $task->id;
         if (empty($task->status)) {
             $task->status = 'UNKNOWN';
         }
         $tasksBackend->update($task);
     }
     // ... now set notnull to true
     $declaration = new Setup_Backend_Schema_Field_Xml('
         <field>
             <name>uid</name>
             <type>text</type>
             <length>255</length>
             <notnull>true</notnull>
         </field>
     ');
     $this->_backend->alterCol('tasks', $declaration);
     $declaration = new Setup_Backend_Schema_Index_Xml('
         <index>
             <name>uid--id</name>
             <field>
                 <name>uid</name>
             </field>
             <field>
                 <name>id</name>
             </field>
         </index>
     ');
     $this->_backend->addIndex('tasks', $declaration);
     $this->setTableVersion('tasks', 7);
     $this->setApplicationVersion('Tasks', '7.2');
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:56,代码来源:Release7.php

示例4: _createGroups

 /**
  * creates the groups if not created already
  */
 protected function _createGroups()
 {
     $fe = new Admin_Frontend_Json();
     $internalAddressbook = Tinebase_Container::getInstance()->getContainerByName('Addressbook', 'Internal Contacts', Tinebase_Model_Container::TYPE_SHARED);
     foreach ($this->_groups as $groupArray) {
         $groupArray['container_id'] = $internalAddressbook->getId();
         $members = array();
         foreach ($groupArray['groupMembers'] as $member) {
             $members[] = $this->_personas[$member]->getId();
         }
         try {
             $this->_groups[$groupArray['groupData']['name']] = $fe->saveGroup($groupArray['groupData'], $members);
         } catch (Exception $e) {
             Tinebase_Exception::log($e);
             echo 'Group "' . $groupArray['groupData']['name'] . '" already exists. Skipping...' . PHP_EOL;
             $gr = Tinebase_Group::getInstance()->getGroupByName($groupArray['groupData']['name']);
             $this->_groups[$groupArray['groupData']['name']] = $fe->getGroup($gr->getId());
         }
     }
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:23,代码来源:DemoData.php

示例5: fromTine20RecordSet

 /**
  * convert Tinebase_Record_RecordSet to Sabre\VObject\Component
  *
  * @param  Tinebase_Record_RecordSet  $_records
  * @return Sabre\VObject\Component
  */
 public function fromTine20RecordSet(Tinebase_Record_RecordSet $_records)
 {
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' Events: ' . print_r($_records->toArray(), true));
     }
     // required vcalendar fields
     $version = Tinebase_Application::getInstance()->getApplicationByName('Calendar')->version;
     $vcalendar = new \Sabre\VObject\Component\VCalendar(array('PRODID' => "-//tine20.com//Tine 2.0 Calendar V{$version}//EN", 'VERSION' => '2.0', 'CALSCALE' => 'GREGORIAN'));
     if (isset($this->_method)) {
         $vcalendar->add('METHOD', $this->_method);
     }
     $originatorTz = $_records->getFirstRecord() ? $_records->getFirstRecord()->originator_tz : NULL;
     if (empty($originatorTz)) {
         throw new Tinebase_Exception_Record_Validation('originator_tz needed for conversion to Sabre\\VObject\\Component');
     }
     try {
         $vcalendar->add(new Sabre_VObject_Component_VTimezone($originatorTz));
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
         throw new Tinebase_Exception_Record_Validation('Bad Timezone: ' . $originatorTz);
     }
     foreach ($_records as $_record) {
         $this->_convertCalendarModelEvent($vcalendar, $_record);
         if ($_record->exdate instanceof Tinebase_Record_RecordSet) {
             $_record->exdate->addIndices(array('is_deleted'));
             $eventExceptions = $_record->exdate->filter('is_deleted', false);
             foreach ($eventExceptions as $eventException) {
                 $this->_convertCalendarModelEvent($vcalendar, $eventException, $_record);
             }
         }
     }
     $this->_afterFromTine20Model($vcalendar);
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' card ' . $vcalendar->serialize());
     }
     return $vcalendar;
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:43,代码来源:Abstract.php

示例6: handle

 /**
  * (non-PHPdoc)
  * @see Tinebase_Server_Interface::handle()
  */
 public function handle(\Zend\Http\Request $request = null, $body = null)
 {
     $this->_request = $request instanceof \Zend\Http\Request ? $request : Tinebase_Core::get(Tinebase_Core::REQUEST);
     $this->_body = $this->_getBody($body);
     try {
         list($loginName, $password) = $this->_getAuthData($this->_request);
     } catch (Tinebase_Exception_NotFound $tenf) {
         header('WWW-Authenticate: Basic realm="ActiveSync for Tine 2.0"');
         header('HTTP/1.1 401 Unauthorized');
         return;
     }
     if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) {
         Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' is ActiveSync request.');
     }
     Tinebase_Core::initFramework();
     try {
         $authResult = $this->_authenticate($loginName, $password, $this->_request);
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
         $authResult = false;
     }
     if ($authResult !== true) {
         header('WWW-Authenticate: Basic realm="ActiveSync for Tine 2.0"');
         header('HTTP/1.1 401 Unauthorized');
         return;
     }
     if (!$this->_checkUserPermissions($loginName)) {
         return;
     }
     $this->_initializeRegistry();
     $request = new Zend_Controller_Request_Http();
     $request->setRequestUri($this->_request->getRequestUri());
     $syncFrontend = new Syncroton_Server(Tinebase_Core::getUser()->accountId, $request, $this->_body);
     $syncFrontend->handle();
     Tinebase_Controller::getInstance()->logout();
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:40,代码来源:Http.php

示例7: _addEmailNote

 /**
  * add email notes to contacts with email addresses in $_recipients
  *
  * @param array $_recipients
  * @param string $_subject
  * 
  * @todo add email home (when we have OR filters)
  * @todo add link to message in sent folder?
  */
 protected function _addEmailNote($_recipients, $_subject, $_body)
 {
     $filter = new Addressbook_Model_ContactFilter(array(array('field' => 'email', 'operator' => 'in', 'value' => $_recipients)));
     $contacts = Addressbook_Controller_Contact::getInstance()->search($filter);
     if (count($contacts)) {
         $translate = Tinebase_Translation::getTranslation($this->_applicationName);
         Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Adding email notes to ' . count($contacts) . ' contacts.');
         $truncatedBody = extension_loaded('mbstring') ? mb_substr($_body, 0, 4096, 'UTF-8') : substr($_body, 0, 4096);
         $noteText = $translate->_('Subject') . ':' . $_subject . "\n\n" . $translate->_('Body') . ': ' . $truncatedBody;
         try {
             foreach ($contacts as $contact) {
                 $note = new Tinebase_Model_Note(array('note_type_id' => Tinebase_Notes::getInstance()->getNoteTypeByName('email')->getId(), 'note' => $noteText, 'record_id' => $contact->getId(), 'record_model' => 'Addressbook_Model_Contact'));
                 Tinebase_Notes::getInstance()->addNote($note);
             }
         } catch (Zend_Db_Statement_Exception $zdse) {
             Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ' Saving note failed: ' . $noteText);
             Tinebase_Exception::log($zdse);
         }
     } else {
         Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . ' Found no contacts to add notes to.');
     }
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:31,代码来源:Send.php

示例8: _createSetupuser

 /**
  * create new setupuser
  *
  * @return Tinebase_Model_FullUser|null
  */
 protected function _createSetupuser()
 {
     if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Creating new setupuser.');
     }
     $adminGroup = Tinebase_Group::getInstance()->getDefaultAdminGroup();
     $setupUser = new Tinebase_Model_FullUser(array('accountLoginName' => 'setupuser', 'accountStatus' => Tinebase_Model_User::ACCOUNT_STATUS_DISABLED, 'visibility' => Tinebase_Model_FullUser::VISIBILITY_HIDDEN, 'accountPrimaryGroup' => $adminGroup->getId(), 'accountLastName' => 'setupuser', 'accountDisplayName' => 'setupuser', 'accountExpires' => NULL));
     try {
         $setupUser = Tinebase_User::getInstance()->addUser($setupUser);
         Tinebase_Group::getInstance()->addGroupMember($setupUser->accountPrimaryGroup, $setupUser->getId());
     } catch (Exception $e) {
         // no setup user could be created
         // TODO we should try to fetch an admin user here (see Sales_Setup_Update_Release8::_updateContractsFields)
         Tinebase_Exception::log($e);
         $setupUser = null;
     }
     return $setupUser;
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:23,代码来源:Abstract.php

示例9: update_2

 /**
  * update to 8.3
  * - normalize all rrules
  */
 public function update_2()
 {
     // find all events with rrule
     $eventIds = $this->_db->query("SELECT " . $this->_db->quoteIdentifier('id') . " FROM " . $this->_db->quoteIdentifier(SQL_TABLE_PREFIX . "cal_events") . " WHERE " . $this->_db->quoteIdentifier("rrule") . " IS NOT NULL")->fetchAll(Zend_Db::FETCH_ASSOC);
     // NOTE: we need a generic sql BE to circumvent calendar specific acl issues
     $eventBE = new Tinebase_Backend_Sql(array('modelName' => 'Calendar_Model_Event', 'tableName' => 'cal_events', 'modlogActive' => false));
     foreach ($eventIds as $eventId) {
         $event = $eventBE->get($eventId['id']);
         $oldRruleString = (string) $event->rrule;
         $rrule = Calendar_Model_Rrule::getRruleFromString($oldRruleString);
         $rrule->normalize($event);
         if ($oldRruleString != (string) $rrule) {
             $event->rrule = (string) $rrule;
             try {
                 $eventBE->update($event);
             } catch (Tinebase_Exception_Record_Validation $terv) {
                 Tinebase_Exception::log($terv, null, $event->toArray());
             } catch (Tinebase_Exception_UnexpectedValue $teuv) {
                 Tinebase_Exception::log($teuv, null, $event->toArray());
             }
         }
     }
     $this->setApplicationVersion('Calendar', '8.3');
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:28,代码来源:Release8.php

示例10: _checkAdminGroupMembership

 /**
  * check admin group membership
  * 
  * @param Tinebase_Model_FullUser $user
  */
 protected function _checkAdminGroupMembership($user)
 {
     $adminGroup = Tinebase_Group::getInstance()->getDefaultAdminGroup();
     $memberships = Tinebase_Group::getInstance()->getGroupMemberships($user);
     if (!in_array($adminGroup->getId(), $memberships)) {
         try {
             Tinebase_Group::getInstance()->addGroupMember($adminGroup, $user);
             echo "Added user to default admin group\n";
             // @todo clear roles/groups cache
         } catch (Exception $e) {
             Tinebase_Exception::log($e);
             echo "Could not add user to default admin group: " . $e->getMessage();
         }
     }
 }
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:20,代码来源:Cli.php

示例11: 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

示例12: _searchServerPlugins

 /**
  * Search server plugins from applications configuration
  *
  */
 protected static function _searchServerPlugins()
 {
     $cache = Tinebase_Core::getCache();
     if ($cache && ($plugins = $cache->load(self::TINEBASE_SERVER_PLUGINS))) {
         return $plugins;
     }
     // get list of available applications
     $applications = array();
     $d = dir(realpath(__DIR__ . '/../'));
     while (false !== ($entry = $d->read())) {
         if ($entry[0] == '.') {
             continue;
         }
         if (ctype_upper($entry[0]) && is_dir($d->path . DIRECTORY_SEPARATOR . $entry)) {
             $applications[] = $entry;
         }
     }
     $d->close();
     // get list of plugins
     $plugins = array();
     foreach ($applications as $application) {
         $config = $application . '_Config';
         try {
             if (class_exists($config)) {
                 $reflectedClass = new ReflectionClass($config);
                 if ($reflectedClass->isSubclassOf('Tinebase_Config_Abstract')) {
                     $plugins = array_merge($plugins, call_user_func(array($config, 'getServerPlugins')));
                 }
             }
         } catch (Exception $e) {
             Tinebase_Exception::log($e);
         }
     }
     // sort plugins by priority
     asort($plugins);
     $plugins = array_keys($plugins);
     if ($cache) {
         $cache->save($plugins, self::TINEBASE_SERVER_PLUGINS);
     }
     return $plugins;
 }
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:45,代码来源:Core.php

示例13: getAllRegistryData

 /**
  * Returns registry data of all applications current user has access to
  * @see Tinebase_Application_Json_Abstract
  *
  * @return mixed array 'variable name' => 'data'
  */
 public function getAllRegistryData()
 {
     $registryData = array();
     if (Tinebase_Core::getUser()) {
         $userApplications = Tinebase_Core::getUser()->getApplications(TRUE);
         $clientConfig = Tinebase_Config::getInstance()->getClientRegistryConfig();
         if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
             /** @noinspection PhpUndefinedFieldInspection */
             Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' User applications to fetch registry for: ' . print_r($userApplications->name, TRUE));
         }
         /** @noinspection PhpUndefinedFieldInspection */
         if (!in_array('Tinebase', $userApplications->name)) {
             Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ' User has no permissions to run Tinebase.');
             $this->logout();
             throw new Tinebase_Exception_AccessDenied('User has no permissions to run Tinebase');
         }
         foreach ($userApplications as $application) {
             $jsonAppName = $application->name . '_Frontend_Json';
             if (class_exists($jsonAppName)) {
                 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
                     Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Getting registry data for app ' . $application->name);
                 }
                 try {
                     $applicationJson = new $jsonAppName();
                     $registryData[$application->name] = isset($registryData[$application->name]) || array_key_exists($application->name, $registryData) ? array_merge_recursive($registryData[$application->name], $applicationJson->getRegistryData()) : $applicationJson->getRegistryData();
                 } catch (Exception $e) {
                     Tinebase_Exception::log($e);
                     if (!$e instanceof Tinebase_Exception_AccessDenied && !in_array($application->name, array('Tinebase', 'Addressbook', 'Admin'))) {
                         Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' Disabling ' . $application->name . ': ' . $e);
                         Tinebase_Application::getInstance()->setApplicationState(array($application->getId()), Tinebase_Application::DISABLED);
                     }
                     unset($registryData[$application->name]);
                     continue;
                 }
                 $registryData[$application->name]['rights'] = Tinebase_Core::getUser()->getRights($application->name);
                 $registryData[$application->name]['config'] = isset($clientConfig[$application->name]) ? $clientConfig[$application->name]->toArray() : array();
                 $registryData[$application->name]['models'] = $applicationJson->getModelsConfiguration();
                 $registryData[$application->name]['defaultModel'] = $applicationJson->getDefaultModel();
                 foreach ($applicationJson->getRelatableModels() as $relModel) {
                     $registryData[$relModel['ownApp']]['relatableModels'][] = $relModel;
                 }
                 // @todo do we need this for all apps?
                 $exportDefinitions = Tinebase_ImportExportDefinition::getInstance()->getExportDefinitionsForApplication($application);
                 $registryData[$application->name]['exportDefinitions'] = array('results' => $exportDefinitions->toArray(), 'totalcount' => count($exportDefinitions));
                 $customfields = Tinebase_CustomField::getInstance()->getCustomFieldsForApplication($application);
                 Tinebase_CustomField::getInstance()->resolveConfigGrants($customfields);
                 $registryData[$application->name]['customfields'] = $customfields->toArray();
                 // add preferences for app
                 $appPrefs = Tinebase_Core::getPreference($application->name);
                 if ($appPrefs !== NULL) {
                     $allPrefs = $appPrefs->getAllApplicationPreferences();
                     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
                         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . print_r($allPrefs, TRUE));
                     }
                     foreach ($allPrefs as $pref) {
                         try {
                             $registryData[$application->name]['preferences'][$pref] = $appPrefs->{$pref};
                         } catch (Exception $e) {
                             Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' Could not get ' . $pref . '  preference: ' . $e);
                         }
                     }
                 }
             }
         }
     } else {
         $registryData['Tinebase'] = $this->getRegistryData();
     }
     return $registryData;
 }
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:75,代码来源:Json.php

示例14: testParallelAlarmTrigger

 /**
  * testParallelAlarmTrigger
  * 
  * @see 0004878: improve asyncJob fencing
  */
 public function testParallelAlarmTrigger()
 {
     $this->_testNeedsTransaction();
     try {
         $this->_emailTestClass = new Felamimail_Controller_MessageTest();
         $this->_emailTestClass->setup();
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
         $this->markTestIncomplete('email not available.');
     }
     Tinebase_Alarm::getInstance()->sendPendingAlarms("Tinebase_Event_Async_Minutely");
     self::flushMailer();
     $this->_getAlarmMails(TRUE);
     $event = $this->_getEvent();
     $event->dtstart = Tinebase_DateTime::now()->addMinute(15);
     $event->dtend = clone $event->dtstart;
     $event->dtend->addMinute(30);
     $event->attendee = $this->_getAttendee();
     $event->alarms = new Tinebase_Record_RecordSet('Tinebase_Model_Alarm', array(new Tinebase_Model_Alarm(array('minutes_before' => 30), TRUE)));
     $persistentEvent = $this->_eventController->create($event);
     try {
         Tinebase_AsyncJobTest::triggerAsyncEvents();
     } catch (Exception $e) {
         Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Something strange happened and the async jobs did not complete ... maybe the test system is not configured correctly for this: ' . $e);
         $this->markTestIncomplete($e->getMessage());
     }
     $result = $this->_getAlarmMails(TRUE);
     $this->assertEquals(1, count($result), 'expected exactly 1 alarm mail, got: ' . print_r($result->toArray(), TRUE));
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:34,代码来源:EventNotificationsTests.php

示例15: _getImportDefinitionRegistryData

 /**
  * fetch import definition data
  *
  * @return array
  */
 protected function _getImportDefinitionRegistryData()
 {
     $definitionConverter = new Tinebase_Convert_ImportExportDefinition_Json();
     $importDefinitions = $this->_getImportDefinitions();
     $defaultDefinition = $this->_getDefaultImportDefinition($importDefinitions);
     try {
         $defaultDefinitionArray = $definitionConverter->fromTine20Model($defaultDefinition);
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
         $defaultDefinitionArray = array();
     }
     try {
         $definitionsArray = $definitionConverter->fromTine20RecordSet($importDefinitions);
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
         $definitionsArray = array();
     }
     $definitionData = array('defaultImportDefinition' => $defaultDefinitionArray, 'importDefinitions' => array('results' => $definitionsArray, 'totalcount' => count($definitionsArray)));
     return $definitionData;
 }
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:25,代码来源:Abstract.php


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