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


PHP myDbHelper类代码示例

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


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

示例1: execute

 public function execute()
 {
     $this->forceSystemAuthentication();
     myDbHelper::$use_alternative_con = null;
     $go = $this->getP("go");
     $filter = new ConversionProfileFilter();
     $this->list = array();
     $fields_set = $filter->fillObjectFromRequest($_REQUEST, "filter_", null);
     if ($go) {
         $c = new Criteria();
         // filter
         $filter->attachToCriteria($c);
         //if ($order_by != -1) kshowPeer::setOrder( $c , $order_by );
         $this->list = ConversionProfilePeer::doSelect($c);
     }
     $the_conv = myConversionProfileUtils::getConversionProfile($filter->get("_eq_partner_id"), $filter->get("_eq_profile_type"));
     $selected = false;
     if ($the_conv) {
         foreach ($this->list as &$conv) {
             if ($conv->getId() == $the_conv->getId()) {
                 $selected = true;
                 $conv->selected = true;
             }
         }
     }
     // is none was selected - need to add the_conv to the list
     if (!$selected && $the_conv) {
         $the_conv->selected = true;
         $this->list[] = $the_conv;
     }
     $this->filter = $filter;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:32,代码来源:conversionProfileMgrAction.class.php

示例2: listAction

 /**
  * List media info objects by filter and pager
  * 
  * @action list
  * @param KalturaMediaInfoFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaMediaInfoListResponse
  */
 function listAction(KalturaMediaInfoFilter $filter = null, KalturaFilterPager $pager = null)
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
     if (!$filter) {
         $filter = new KalturaMediaInfoFilter();
     }
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     $mediaInfoFilter = new MediaInfoFilter();
     $filter->toObject($mediaInfoFilter);
     if ($filter->flavorAssetIdEqual) {
         // Since media_info table does not have partner_id column, enforce partner by getting the asset
         if (!assetPeer::retrieveById($filter->flavorAssetIdEqual)) {
             throw new KalturaAPIException(KalturaErrors::FLAVOR_ASSET_ID_NOT_FOUND, $filter->flavorAssetIdEqual);
         }
     }
     $c = new Criteria();
     $mediaInfoFilter->attachToCriteria($c);
     $totalCount = mediaInfoPeer::doCount($c);
     $pager->attachToCriteria($c);
     $dbList = mediaInfoPeer::doSelect($c);
     $list = KalturaMediaInfoArray::fromDbArray($dbList, $this->getResponseProfile());
     $response = new KalturaMediaInfoListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }
开发者ID:DBezemer,项目名称:server,代码行数:36,代码来源:MediaInfoService.php

