本文整理汇总了PHP中Tinebase_TransactionManager类的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_TransactionManager类的具体用法?PHP Tinebase_TransactionManager怎么用?PHP Tinebase_TransactionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tinebase_TransactionManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getInstance
/**
* @return Tinebase_TransactionManager
*/
public static function getInstance()
{
if (self::$_instance === NULL) {
self::$_instance = new Tinebase_TransactionManager();
}
return self::$_instance;
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:10,代码来源:TransactionManager.php
示例2: tearDown
/**
* tear down tests
*/
protected function tearDown()
{
Zend_Session::$_unitTestEnabled = false;
if ($this->_transactionId) {
Tinebase_TransactionManager::getInstance()->rollBack();
}
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:10,代码来源:ServerTestCase.php
示例3: tearDown
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
if ($this->_smtpConfigChanged) {
Tinebase_Config::getInstance()->set(Tinebase_Config::SMTP, $this->_smtpConfig);
Tinebase_Smtp::setDefaultTransport($this->_smtpTransport);
}
Tinebase_TransactionManager::getInstance()->rollBack();
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:14,代码来源:JsonTest.php
示例4: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
if ($this->_transactionId) {
Tinebase_TransactionManager::getInstance()->rollBack();
}
if ($this->_user) {
Tinebase_Core::set(Tinebase_Core::USER, $this->_user);
}
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:15,代码来源:CustomFieldTest.php
示例5: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
// this needs to be done because Tinebase_Auth & Tinebase_Config use caching mechanisms
Tinebase_Auth::setBackendType($this->_originalBackendType);
Tinebase_Auth::deleteBackendConfiguration();
Tinebase_Auth::setBackendConfiguration($this->_originalBackendConfiguration);
Tinebase_Auth::saveBackendConfiguration();
Tinebase_Auth::getInstance()->setBackend();
Tinebase_TransactionManager::getInstance()->rollBack();
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:16,代码来源:AuthTest.php
示例6: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
Tinebase_TransactionManager::getInstance()->rollBack();
Tinebase_Config::getInstance()->clearCache();
// needs to be reverted because we use Tinebase_User as a singleton
Tinebase_User::setBackendType($this->_originalBackendType);
Tinebase_User::deleteBackendConfiguration();
Tinebase_User::setBackendConfiguration($this->_originalBackendConfiguration);
Tinebase_User::saveBackendConfiguration();
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:16,代码来源:UserTest.php
示例7: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
$transactionId = Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
foreach ($this->objects['nodes'] as $node) {
$this->_treeNodeBackend->delete($node->getId());
}
foreach ($this->objects['objects'] as $object) {
$this->_fileObjectBackend->delete($object->getId());
}
Tinebase_TransactionManager::getInstance()->commitTransaction($transactionId);
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:17,代码来源:NodeTest.php
示例8: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
foreach ($this->_foldersToDelete as $foldername) {
try {
Expressomail_Controller_Folder::getInstance()->delete($this->_account->getId(), $foldername);
} catch (Expressomail_Exception_IMAP $fei) {
// do nothing
}
}
Tinebase_TransactionManager::getInstance()->rollBack();
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:17,代码来源:AccountTest.php
示例9: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
foreach ($this->_foldersToDelete as $foldername) {
try {
Felamimail_Controller_Folder::getInstance()->delete($this->_account->getId(), $foldername);
} catch (Felamimail_Exception_IMAP $fei) {
// do nothing
}
}
Tinebase_TransactionManager::getInstance()->rollBack();
if ($this->_pwChanged) {
$testConfig = Zend_Registry::get('testConfig');
$this->_setCredentials($testConfig->username, $testConfig->password);
}
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:21,代码来源:AccountTest.php
示例10: setUp
/**
* (non-PHPdoc)
* @see ActiveSync/ActiveSync_TestCase::setUp()
*/
protected function setUp()
{
parent::setUp();
Syncroton_Registry::setDatabase(Tinebase_Core::getDb());
Syncroton_Registry::setTransactionManager(Tinebase_TransactionManager::getInstance());
Syncroton_Registry::set(Syncroton_Registry::DEVICEBACKEND, new Syncroton_Backend_Device(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
Syncroton_Registry::set(Syncroton_Registry::FOLDERBACKEND, new Syncroton_Backend_Folder(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
Syncroton_Registry::set(Syncroton_Registry::SYNCSTATEBACKEND, new Syncroton_Backend_SyncState(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
Syncroton_Registry::set(Syncroton_Registry::CONTENTSTATEBACKEND, new Syncroton_Backend_Content(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
Syncroton_Registry::set(Syncroton_Registry::POLICYBACKEND, new Syncroton_Backend_Policy(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
Syncroton_Registry::set('loggerBackend', Tinebase_Core::getLogger());
Syncroton_Registry::setContactsDataClass('Addressbook_Frontend_ActiveSync');
Syncroton_Registry::setCalendarDataClass('Calendar_Frontend_ActiveSync');
Syncroton_Registry::setEmailDataClass('Felamimail_Frontend_ActiveSync');
Syncroton_Registry::setTasksDataClass('Tasks_Frontend_ActiveSync');
$this->_device = Syncroton_Registry::getDeviceBackend()->create(ActiveSync_TestCase::getTestDevice());
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:21,代码来源:SyncTests.php
示例11: testAddSelfCustomFieldByMultipleUpdate
/**
* test add customfield to the same record by multiple update
*
* @see #7330: https://forge.tine20.org/mantisbt/view.php?id=7330
* @see 0007350: multipleUpdate - record not found
*/
public function testAddSelfCustomFieldByMultipleUpdate()
{
// test needs transaction because Controller does rollback when exception is thrown
Tinebase_TransactionManager::getInstance()->commitTransaction($this->_transactionId);
$this->_transactionId = NULL;
$cf = self::getCustomField(array('application_id' => Tinebase_Application::getInstance()->getApplicationByName('Addressbook')->getId(), 'model' => 'Addressbook_Model_Contact', 'definition' => array('type' => 'record', "recordConfig" => array("value" => array("records" => "Tine.Addressbook.Model.Contact")))));
$cf = $this->_instance->addCustomField($cf);
$c = Addressbook_Controller_Contact::getInstance();
$record1 = $c->create(new Addressbook_Model_Contact(array('n_family' => 'Friendly', 'n_given' => 'Rupert')), false);
$record2 = $c->create(new Addressbook_Model_Contact(array('n_family' => 'Friendly', 'n_given' => 'Matt')), false);
$contactIds = array($record1->getId(), $record2->getId());
$filter = new Addressbook_Model_ContactFilter(array(array('field' => 'n_family', 'operator' => 'equals', 'value' => 'Friendly')), 'AND');
$result = $c->updateMultiple($filter, array('#' . $cf->name => $contactIds[0]));
$this->assertEquals(1, $result['totalcount']);
$this->assertEquals(1, $result['failcount']);
// cleanup required because we do not have the tearDown() rollback here
$this->_instance->deleteCustomField($cf);
Addressbook_Controller_Contact::getInstance()->delete($contactIds);
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:25,代码来源:CustomFieldTest.php
示例12: testAccountBlocking
/**
* @group ServerTests
*
* @see 0011440: rework login failure handling
*/
public function testAccountBlocking()
{
// NOTE: end transaction here as NOW() returns the start of the current transaction in pgsql
// and is used in user status statement (think about using statement_timestamp() instead of NOW() with pgsql)
Tinebase_TransactionManager::getInstance()->commitTransaction($this->_transactionId);
$this->_transactionId = null;
$request = \Zend\Http\PhpEnvironment\Request::fromString(<<<EOS
POST /index.php HTTP/1.1
Content-Type: application/json
Content-Length: 122
Host: 192.168.122.158
Connection: keep-alive
Origin: http://192.168.1.158
X-Tine20-Request-Type: JSON
X-Tine20-Jsonkey: undefined
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.36
X-Tine20-Transactionid: 9c7129898e9f8ab7e4621fddf7077a1eaa425aac
X-Requested-With: XMLHttpRequest
Accept: */*
Referer: http://192.168.122.158/tine20dev/
Accept-Encoding: gzip,deflate
Accept-Language: de-DE,de;q=0.8,en-GB;q=0.6,en;q=0.4
EOS
);
$credentials = $this->getTestCredentials();
for ($i = 0; $i <= 3; $i++) {
$result = Tinebase_Controller::getInstance()->login($credentials['username'], 'foobar', $request);
$this->assertFalse($result);
}
$result = Tinebase_Controller::getInstance()->login($credentials['username'], $credentials['password'], $request);
$this->assertFalse($result, 'account must be blocked now');
// wait for some time (2^4 = 16 +1 seconds)
$timeToWait = 17;
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Waiting for ' . $timeToWait . ' seconds...');
}
sleep($timeToWait);
$result = Tinebase_Controller::getInstance()->login($credentials['username'], $credentials['password'], $request);
$this->assertTrue($result, 'account should be unblocked now');
}
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:45,代码来源:ControllerServerTest.php
示例13: removeListMember
/**
* remove members from list
*
* @param mixed $_listId
* @param mixed $_membersToRemove
* @return Addressbook_Model_List
*/
public function removeListMember($_listId, $_membersToRemove)
{
/** @var Addressbook_Model_List $list */
$list = $this->get($_listId);
if (empty($_membersToRemove)) {
return $list;
}
$removeMembers = Tinebase_Record_RecordSet::getIdsFromMixed($_membersToRemove);
$idsToRemove = array_intersect($list->members, $removeMembers);
$listId = Tinebase_Record_Abstract::convertId($_listId, $this->_modelName);
$transactionId = Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
if (!empty($idsToRemove)) {
$where = '(' . $this->_db->quoteInto($this->_db->quoteIdentifier($this->_tablePrefix . $this->_foreignTables['members']['table'] . '.' . $this->_foreignTables['members']['joinOn']) . ' = ?', $listId) . ' AND ' . $this->_db->quoteInto($this->_db->quoteIdentifier($this->_tablePrefix . $this->_foreignTables['members']['table'] . '.' . $this->_foreignTables['members']['field']) . ' IN (?)', $idsToRemove) . ')';
$this->_db->delete($this->_tablePrefix . $this->_foreignTables['members']['table'], $where);
}
Tinebase_TransactionManager::getInstance()->commitTransaction($transactionId);
return $this->get($_listId);
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:25,代码来源:List.php
示例14: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Tearing down ...');
}
if (count($this->_createdFolders) > 0) {
foreach ($this->_createdFolders as $folderName) {
//echo "delete $folderName\n";
try {
$this->_imap->removeFolder(Felamimail_Model_Folder::encodeFolderName($folderName));
} catch (Zend_Mail_Storage_Exception $zmse) {
// already deleted
}
}
Felamimail_Controller_Cache_Folder::getInstance()->clear($this->_account);
}
if (!empty($this->_foldersToClear)) {
foreach ($this->_foldersToClear as $folderName) {
// delete test messages from given folders on imap server (search by special header)
$this->_imap->selectFolder($folderName);
$result = $this->_imap->search(array('HEADER X-Tine20TestMessage jsontest'));
//print_r($result);
foreach ($result as $messageUid) {
$this->_imap->removeMessage($messageUid);
}
// clear message cache
$folder = Felamimail_Controller_Folder::getInstance()->getByBackendAndGlobalName($this->_account->getId(), $folderName);
Felamimail_Controller_Cache_Message::getInstance()->clear($folder);
}
}
// sieve cleanup
if ($this->_testSieveScriptName !== NULL) {
Felamimail_Controller_Sieve::getInstance()->setScriptName($this->_testSieveScriptName);
try {
Felamimail_Controller_Sieve::getInstance()->deleteScript($this->_account->getId());
} catch (Zend_Mail_Protocol_Exception $zmpe) {
// do not delete script if active
}
Felamimail_Controller_Account::getInstance()->setVacationActive($this->_account, $this->_oldSieveVacationActiveState);
if ($this->_oldSieveData !== NULL) {
$this->_oldSieveData->save();
}
}
if ($this->_oldActiveSieveScriptName !== NULL) {
Felamimail_Controller_Sieve::getInstance()->setScriptName($this->_oldActiveSieveScriptName);
Felamimail_Controller_Sieve::getInstance()->activateScript($this->_account->getId());
}
// vfs cleanup
foreach ($this->_pathsToDelete as $path) {
$webdavRoot = new DAV\ObjectTree(new Tinebase_WebDav_Root());
//echo "delete $path";
$webdavRoot->delete($path);
}
Tinebase_TransactionManager::getInstance()->rollBack();
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:61,代码来源:JsonTest.php
示例15: __construct
/**
* constructs this importer
*
* @param Zend_Db_Adapter_Abstract $_egwDb
* @param Zend_Config $_config
* @param Zend_Log $_log
*/
public function __construct($_config, $_log)
{
$this->_config = $_config;
$this->_log = $_log;
$this->_egwDb = Zend_Db::factory('PDO_MYSQL', $this->_config->egwDb);
/* egw config is utf-8 but db needs utf8 as string -> leave as config atm.
$select = $this->_egwDb->select()
->from(array('grants' => 'egw_config'))
->where($this->_egwDb->quoteInto($this->_egwDb->quoteIdentifier('config_name') . ' = (?)', 'system_charset'));
$egwConfig = $this->_egwDb->fetchAll($select, NULL, Zend_Db::FETCH_ASSOC);
$charset = $egwConfig[0]['config_value'];
*/
$this->_log->INFO(__METHOD__ . '::' . __LINE__ . " setting egw charset to {$this->_config->egwDb->charset}");
$this->_egwDb->query("SET NAMES {$this->_config->egwDb->charset}");
if ($this->_config->dryRun) {
Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
}
if ($this->_config->accountIdMap) {
$this->_accountIdMapCache = (include $this->_config->accountIdMap);
}
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:29,代码来源:Abstract.php
示例16: increaseAccessCount
/**
* increase access count
*
* @param Filemanager_Model_DownloadLink $download
*/
public function increaseAccessCount(Filemanager_Model_DownloadLink $download)
{
$db = method_exists($this->_backend, 'getAdapter') ? $this->_backend->getAdapter() : Tinebase_Core::getDb();
$transactionId = Tinebase_TransactionManager::getInstance()->startTransaction($db);
$currentRecord = $this->_backend->get($download->getId());
$currentRecord->access_count++;
// yes, no history etc.
$this->_backend->update($currentRecord);
Tinebase_TransactionManager::getInstance()->commitTransaction($transactionId);
}
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:15,代码来源:DownloadLink.php
示例17: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
Tinebase_TransactionManager::getInstance()->rollBack();
Tinebase_Config::getInstance()->set(Tinebase_Config::ANYONE_ACCOUNT_DISABLED, false);
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:11,代码来源:ContainerTest.php
示例18: _testNeedsTransaction
/**
* test needs transaction
*/
protected function _testNeedsTransaction()
{
if ($this->_transactionId) {
Tinebase_TransactionManager::getInstance()->commitTransaction($this->_transactionId);
$this->_transactionId = null;
}
}
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:10,代码来源:TestCase.php
示例19: tearDown
/**
* Tears down the fixture
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
Tinebase_TransactionManager::getInstance()->rollBack();
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:10,代码来源:QueueTest.php
示例20: tearDown
/**
* tear down tests
*
*/
public function tearDown()
{
if ($this->_transactionId) {
Tinebase_TransactionManager::getInstance()->rollBack();
}
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:10,代码来源:TestCase.php
注:本文中的Tinebase_TransactionManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论