本文整理汇总了PHP中ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts方法的具体用法?PHP ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts怎么用?PHP ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoDatabaseCompatibilityUtil
的用法示例。
在下文中一共展示了ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rebuild
/**
* At some point if performance is a problem with rebuilding activity models, then the stored procedure
* needs to be refactored to somehow support more joins dynamically.
* @see https://www.pivotaltracker.com/story/show/38804909
* @param boolean $forcePhp
*/
public static function rebuild($forcePhp = false)
{
//Forcing php way until we can fix failing tests here: AccountReadPermissionsOptimizationScenariosTest
$forcePhp = true;
assert('is_bool($forcePhp)');
foreach (self::getMungableModelClassNames() as $modelClassName) {
if (!SECURITY_OPTIMIZED || $forcePhp) {
self::rebuildViaSlowWay($modelClassName);
} else {
//models that extend activity are special and can only be done with the PHP process. They cannot
//be done using the stored procedure because it does not support the extra joins needed to determine
//which securable items to look at.
if (is_subclass_of($modelClassName, 'Activity')) {
self::rebuildViaSlowWay($modelClassName);
} else {
$modelTableName = RedBeanModel::getTableName($modelClassName);
$mungeTableName = self::getMungeTableName($modelClassName);
if (!is_subclass_of($modelClassName, 'OwnedSecurableItem')) {
throw new NotImplementedException($message, $code, $previous);
}
if (is_subclass_of($modelClassName, 'Person')) {
if ($modelClassName != 'Contact') {
throw new NotSupportedException();
} else {
$modelTableName = Person::getTableName('Person');
}
}
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("rebuild('{$modelTableName}', '{$mungeTableName}')");
}
}
}
}
示例2: forgetAll
public static function forgetAll($forgetDbLevelCache = true)
{
if (static::supportsAndAllowsDatabaseCaching() && $forgetDbLevelCache) {
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("clear_cache_actual_rights()");
}
parent::forgetAll();
}
示例3: generateCampaignItemsForDueCampaigns
/**
* @return bool
*/
public function generateCampaignItemsForDueCampaigns()
{
$nowTimestamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time());
// Begin Not Coding Standard
$sql = "`generate_campaign_items`(" . Campaign::STATUS_ACTIVE . "," . Campaign::STATUS_PROCESSING . ",'{$nowTimestamp}')";
// End Not Coding Standard
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts($sql);
Yii::app()->jobQueue->add('CampaignQueueMessagesInOutbox', 5);
return true;
}
示例4: rebuild
/**
* At some point if performance is a problem with rebuilding activity models, then the stored procedure
* needs to be refactored to somehow support more joins dynamically.
* @see https://www.pivotaltracker.com/story/show/38804909
* @param boolean $overwriteExistingTables
* @param boolean $forcePhp
*/
public static function rebuild($overwriteExistingTables = true, $forcePhp = false, $messageStreamer = null)
{
//Forcing php way until we can fix failing tests here: AccountReadPermissionsOptimizationScenariosTest
$forcePhp = true;
assert('is_bool($overwriteExistingTables)');
assert('is_bool($forcePhp)');
foreach (PathUtil::getAllMungableModelClassNames() as $modelClassName) {
$mungeTableName = self::getMungeTableName($modelClassName);
$readTableExists = ZurmoRedBean::$writer->doesTableExist($mungeTableName);
if (!$overwriteExistingTables && $readTableExists) {
if (isset($messageStreamer)) {
$messageStreamer->add(Zurmo::t('ZurmoModule', "Skipping {{tableName}}", array('{{tableName}}' => $mungeTableName)));
}
// skip if we don't want to overwrite existing tables and table already exists
continue;
}
if (isset($messageStreamer)) {
$messageStreamer->add(Zurmo::t('ZurmoModule', "Building {{tableName}}", array('{{tableName}}' => $mungeTableName)));
}
if (!SECURITY_OPTIMIZED || $forcePhp) {
self::rebuildViaSlowWay($modelClassName);
} else {
//models that extend activity are special and can only be done with the PHP process. They cannot
//be done using the stored procedure because it does not support the extra joins needed to determine
//which securable items to look at.
if (is_subclass_of($modelClassName, 'Activity')) {
self::rebuildViaSlowWay($modelClassName);
} else {
$modelTableName = $modelClassName::getTableName();
if (!is_subclass_of($modelClassName, 'OwnedSecurableItem')) {
throw new NotImplementedException();
}
if (is_subclass_of($modelClassName, 'Person')) {
if ($modelClassName != 'Contact') {
throw new NotSupportedException();
} else {
$modelTableName = Person::getTableName();
}
}
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("rebuild('{$modelTableName}', '{$mungeTableName}')");
}
}
}
}
示例5: testPermissionsCachingBasics
public function testPermissionsCachingBasics()
{
if (!SECURITY_OPTIMIZED) {
return;
}
$accounts = Account::getAll();
$account = $accounts[0];
$user = User::getByUsername('bobby');
$this->assertNotEquals($account->owner->id, $user->id);
$account->addPermissions($user, Permission::READ);
$this->assertTrue($account->save());
$securableItemId = $account->getClassId('SecurableItem');
$permitableId = $user->getClassId('Permitable');
R::exec("call get_securableitem_cached_actual_permissions_for_permitable({$securableItemId}, {$permitableId}, @allow_permissions, @deny_permissions)");
$allow_permissions = intval(R::getCell('select @allow_permissions'));
$deny_permissions = intval(R::getCell('select @deny_permissions'));
$this->assertEquals(Permission::NONE, $allow_permissions);
$this->assertEquals(Permission::NONE, $deny_permissions);
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("cache_securableitem_actual_permissions_for_permitable({$securableItemId}, {$permitableId}, 1, 0)");
R::exec("call get_securableitem_cached_actual_permissions_for_permitable({$securableItemId}, {$permitableId}, @allow_permissions, @deny_permissions)");
$allow_permissions = intval(R::getCell('select @allow_permissions'));
$deny_permissions = intval(R::getCell('select @deny_permissions'));
$this->assertEquals(Permission::READ, $allow_permissions);
$this->assertEquals(Permission::NONE, $deny_permissions);
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("clear_cache_securableitem_actual_permissions({$securableItemId})");
R::exec("call get_securableitem_cached_actual_permissions_for_permitable({$securableItemId}, {$permitableId}, @allow_permissions, @deny_permissions)");
$allow_permissions = intval(R::getCell('select @allow_permissions'));
$deny_permissions = intval(R::getCell('select @deny_permissions'));
$this->assertEquals(Permission::NONE, $allow_permissions);
$this->assertEquals(Permission::NONE, $deny_permissions);
$account->removeAllPermissions();
$this->assertTrue($account->save());
$this->assertEquals(Permission::NONE, $account->getEffectivePermissions($user));
$this->assertEquals(array(Permission::NONE, Permission::NONE), $account->getExplicitActualPermissions($user));
$this->assertEquals(array(Permission::NONE, Permission::NONE), $account->getInheritedActualPermissions($user));
}
示例6: forgetAll
public static function forgetAll($forgetDbLevelCache = true)
{
if (PHP_CACHING_ON) {
self::$securableItemToPermitableToCombinedPermissions = array();
self::$namedSecurableItemActualPermissions = array();
}
if (SECURITY_OPTIMIZED && DB_CACHING_ON && $forgetDbLevelCache) {
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("clear_cache_all_actual_permissions()");
}
if (MEMCACHE_ON && Yii::app()->cache !== null) {
self::incrementCacheIncrementValue(static::$cacheType);
}
}
示例7: forgetAll
public static function forgetAll($forgetDbLevelCache = true)
{
if (static::supportsAndAllowsPhpCaching()) {
static::$securableItemToPermitableToCombinedPermissions = array();
static::$namedSecurableItemActualPermissions = array();
}
if (SECURITY_OPTIMIZED && static::supportsAndAllowsDatabaseCaching() && $forgetDbLevelCache) {
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("clear_cache_all_actual_permissions()");
}
if (static::supportsAndAllowsDatabaseCaching() && $forgetDbLevelCache) {
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("clear_cache_named_securable_all_actual_permissions()");
}
static::clearMemcacheCache();
}
示例8: updateEmailMessageForSending
/**
* Updates the email message using stored procedure
* @param EmailMessage $emailMessage
*/
protected function updateEmailMessageForSending(EmailMessage $emailMessage, $useSQL = false)
{
if (!$useSQL) {
Yii::log("EmailMessage should have been saved by this point. Anyways, saving now", CLogger::LEVEL_INFO);
// we save it and return. No need to call SP as the message is saved already;
$emailMessage->save(false);
return;
}
$nowTimestamp = "'" . DateTimeUtil::convertTimestampToDbFormatDateTime(time()) . "'";
$sendAttempts = $emailMessage->sendAttempts ? $emailMessage->sendAttempts : 1;
$sentDateTime = $emailMessage->sentDateTime ? "'" . $emailMessage->sentDateTime . "'" : 'null';
$serializedData = $emailMessage->error->serializedData ? "'" . $emailMessage->error->serializedData . "'" : 'null';
$sql = '`update_email_message_for_sending`(
' . $emailMessage->id . ',
' . $sendAttempts . ',
' . $sentDateTime . ',
' . $emailMessage->folder->id . ',
' . $serializedData . ',
' . $nowTimestamp . ')';
ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts($sql);
$emailMessage->forget();
}