示例3: execute

 public function execute()
 {
     $this->forceSystemAuthentication();
     myDbHelper::$use_alternative_con = null;
     //myDbHelper::DB_HELPER_CONN_PROPEL2
     $uiConfId = $this->getRequestParameter("id");
     $uiConf = uiConfPeer::retrieveByPK($uiConfId);
     $subTypes = array(uiconf::FILE_SYNC_UICONF_SUB_TYPE_DATA, uiconf::FILE_SYNC_UICONF_SUB_TYPE_FEATURES);
     foreach ($subTypes as $subType) {
         if ($subType == uiconf::FILE_SYNC_UICONF_SUB_TYPE_DATA) {
             echo "Data:" . PHP_EOL;
         } else {
             if ($subType == uiconf::FILE_SYNC_UICONF_SUB_TYPE_FEATURES) {
                 echo "Features:" . PHP_EOL;
             }
         }
         $syncKey = $uiConf->getSyncKey($subType);
         if (kFileSyncUtils::file_exists($syncKey)) {
             echo "File sync already exists." . PHP_EOL;
         } else {
             list($rootPath, $filePath) = $uiConf->generateFilePathArr($subType);
             $fullPath = $rootPath . $filePath;
             if (file_exists($fullPath)) {
                 kFileSyncUtils::createSyncFileForKey($syncKey);
                 echo "Created successfully." . PHP_EOL;
             } else {
                 echo "File not found:" . PHP_EOL;
                 echo $fullPath . PHP_EOL;
                 echo "Not creating file sync." . PHP_EOL;
             }
         }
         echo PHP_EOL;
     }
     die;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:35,代码来源:fixUiConfFileSyncAction.class.php

示例4: fetchPage

 public function fetchPage($action, $filter, $my_pager, $base_criteria = null)
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
     $keywords = @$_REQUEST["keywords"];
     // $sort_alias is what is sent from the browser
     $sort_alias = $this->sort_alias != null ? $this->sort_alias : @$_REQUEST["sort"];
     //		$keywords_array = mySearchUtils::getKeywordsFromStr ( $keywords );
     if ($base_criteria != null) {
         $c = $base_criteria;
     } else {
         $c = KalturaCriteria::create(entryPeer::OM_CLASS);
     }
     $filter->addSearchMatchToCriteria($c, $keywords, $this->getSearchableColumnName());
     // each entity can do specific modifications to the criteria
     $this->modifyCriteria($c);
     if ($this->skip_count) {
         $my_pager->attachCriteria($c, $this->getPeerMethod(), $this->getPeerCountMethod());
         //$res = $my_pager->fetchPage(null , true , 0);
         $res = $my_pager->fetchPage(null);
         // , true , 0);
     } else {
         $my_pager->attachCriteria($c, $this->getPeerMethod(), $this->getPeerCountMethod());
         $res = $my_pager->fetchPage();
     }
     return $res;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:26,代码来源:AJAX_getObjectsAction.class.php

示例5: execute

 public function execute()
 {
     $this->forceSystemAuthentication();
     myDbHelper::$use_alternative_con = null;
     $partnerId = $this->getRequestParameter("partnerId", null);
     $uiConfId = $this->getRequestParameter("uiConfId", null);
     $page = $this->getRequestParameter("page", 1);
     if ($partnerId !== null && $partnerId !== "") {
         $pageSize = 50;
         $c = new Criteria();
         $c->add(widgetPeer::PARTNER_ID, $partnerId);
         if ($uiConfId) {
             $c->add(widgetPeer::UI_CONF_ID, $uiConfId);
         }
         $c->addDescendingOrderByColumn(widgetPeer::CREATED_AT);
         $total = widgetPeer::doCount($c);
         $lastPage = ceil($total / $pageSize);
         $c->setOffset(($page - 1) * $pageSize);
         $c->setLimit($pageSize);
         $widgets = widgetPeer::doSelect($c);
     } else {
         $total = 0;
         $lastPage = 0;
         $widgets = array();
     }
     $this->uiConfId = $uiConfId;
     $this->page = $page;
     $this->lastPage = $lastPage;
     $this->widgets = $widgets;
     $this->partner = PartnerPeer::retrieveByPK($partnerId);
     $this->partnerId = $partnerId;
 }
开发者ID:DBezemer,项目名称:server,代码行数:32,代码来源:viewUiconfWidgetsAction.class.php

示例6: execute

 /**
  * Will anipulate a single entry
  */
 public function execute()
 {
     $this->forceSystemAuthentication();
     myDbHelper::$use_alternative_con = null;
     $command = $this->getP("command");
     if ($command == "updateEntry") {
         $id = $this->getP("id");
         $entry = entryPeer::retrieveByPK($id);
         if ($entry) {
             $name = $this->getP("name");
             $value = $this->getP("value");
             $obj_wrapper = objectWrapperBase::getWrapperClass($entry, 0);
             $updateable_fields = $obj_wrapper->getUpdateableFields("2");
             if (!in_array($name, $updateable_fields)) {
                 die;
             }
             if ($name) {
                 $setter = "set" . $name;
                 call_user_func(array($entry, $setter), $value);
                 $entry->save();
             }
         }
     }
     die;
 }
开发者ID:DBezemer,项目名称:server,代码行数:28,代码来源:executeCommandAction.class.php

示例7: execute

 /**
  * Will investigate a single entry
  */
 public function execute()
 {
     $this->forceSystemAuthentication();
     myDbHelper::$use_alternative_con = null;
     //myDbHelper::DB_HELPER_CONN_PROPEL2;
     $status_list = $this->getP("status");
     $mode = $this->getP("mode");
     if ($mode == "old") {
         $preconvert = glob(myContentStorage::getFSContentRootPath() . "/content/preconvert/data/*");
         $preconvert_indicators = glob(myContentStorage::getFSContentRootPath() . "/content/preconvert/files/*");
         // indicators or inproc
     } else {
         $preconvert = glob(myContentStorage::getFSContentRootPath() . "/content/new_preconvert/*");
         $preconvert_indicators = glob(myContentStorage::getFSContentRootPath() . "/new_content/preconvert/*.in*");
         // indicators or inproc
     }
     $indicators = array();
     foreach ($preconvert_indicators as $file) {
         $file = pathinfo($file, PATHINFO_BASENAME);
         $name = substr($file, 0, strpos($file, "."));
         $indicators[$name] = $name;
     }
     $entry_ids = array();
     foreach ($preconvert as $file) {
         $file = pathinfo($file, PATHINFO_BASENAME);
         $name = substr($file, 0, strpos($file, "."));
         if (!isset($indicators[$name])) {
             $entry_ids[] = $name;
             // only those that don't have indicators
         }
     }
     $ids_str = "'" . implode("','", $entry_ids) . "'";
     echo "<html><body style='font-family:arial; font-size:12px;'>";
     echo "preconvert files: [" . count($preconvert) . "]<br>";
     echo "preconvert indicators : [" . count($preconvert_indicators) . "] [" . count($indicators) . "]<br>";
     echo "entry_ids: [" . count($entry_ids) . "]<br>";
     if (count($entry_ids)) {
         if (!$status_list) {
             $status_list = "1";
         }
         $connection = Propel::getConnection();
         $query = "SELECT id,partner_id,status,created_at FROM entry WHERE status IN ({$status_list}) AND id IN ({$ids_str}) ORDER BY created_at ASC ";
         echo "query: {$query}<br>";
         $statement = $connection->prepareStatement($query);
         $resultset = $statement->executeQuery();
         echo "<table cellpadding=2 cellspacing=0 border=1 style='font-family:arial; font-size:12px;'>";
         echo "<tr><td>partner_id</td><td>id</td><td>status</td><td>created_at</td></tr>";
         $real_count = 0;
         while ($resultset->next()) {
             echo "<tr>" . "<td>" . $resultset->getInt('partner_id') . "</td>" . "<td>" . $resultset->getString('id') . "</td>" . "<td>" . $resultset->getInt('status') . "</td>" . "<td>" . $resultset->get('created_at') . "</td>" . "</tr>";
             $real_count++;
         }
         echo "</table>";
         echo "count [{$real_count}]";
         $resultset->close();
     }
     echo "</body></html>";
     die;
 }
开发者ID:DBezemer,项目名称:server,代码行数:62,代码来源:preconvertAction.class.php

示例8: execute

 /**
  * Will investigate a single entry
  */
 public function execute()
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
     $this->forceSystemAuthentication();
     entryPeer::setUseCriteriaFilter(false);
     $this->result = NULL;
     $kshow_ids = @$_REQUEST["kshow_ids"];
     $this->kshow_ids = $kshow_ids;
     $this->kshow = NULL;
     $entry_ids = @$_REQUEST["entry_ids"];
     $this->entry_ids = $entry_ids;
     $this->entry = NULL;
     $this->show_entry = null;
     $show_entry_list = array();
     if (!empty($kshow_ids)) {
         $ids_arr = explode(",", $kshow_ids);
         $kshows = kshowPeer::retrieveByPKs($ids_arr);
         if (!$kshows) {
             $this->result = "No kshows [{$kshow_ids}] in DB";
             return;
         }
         foreach ($kshows as $kshow) {
             $show_entry = $kshow->getShowEntry();
             $show_entry_list[] = $show_entry;
         }
     } else {
         if (empty($entry_ids)) {
             $this->result = "Submit an entry_id of a kshow_id to fix";
             return;
         }
         $ids_arr = explode(",", $entry_ids);
         $entries = entryPeer::retrieveByPKs($ids_arr);
         if (!$entries) {
             $this->result = "No entries [{$entry_ids}] in DB";
             return;
         }
         foreach ($entries as $entry) {
             if ($entry->getType() != entryType::MIX) {
                 continue;
             }
             $show_entry_list[] = $entry;
         }
     }
     $fixed_data_list = array();
     foreach ($show_entry_list as $show_entry) {
         $fix_data = new fixData();
         $fix_data->show_entry = $show_entry;
         if ($show_entry->getType() != entryType::MIX) {
             $fix_data->error = "Entry is not a roughcut";
         } else {
             $fix_data->old_content = $show_entry->getMetadata();
             $fix_data->old_duration = $show_entry->getLengthInMsecs();
             $fix_data->fixed_content = $show_entry->fixMetadata(false);
             $fix_data->fixed_duration = $show_entry->getLengthInMsecs();
         }
         $fixed_data_list[] = $fix_data;
     }
     $this->fixed_data_list = $fixed_data_list;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:62,代码来源:fixMetadataAction.class.php

示例9: writeSolrLog

 public function writeSolrLog($entry)
 {
     KalturaLog::debug("writeSolrLog " . $entry->getId());
     $solrLog = new SphinxLog();
     $solrLog->setEntryId($entry->getId());
     $solrLog->setPartnerId($entry->getPartnerId());
     $solrLog->save(myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_SOLR_LOG));
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:8,代码来源:kSolrSearchManager.php

示例10: alternativeCon

 public static function alternativeCon($con, $queryDB = kQueryCache::QUERY_DB_UNDEFINED)
 {
     if ($con === null) {
         $con = myDbHelper::alternativeCon($con);
     }
     if ($con === null) {
         $con = myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL3);
     }
     return $con;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:10,代码来源:DynamicEnumPeer.php

示例11: alternativeCon

 public static function alternativeCon($con)
 {
     if ($con === null) {
         $con = myDbHelper::alternativeCon($con);
     }
     if ($con === null) {
         $con = myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL3);
     }
     return $con;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:10,代码来源:PriorityGroupPeer.php

示例12: __construct

 public function __construct($feedId)
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
     $microTimeStart = microtime(true);
     KalturaLog::info("syndicationFeedRenderer- initialize ");
     // initialize the database for all services
     DbManager::setConfig(kConf::getDB());
     DbManager::initialize();
     $this->syndicationFeedDB = $syndicationFeedDB = syndicationFeedPeer::retrieveByPK($feedId);
     if (!$syndicationFeedDB) {
         throw new Exception("Feed Id not found");
     }
     kEntitlementUtils::initEntitlementEnforcement($syndicationFeedDB->getPartnerId(), $syndicationFeedDB->getEnforceEntitlement());
     if (!is_null($syndicationFeedDB->getPrivacyContext()) && $syndicationFeedDB->getPrivacyContext() != '') {
         kEntitlementUtils::setPrivacyContextSearch($syndicationFeedDB->getPrivacyContext());
     }
     $tmpSyndicationFeed = KalturaSyndicationFeedFactory::getInstanceByType($syndicationFeedDB->getType());
     $tmpSyndicationFeed->fromObject($syndicationFeedDB);
     $this->syndicationFeed = $tmpSyndicationFeed;
     // add partner to default criteria
     categoryPeer::addPartnerToCriteria($this->syndicationFeed->partnerId, true);
     assetPeer::addPartnerToCriteria($this->syndicationFeed->partnerId, true);
     entryPeer::setDefaultCriteriaFilter();
     $this->baseCriteria = entryPeer::getDefaultCriteriaFilter();
     $startDateCriterion = $this->baseCriteria->getNewCriterion(entryPeer::START_DATE, time(), Criteria::LESS_EQUAL);
     $startDateCriterion->addOr($this->baseCriteria->getNewCriterion(entryPeer::START_DATE, null));
     $this->baseCriteria->addAnd($startDateCriterion);
     $endDateCriterion = $this->baseCriteria->getNewCriterion(entryPeer::END_DATE, time(), Criteria::GREATER_EQUAL);
     $endDateCriterion->addOr($this->baseCriteria->getNewCriterion(entryPeer::END_DATE, null));
     $this->baseCriteria->addAnd($endDateCriterion);
     $entryFilter = new entryFilter();
     $entryFilter->setPartnerSearchScope($this->syndicationFeed->partnerId);
     $entryFilter->setStatusEquel(entryStatus::READY);
     $entryFilter->setTypeIn(array(entryType::MEDIA_CLIP, entryType::MIX));
     $entryFilter->setModerationStatusNotIn(array(entry::ENTRY_MODERATION_STATUS_REJECTED, entry::ENTRY_MODERATION_STATUS_PENDING_MODERATION));
     $entryFilter->attachToCriteria($this->baseCriteria);
     if ($this->syndicationFeed->playlistId) {
         $this->entryFilters = myPlaylistUtils::getPlaylistFiltersById($this->syndicationFeed->playlistId);
         foreach ($this->entryFilters as $entryFilter) {
             $entryFilter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
             // partner scope already attached
         }
         $playlist = entryPeer::retrieveByPK($this->syndicationFeed->playlistId);
         if ($playlist) {
             if ($playlist->getMediaType() != entry::ENTRY_MEDIA_TYPE_XML) {
                 $this->staticPlaylist = true;
                 $this->staticPlaylistEntriesIdsOrder = explode(',', $playlist->getDataContent());
             }
         }
     } else {
         $this->entryFilters = array();
     }
     $microTimeEnd = microtime(true);
     KalturaLog::info("syndicationFeedRenderer- initialization done [" . ($microTimeEnd - $microTimeStart) . "]");
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:55,代码来源:KalturaSyndicationFeedRenderer.php

示例13: execute

 public function execute()
 {
     $this->forceSystemAuthentication();
     myDbHelper::$use_alternative_con = null;
     $this->ok_to_save = $this->getP("oktosave");
     $conv_profile_id = $this->getP("convprofile_id");
     if ($conv_profile_id < 0) {
         $conv_profile_id = "";
     }
     $this->message = "";
     $this->display_disabled = $this->getP("display_disabled");
     $command = $this->getP("command");
     if ($command == "removeCache") {
     } elseif ($command == "save") {
         $conv_profile = new ConversionProfile();
         $wrapper = objectWrapperBase::getWrapperClass($conv_profile, 0);
         $extra_fields = array("partnerId", "enabled");
         // add fields that cannot be updated using the API
         $allowed_params = array_merge($wrapper->getUpdateableFields(), $extra_fields);
         $fields_modified = baseObjectUtils::fillObjectFromMap($_REQUEST, $conv_profile, "convprofile_", $allowed_params, BasePeer::TYPE_PHPNAME, true);
         if ($conv_profile_id) {
             $conv_profile_from_db = ConversionProfilePeer::retrieveByPK($conv_profile_id);
             if ($conv_profile_from_db) {
                 baseObjectUtils::fillObjectFromObject($allowed_params, $conv_profile, $conv_profile_from_db, baseObjectUtils::CLONE_POLICY_PREFER_NEW, null, BasePeer::TYPE_PHPNAME, true);
             }
             $conv_profile_from_db->save();
         } else {
             $conv_profile->save();
             $conv_profile_id = $conv_profile->getId();
         }
     }
     $this->conv_profile = ConversionProfilePeer::retrieveByPK($conv_profile_id);
     $this->conv_profile_id = $conv_profile_id;
     if ($this->conv_profile) {
         $this->conv_profile_type = $this->conv_profile->getProfileType();
         $this->fallback_mode = array();
         $this->conv_params_list = ConversionParamsPeer::retrieveByConversionProfile($this->conv_profile, $this->fallback_mode, false);
         // to see if there are any disabled params - call again with true
         $tmp_fallback = array();
         $tmp_conv_params_list = ConversionParamsPeer::retrieveByConversionProfile($this->conv_profile, $tmp_fallback, true);
         if ($tmp_fallback["mode"] == $this->fallback_mode["mode"]) {
             $this->fallback_mode = $tmp_fallback;
             $this->conv_params_list = $tmp_conv_params_list;
         } else {
             if ($this->display_disabled) {
                 $this->fallback_mode = $tmp_fallback;
                 $this->conv_params_list = $tmp_conv_params_list;
                 $this->message = "This display is missleading due to [dispaly disabled=true]<br>It shows params that are disabled for this profile and WOULD NOT be used at run-time";
             }
         }
     } else {
         $this->conv_profile_type = null;
         $this->conv_params_list = null;
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:55,代码来源:conversionProfileAction.class.php

示例14: forceSystemAuthentication

 protected function forceSystemAuthentication()
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
     $kal_sys_auth = @$_COOKIE[self::COOKIE_NAME];
     if ($kal_sys_auth == $this->authKey()) {
         return true;
     }
     $this->setFlash('sign_in_referer', $_SERVER["REQUEST_URI"]);
     //echo "forceSystemAuthentication - false";
     return $this->forward('system', 'login');
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:11,代码来源:kalturaSystemAction.class.php

示例15: execute

 public function execute()
 {
     $this->forceSystemAuthentication();
     myDbHelper::$use_alternative_con = null;
     //myDbHelper::DB_HELPER_CONN_PROPEL3;
     $entry_id = $this->getP("entry_id");
     echo "Creating new conversion profile for entry [{$entry_id}]<br>";
     $new_conversion_profile = myPartnerUtils::getConversionProfile2ForEntry($entry_id);
     echo "result:\n" . print_r($new_conversion_profile, true . "<br>");
     die;
 }
开发者ID:DBezemer,项目名称:server,代码行数:11,代码来源:testConvProfMigrationAction.class.php


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