コード例 #1
0
 public function clearMemory()
 {
     accessControlPeer::clearInstancePool();
     BatchJobPeer::clearInstancePool();
     BulkUploadResultPeer::clearInstancePool();
     categoryPeer::clearInstancePool();
     EmailIngestionProfilePeer::clearInstancePool();
     entryPeer::clearInstancePool();
     FileSyncPeer::clearInstancePool();
     flavorAssetPeer::clearInstancePool();
     flavorParamsConversionProfilePeer::clearInstancePool();
     flavorParamsOutputPeer::clearInstancePool();
     flavorParamsPeer::clearInstancePool();
     kshowPeer::clearInstancePool();
     mediaInfoPeer::clearInstancePool();
     moderationFlagPeer::clearInstancePool();
     moderationPeer::clearInstancePool();
     notificationPeer::clearInstancePool();
     roughcutEntryPeer::clearInstancePool();
     SchedulerConfigPeer::clearInstancePool();
     SchedulerPeer::clearInstancePool();
     SchedulerStatusPeer::clearInstancePool();
     SchedulerWorkerPeer::clearInstancePool();
     StorageProfilePeer::clearInstancePool();
     syndicationFeedPeer::clearInstancePool();
     TrackEntryPeer::clearInstancePool();
     uiConfPeer::clearInstancePool();
     UploadTokenPeer::clearInstancePool();
     // TODO clear default filters
     // TODO call all memory cleaner plugins
     if (function_exists('gc_collect_cycles')) {
         // php 5.3 and above
         gc_collect_cycles();
     }
 }
コード例 #2
0
 /**
  * Get base entry by ID with no filters.
  * 
  * @action getTracks
  * @param string $entryId Entry id
  * @return KalturaTrackEntryListResponse
  */
 function getTracksAction($entryId)
 {
     $c = new Criteria();
     $c->add(TrackEntryPeer::ENTRY_ID, $entryId);
     $dbList = TrackEntryPeer::doSelect($c);
     $list = KalturaTrackEntryArray::fromDbArray($dbList);
     $response = new KalturaTrackEntryListResponse();
     $response->objects = $list;
     $response->totalCount = count($dbList);
     return $response;
 }
