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


PHP kuserPeer::clearInstancePool方法代码示例

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


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

示例1: tearDown

 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     kuserPeer::clearInstancePool();
     UserLoginDataPeer::clearInstancePool();
     kuserPeer::setDefaultCriteriaFilter(false);
     UserLoginDataPeer::setUseCriteriaFilter(false);
     $this->clientConfig = null;
     $this->client = null;
     $this->nextUserId = null;
     foreach ($this->createdDbObjects as $obj) {
         try {
             if (get_class($obj) == 'kuser') {
                 $updated = kuserPeer::retrieveByPK($obj->getId());
                 if ($updated) {
                     $loginData = UserLoginDataPeer::retrieveByPK($updated->getLoginDataId());
                     if ($loginData) {
                         $loginData->delete();
                     }
                 }
             }
             $obj->delete();
         } catch (PropelException $e) {
         }
     }
     parent::tearDown();
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:29,代码来源:UserServiceTest.php

示例2: getAdminUsers

function getAdminUsers($lastUser, $userLimitEachLoop)
{
    kuserPeer::clearInstancePool();
    UserRolePeer::clearInstancePool();
    $c = new Criteria();
    $c->addAnd(kuserPeer::ID, $lastUser, Criteria::GREATER_THAN);
    $c->addAnd(kuserPeer::IS_ADMIN, true, Criteria::EQUAL);
    $c->addAscendingOrderByColumn(kuserPeer::ID);
    $c->setLimit($userLimitEachLoop);
    kuserPeer::setUseCriteriaFilter(false);
    $users = kuserPeer::doSelect($c);
    kuserPeer::setUseCriteriaFilter(true);
    return $users;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:14,代码来源:04_assign_default_role_to_admin_users.php

示例3: tearDown

 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     UserRolePeer::clearInstancePool();
     PermissionPeer::clearInstancePool();
     PermissionItemPeer::clearInstancePool();
     kuserPeer::clearInstancePool();
     PartnerPeer::clearInstancePool();
     $this->client = null;
     PermissionItemPeer::setUseCriteriaFilter(false);
     foreach ($this->addedPermissionItemIds as $id) {
         try {
             $obj = PermissionItemPeer::retrieveByPK($id);
             if ($obj) {
                 $obj->delete();
             }
         } catch (PropelException $e) {
         }
     }
     PermissionItemPeer::setUseCriteriaFilter(true);
     $this->addedPermissionItemIds = array();
     parent::tearDown();
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:25,代码来源:PermissionItemServiceUnitTest.php

示例4: parameters

                // save
                $partner->setAccountOwnerKuserId($new_kuser->getId(), false);
            }
            KalturaLog::log('Saving partner [' . $partner->getId() . '] with account owner kuser ID [' . $partner->getAccountOwnerKuserId() . ']');
            $partner->save();
        } else {
            KalturaLog::log('DRY RUN - records are not being saved: ');
            KalturaLog::log('New user_login_data with the following parameters: ');
            KalturaLog::log(print_r($new_login_data, true));
            KalturaLog::log('Newkuser with the following parameters (login_data_id unknown): ');
            KalturaLog::log(print_r($new_kuser, true));
            KalturaLog::log('DRY RUN - saving partner [' . $partner->getId() . '] with account owner kuser ID [' . $partner->getAccountOwnerKuserId() . ']');
        }
        file_put_contents($lastUserFile, $lastUser);
    }
    kuserPeer::clearInstancePool();
    PartnerPeer::clearInstancePool();
    UserLogindataPeer::clearInstancePool();
    $users = getUsers($lastUser, $userLimitEachLoop);
}
$msg = 'Done - ' . ($dryRun ? 'DRY RUN!' : 'REAL RUN!');
KalturaLog::log($msg);
echo $msg;
function getUsers($lastUser, $userLimitEachLoop)
{
    adminKuserPeer::clearInstancePool();
    $c = new Criteria();
    $c->add(adminKuserPeer::ID, $lastUser, Criteria::GREATER_THAN);
    $c->addAscendingOrderByColumn(adminKuserPeer::ID);
    $c->setLimit($userLimitEachLoop);
    adminKuserPeer::setUseCriteriaFilter(false);
开发者ID:richhl,项目名称:kalturaCE,代码行数:31,代码来源:04_adminKusersMigration.php

示例5: getAllPusersInKuser

 /**
  * 
  * Gets all the pusers from the kuser table
  * @param int $lastKuserId - the last puser id 
  * @param int $limit - the limit for the query
  */
 private function getAllPusersInKuser($lastKuserId, $limit)
 {
     $pusers = array();
     kuserPeer::clearInstancePool();
     $c = new Criteria();
     $c->add(kuserPeer::ID, $lastKuserId, Criteria::GREATER_THAN);
     // if case we have several entries in the same date (and we stop in the middle)
     $c->addAnd(kuserPeer::ID, null, Criteria::NOT_EQUAL);
     $c->addAnd(kuserPeer::ID, "", Criteria::NOT_EQUAL);
     if ($this->partnerId) {
         $c->addAnd(kuserPeer::PARTNER_ID, $this->partnerId, Criteria::EQUAL);
     }
     $c->addAnd(kuserPeer::PARTNER_ID, $this->ignorePartners, Criteria::NOT_IN);
     $c->addAscendingOrderByColumn(kuserPeer::ID);
     $c->setLimit($limit);
     kuserPeer::setUseCriteriaFilter(false);
     $kusers = kuserPeer::doSelect($c);
     kuserPeer::setUseCriteriaFilter(true);
     foreach ($kusers as $kuser) {
         //		$this->printToLog("Found puser with id [{$kuser->getPuserId()}], partner [{$kuser->getPartnerId()}] on Kuser [{$kuser->getId()}]");
         $pusers[] = new puserDetails($kuser->getPuserId(), $kuser->getPartnerId());
         file_put_contents($this->lastKuserFile, $kuser->getId());
     }
     return $pusers;
 }
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:puser_kuser_consolidation.php

示例6: doDelete

 /**
  * Method perform a DELETE on the database, given a kuser or Criteria object OR a primary key value.
  *
  * @param      mixed $values Criteria or kuser object or primary key or array of primary keys
  *              which is used to create the DELETE statement
  * @param      PropelPDO $con the connection to use
  * @return     int 	The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
  *				if supported by native driver or if emulated using Propel.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doDelete($values, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(kuserPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     if ($values instanceof Criteria) {
         // invalidate the cache for all objects of this type, since we have no
         // way of knowing (without running a query) what objects should be invalidated
         // from the cache based on this Criteria.
         kuserPeer::clearInstancePool();
         // rename for clarity
         $criteria = clone $values;
     } elseif ($values instanceof kuser) {
         // it's a model object
         // invalidate the cache for this single object
         kuserPeer::removeInstanceFromPool($values);
         // create criteria based on pk values
         $criteria = $values->buildPkeyCriteria();
     } else {
         // it's a primary key, or an array of pks
         $criteria = new Criteria(self::DATABASE_NAME);
         $criteria->add(kuserPeer::ID, (array) $values, Criteria::IN);
         // invalidate the cache for this object(s)
         foreach ((array) $values as $singleval) {
             kuserPeer::removeInstanceFromPool($singleval);
         }
     }
     // Set the correct dbName
     $criteria->setDbName(self::DATABASE_NAME);
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     try {
         // use transaction because $criteria could contain info
         // for more than one table or we could emulating ON DELETE CASCADE, etc.
         $con->beginTransaction();
         $affectedRows += BasePeer::doDelete($criteria, $con);
         kuserPeer::clearRelatedInstancePool();
         $con->commit();
         return $affectedRows;
     } catch (PropelException $e) {
         $con->rollBack();
         throw $e;
     }
 }
开发者ID:dozernz,项目名称:server,代码行数:55,代码来源:BasekuserPeer.php

示例7: init

 /**
  * Init with allowed permissions for the user in the given KS or kCurrentContext if not KS given
  * kCurrentContext::init should have been executed before!
  * @param string $ks KS to extract user and partner IDs from instead of kCurrentContext
  * @param boolean $useCache use cache or not
  * @throws TODO: add all exceptions
  */
 public static function init($useCache = null)
 {
     // verify that kCurrentContext::init has been executed since it must be used to init current context permissions
     if (!kCurrentContext::$ksPartnerUserInitialized) {
         KalturaLog::crit('kCurrentContext::initKsPartnerUser must be executed before initializing kPermissionManager');
         throw new Exception('kCurrentContext has not been initialized!', null);
     }
     // can be initialized more than once to support multirequest with different kCurrentContext parameters
     self::$initialized = false;
     self::$useCache = $useCache ? true : false;
     // copy kCurrentContext parameters (kCurrentContext::init should have been executed before)
     self::$requestedPartnerId = !self::isEmpty(kCurrentContext::$partner_id) ? kCurrentContext::$partner_id : null;
     self::$ksPartnerId = !self::isEmpty(kCurrentContext::$ks_partner_id) ? kCurrentContext::$ks_partner_id : null;
     self::$ksUserId = !self::isEmpty(kCurrentContext::$ks_uid) ? kCurrentContext::$ks_uid : null;
     self::$ksString = kCurrentContext::$ks ? kCurrentContext::$ks : null;
     self::$adminSession = !self::isEmpty(kCurrentContext::$is_admin_session) ? kCurrentContext::$is_admin_session : false;
     // clear instance pools
     //TODO: may not be needed
     UserRolePeer::clearInstancePool();
     PermissionPeer::clearInstancePool();
     PermissionItemPeer::clearInstancePool();
     PermissionToPermissionItemPeer::clearInstancePool();
     kuserPeer::clearInstancePool();
     // if ks defined - check that it is valid
     self::errorIfKsNotValid();
     // init partner, user, and role objects
     self::initPartnerUserObjects();
     // throw an error if KS partner (operating partner) is blocked
     self::errorIfPartnerBlocked();
     // init role ids
     self::initRoleIds();
     // init permissions map
     self::initPermissionsMap();
     // initialization done
     self::$initialized = true;
     return true;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:44,代码来源:kPermissionManager.php

示例8: clearMemory

 public static function clearMemory()
 {
     accessControlPeer::clearInstancePool();
     kuserPeer::clearInstancePool();
     kshowPeer::clearInstancePool();
     entryPeer::clearInstancePool();
     //	    kvotePeer::clearInstancePool();
     //	    commentPeer::clearInstancePool();
     //	    flagPeer::clearInstancePool();
     //	    favoritePeer::clearInstancePool();
     //	    KshowKuserPeer::clearInstancePool();
     //	    MailJobPeer::clearInstancePool();
     SchedulerPeer::clearInstancePool();
     SchedulerWorkerPeer::clearInstancePool();
     SchedulerStatusPeer::clearInstancePool();
     SchedulerConfigPeer::clearInstancePool();
     ControlPanelCommandPeer::clearInstancePool();
     BatchJobPeer::clearInstancePool();
     //	    PriorityGroupPeer::clearInstancePool();
     BulkUploadResultPeer::clearInstancePool();
     //	    blockedEmailPeer::clearInstancePool();
     //	    conversionPeer::clearInstancePool();
     //	    flickrTokenPeer::clearInstancePool();
     PuserKuserPeer::clearInstancePool();
     //	    PuserRolePeer::clearInstancePool();
     PartnerPeer::clearInstancePool();
     //	    WidgetLogPeer::clearInstancePool();
     //	    adminKuserPeer::clearInstancePool();
     //	    notificationPeer::clearInstancePool();
     moderationPeer::clearInstancePool();
     moderationFlagPeer::clearInstancePool();
     roughcutEntryPeer::clearInstancePool();
     //	    widgetPeer::clearInstancePool();
     uiConfPeer::clearInstancePool();
     //	    PartnerStatsPeer::clearInstancePool();
     //	    PartnerActivityPeer::clearInstancePool();
     ConversionProfilePeer::clearInstancePool();
     //	    ConversionParamsPeer::clearInstancePool();
     //	    KceInstallationErrorPeer::clearInstancePool();
     FileSyncPeer::clearInstancePool();
     accessControlPeer::clearInstancePool();
     mediaInfoPeer::clearInstancePool();
     assetParamsPeer::clearInstancePool();
     assetParamsOutputPeer::clearInstancePool();
     assetPeer::clearInstancePool();
     conversionProfile2Peer::clearInstancePool();
     flavorParamsConversionProfilePeer::clearInstancePool();
     categoryPeer::clearInstancePool();
     syndicationFeedPeer::clearInstancePool();
     TrackEntryPeer::clearInstancePool();
     //	    SystemUserPeer::clearInstancePool();
     StorageProfilePeer::clearInstancePool();
     //	    EmailIngestionProfilePeer::clearInstancePool();
     UploadTokenPeer::clearInstancePool();
     //	    invalidSessionPeer::clearInstancePool();
     DynamicEnumPeer::clearInstancePool();
     UserLoginDataPeer::clearInstancePool();
     PermissionPeer::clearInstancePool();
     UserRolePeer::clearInstancePool();
     PermissionItemPeer::clearInstancePool();
     PermissionToPermissionItemPeer::clearInstancePool();
     KuserToUserRolePeer::clearInstancePool();
     $pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaMemoryCleaner');
     foreach ($pluginInstances as $pluginInstance) {
         $pluginInstance->cleanMemory();
     }
     if (function_exists('gc_collect_cycles')) {
         // php 5.3 and above
         gc_collect_cycles();
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:71,代码来源:kMemoryManager.php

示例9: deleteKuser

 /**
  * 
  * Deletes the given Kuser 
  */
 private function deleteKuser($puserToDelete)
 {
     kuserPeer::clearInstancePool();
     $partnerId = KalturaGlobalData::getData("@TEST_PARTNER_ID@");
     $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $puserToDelete);
     if ($kuser) {
         $kuserId = $kuser->getId();
         print "In delete kuser: deleting puser [{$puserToDelete}], kuserId [{$kuserId}]\n";
         $kuser->delete();
     } else {
         print "Nothing to delete\n";
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:17,代码来源:entryKuserTest.php


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