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


PHP ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts方法代码示例

本文整理汇总了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}')");
             }
         }
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:38,代码来源:ReadPermissionsOptimizationUtil.php

示例2: forgetAll

 public static function forgetAll($forgetDbLevelCache = true)
 {
     if (static::supportsAndAllowsDatabaseCaching() && $forgetDbLevelCache) {
         ZurmoDatabaseCompatibilityUtil::callProcedureWithoutOuts("clear_cache_actual_rights()");
     }
     parent::forgetAll();
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:7,代码来源:RightsCache.php

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

示例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}')");
             }
         }
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:51,代码来源:ReadPermissionsOptimizationUtil.php

示例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));
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:36,代码来源:PermissionsOptimizationTest.php

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

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

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


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