コード例 #3
0
ファイル: BaseTrackEntry.php プロジェクト: richhl/kalturaCE
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = TrackEntryPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setTrackEventTypeId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setPsVersion($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setContext($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setPartnerId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setEntryId($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setHostName($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setUid($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setTrackEventStatusId($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setChangedProperties($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setParam1Str($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setParam2Str($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setParam3Str($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setKs($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setDescription($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setCreatedAt($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setUpdatedAt($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setUserIp($arr[$keys[17]]);
     }
 }
 /**
  * Will investigate a single entry
  */
 public function execute()
 {
     $this->forceSystemAuthentication();
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
     entryPeer::setUseCriteriaFilter(false);
     $this->result = NULL;
     $fast = $this->getRequestParameter("fast", "") != "";
     $this->fast = $fast;
     $kshow_id = $this->getRequestParameter("kshow_id");
     $this->kshow_id = $kshow_id;
     $this->kshow = NULL;
     $entry_id = $this->getRequestParameter("entry_id");
     $this->entry_id = $entry_id;
     $this->entry = NULL;
     $this->error = $this->getRequestParameter("error");
     $this->bg_entry = NULL;
     if (!empty($kshow_id)) {
         $c = new Criteria();
         $c->add(kshowPeer::ID, $kshow_id);
         $kshows = kshowPeer::doSelect($c);
         $kshow = new kshow();
         if (!$kshows) {
             $this->result = "No kshow [{$kshow_id}] in DB";
             return;
         }
         $kshow_original = $kshows[0];
         $kshow_original->getShowEntry();
         // pre fetch
         $kshow_original->getIntro();
         // pre fetch
         $this->kshow_original = $kshows[0];
         $this->kshow = new genericObjectWrapper($this->kshow_original, true);
         $alredy_exist_entries = array();
         $alredy_exist_entries[] = $kshow_original->getShowEntryId();
         if ($kshow_original->getIntroId()) {
             $alredy_exist_entries[] = $kshow_original->getIntroId();
         }
         $skin_obj = $this->kshow_original->getSkinObj();
         $bg_entry_id = $skin_obj->get("bg_entry_id");
         if ($bg_entry_id) {
             $alredy_exist_entries[] = $bg_entry_id;
             $this->bg_entry = new genericObjectWrapper(entryPeer::retrieveByPK($bg_entry_id), true);
         }
         $c = new Criteria();
         $c->add(entryPeer::ID, $alredy_exist_entries, Criteria::NOT_IN);
         $c->setLimit(100);
         $this->kshow_entries = $this->kshow_original->getEntrysJoinKuser($c);
         return;
         //return "KshowSuccess";
     }
     if (empty($entry_id)) {
         return;
     }
     entryPeer::setUseCriteriaFilter(false);
     // from entry table
     $c = new Criteria();
     $c->add(entryPeer::ID, $entry_id);
     //$entries = entryPeer::doSelectJoinAll ( $c );
     $entries = entryPeer::doSelect($c);
     if (!$entries) {
         $this->result = "No entry [{$entry_id}] in DB";
         return;
     }
     $this->entry = new genericObjectWrapper($entries[0], true);
     // from conversion table
     $c = new Criteria();
     $c->add(conversionPeer::ENTRY_ID, $entry_id);
     $original_conversions = conversionPeer::doSelect($c);
     //$this->conversions = array() ; //
     $this->conversions = $original_conversions;
     //new genericObjectWrapper( $original_conversions );
     // find all relevant batches in DB
     // from batch_job table
     $c = new Criteria();
     //$c->add ( BatchJobPeer::DATA , "%\"entryId\";i:" . $entry_id . ";%" , Criteria::LIKE );
     $c->add(BatchJobPeer::ENTRY_ID, $entry_id);
     $original_batch_jobs = BatchJobPeer::doSelect($c);
     $this->batch_jobs = $original_batch_jobs;
     // new genericObjectWrapper( $original_batch_jobs );
     // use this as a refernece of all the directories
     //		myBatchFileConverterServer::init( true );
     $entry_patttern = "/" . $entry_id . "\\..*/";
     $getFileData_method = array('kFile', 'getFileData');
     $getFileDataWithContent_method = array('kFile', 'getFileDataWithContent');
     // find all relevant files on disk
     $c = new Criteria();
     $c->add(FileSyncPeer::OBJECT_TYPE, FileSyncObjectType::ENTRY);
     $c->add(FileSyncPeer::OBJECT_ID, $entry_id);
     // order by OBJECT SUB TYPE
     $c->addAscendingOrderByColumn(FileSyncPeer::OBJECT_SUB_TYPE);
     $this->file_syncs = FileSyncPeer::doSelect($c);
     $file_sync_links = array();
     $flavors = assetPeer::retrieveFlavorsByEntryId($entry_id);
     $flavor_ids = array();
     $this->flavors = array();
     foreach ($flavors as $f) {
         $flavor_ids[] = $f->getId();
         $f->getflavorParamsOutputs();
         $f->getflavorParams();
         $f->getmediaInfos();
         $this->flavors[] = $f;
     }
     // find all relevant files on disk
     $c = new Criteria();
     $c->add(FileSyncPeer::OBJECT_TYPE, FileSyncObjectType::FLAVOR_ASSET);
     $c->add(FileSyncPeer::OBJECT_ID, $flavor_ids, Criteria::IN);
     // order by OBJECT SUB TYPE
     $c->addAscendingOrderByColumn(FileSyncPeer::OBJECT_SUB_TYPE);
     $flavors_file_syncs = FileSyncPeer::doSelect($c);
     $this->flavors_file_syncs = array();
     foreach ($flavors as $flav) {
         foreach ($flavors_file_syncs as $f) {
             if ($f->getLinkedId()) {
                 $file_sync_links[] = $f->getLinkedId();
             }
             if ($f->getObjectId() == $flav->getId()) {
                 $this->flavors_file_syncs[$flav->getId()][] = $f;
             }
         }
     }
     if ($this->file_syncs) {
         $this->file_syncs_by_sub_type = array();
         foreach ($this->file_syncs as $fs) {
             if ($fs->getLinkedId()) {
                 $file_sync_links[] = $fs->getLinkedId();
             }
             $sub_type = $fs->getObjectSubType();
             if (!isset($this->file_syncs_by_sub_type[$sub_type])) {
                 // create the array
                 $this->file_syncs_by_sub_type[$sub_type] = array();
             }
             $this->file_syncs_by_sub_type[$sub_type][] = $fs;
         }
     } else {
         $this->file_syncs_by_sub_type = array();
     }
     $file_sync_criteria = new Criteria();
     $file_sync_criteria->add(FileSyncPeer::ID, $file_sync_links, Criteria::IN);
     $this->file_sync_links = FileSyncPeer::doSelect($file_sync_criteria);
     $track_entry_c = new Criteria();
     $track_entry_c->add(TrackEntryPeer::ENTRY_ID, $entry_id);
     $track_entry_list = TrackEntryPeer::doSelect($track_entry_c);
     $more_interesting_track_entries = array();
     foreach ($track_entry_list as $track_entry) {
         if ($track_entry->getTrackEventTypeId() == TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY) {
             $more_interesting_track_entries[] = $track_entry->getParam3Str();
         }
     }
     $track_entry_list2 = array();
     //very heavy query, skip this
     /*
     // add all the track_entry objects that are related (joined on PARAM_3_STR)
     $track_entry_c2 = new Criteria();
     $track_entry_c2->add ( TrackEntryPeer::TRACK_EVENT_TYPE_ID , TrackEntry::TRACK_ENTRY_EVENT_TYPE_UPLOADED_FILE );
     $track_entry_c2->add ( TrackEntryPeer::PARAM_3_STR , $more_interesting_track_entries , Criteria::IN );
     $track_entry_list2 = TrackEntryPeer::doSelect ( $track_entry_c2 );
     */
     // first add the TRACK_ENTRY_EVENT_TYPE_UPLOADED_FILE - they most probably happend before the rest
     $this->track_entry_list = array_merge($track_entry_list2, $track_entry_list);
 }
コード例 #5
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(TrackEntryPeer::DATABASE_NAME);
         $criteria->add(TrackEntryPeer::ID, $pks, Criteria::IN);
         $objs = TrackEntryPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
 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();
     }
 }
コード例 #7
0
ファイル: BaseTrackEntry.php プロジェクト: DBezemer/server
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @return     Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = new Criteria(TrackEntryPeer::DATABASE_NAME);
     $criteria->add(TrackEntryPeer::ID, $this->id);
     if ($this->alreadyInSave && count($this->modifiedColumns) == 2 && $this->isColumnModified(TrackEntryPeer::UPDATED_AT)) {
         $theModifiedColumn = null;
         foreach ($this->modifiedColumns as $modifiedColumn) {
             if ($modifiedColumn != TrackEntryPeer::UPDATED_AT) {
                 $theModifiedColumn = $modifiedColumn;
             }
         }
         $atomicColumns = TrackEntryPeer::getAtomicColumns();
         if (in_array($theModifiedColumn, $atomicColumns)) {
             $criteria->add($theModifiedColumn, $this->getByName($theModifiedColumn, BasePeer::TYPE_COLNAME), Criteria::NOT_EQUAL);
         }
     }
     return $criteria;
 }