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


PHP KalturaLog::CRIT方法代码示例

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


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

示例1: registerAction

 /**
  * Create a new Partner object
  * 
  * @action register
  * @param KalturaPartner $partner
  * @param string $cmsPassword
  * @param int $templatePartnerId
  * @param bool $silent
  * @return KalturaPartner
  *
  * @throws APIErrors::PARTNER_REGISTRATION_ERROR
  */
 public function registerAction(KalturaPartner $partner, $cmsPassword = "", $templatePartnerId = null, $silent = false)
 {
     KalturaResponseCacher::disableCache();
     $dbPartner = $partner->toPartner();
     $c = new Criteria();
     $c->addAnd(UserLoginDataPeer::LOGIN_EMAIL, $partner->adminEmail, Criteria::EQUAL);
     $existingUser = UserLoginDataPeer::doSelectOne($c);
     /*@var $exisitingUser UserLoginData */
     try {
         if ($cmsPassword == "") {
             $cmsPassword = null;
         }
         $parentPartnerId = null;
         if ($this->getKs() && $this->getKs()->isAdmin()) {
             $parentPartnerId = $this->getKs()->partner_id;
             if ($parentPartnerId == Partner::ADMIN_CONSOLE_PARTNER_ID) {
                 $parentPartnerId = null;
             } else {
                 // only if this partner is a var/group, allow setting it as parent for the new created partner
                 $parentPartner = PartnerPeer::retrieveByPK($parentPartnerId);
                 if (!($parentPartner->getPartnerGroupType() == PartnerGroupType::VAR_GROUP || $parentPartner->getPartnerGroupType() == PartnerGroupType::GROUP)) {
                     throw new KalturaAPIException(KalturaErrors::NON_GROUP_PARTNER_ATTEMPTING_TO_ASSIGN_CHILD, $parentPartnerId);
                 }
                 if ($templatePartnerId) {
                     $templatePartner = PartnerPeer::retrieveByPK($templatePartnerId);
                     if (!$templatePartner || $templatePartner->getPartnerParentId() != $parentPartnerId) {
                         throw new KalturaAPIException(KalturaErrors::NON_GROUP_PARTNER_ATTEMPTING_TO_ASSIGN_CHILD, $parentPartnerId);
                     }
                 }
             }
         }
         $partner_registration = new myPartnerRegistration($parentPartnerId);
         $ignorePassword = false;
         if ($existingUser && ($this->getKs()->partner_id == Partner::ADMIN_CONSOLE_PARTNER_ID || $this->getKs()->partner_id == $parentPartnerId)) {
             kuserPeer::setUseCriteriaFilter(false);
             $kuserOfLoginData = kuserPeer::getKuserByEmail($partner->adminEmail, $existingUser->getConfigPartnerId());
             kuserPeer::setUseCriteriaFilter(true);
             if ($kuserOfLoginData) {
                 $ignorePassword = true;
             }
         }
         list($pid, $subpid, $pass, $hashKey) = $partner_registration->initNewPartner($dbPartner->getName(), $dbPartner->getAdminName(), $dbPartner->getAdminEmail(), $dbPartner->getCommercialUse(), "yes", $dbPartner->getDescription(), $dbPartner->getUrl1(), $cmsPassword, $dbPartner, $ignorePassword, $templatePartnerId);
         $dbPartner = PartnerPeer::retrieveByPK($pid);
         // send a confirmation email as well as the result of the service
         $partner_registration->sendRegistrationInformationForPartner($dbPartner, false, $existingUser, $silent);
     } catch (Exception $ex) {
         KalturaLog::CRIT($ex);
         // this assumes the partner name is unique - TODO - remove key from DB !
         throw new KalturaAPIException(APIErrors::PARTNER_REGISTRATION_ERROR);
     }
     $partner = new KalturaPartner();
     // start from blank
     $partner->fromPartner($dbPartner);
     $partner->secret = $dbPartner->getSecret();
     $partner->adminSecret = $dbPartner->getAdminSecret();
     $partner->cmsPassword = $pass;
     return $partner;
 }
开发者ID:DBezemer,项目名称:server,代码行数:70,代码来源:PartnerService.php

示例2: registerAction

 /**
  * Register to Kaltura's partner program
  * 
  * @action register
  * @param KalturaPartner $partner
  * @param string $cmsPassword
  * @return KalturaPartner
  *
  * @throws APIErrors::PARTNER_REGISTRATION_ERROR
  */
 function registerAction(KalturaPartner $partner, $cmsPassword = "")
 {
     KalturaResponseCacher::disableCache();
     $dbPartner = $partner->toPartner();
     $partner->validatePropertyNotNull("name");
     $partner->validatePropertyNotNull("adminName");
     $partner->validatePropertyNotNull("adminEmail");
     $partner->validatePropertyNotNull("description");
     $partner->validatePropertyMaxLength("country", 2, true);
     $partner->validatePropertyMaxLength("state", 2, true);
     $c = new Criteria();
     $c->addAnd(UserLoginDataPeer::LOGIN_EMAIL, $partner->adminEmail, Criteria::EQUAL);
     $c->setLimit(1);
     $existingUser = UserLoginDataPeer::doCount($c) > 0;
     try {
         if ($cmsPassword == "") {
             $cmsPassword = null;
         }
         $parentPartnerId = null;
         if ($this->getKs() && $this->getKs()->isAdmin()) {
             $parentPartnerId = $this->getKs()->partner_id;
             if ($parentPartnerId == Partner::ADMIN_CONSOLE_PARTNER_ID) {
                 $parentPartnerId = null;
             } else {
                 // only if this partner is a var/grou, allow setting it as parent for the new created partner
                 $parentPartner = PartnerPeer::retrieveByPK($parentPartnerId);
                 if (!($parentPartner->getPartnerGroupType() == Partner::PARTNER_GROUP_TYPE_VAR || $parentPartner->getPartnerGroupType() == Partner::PARTNER_GROUP_TYPE_GROUP)) {
                     throw new KalturaAPIException(KalturaErrors::NON_GROUP_PARTNER_ATTEMPTING_TO_ASSIGN_CHILD, $parentPartnerId);
                 }
             }
         }
         $partner_registration = new myPartnerRegistration($parentPartnerId);
         $ignorePassword = false;
         if ($existingUser && $this->getKs()->partner_id == Partner::ADMIN_CONSOLE_PARTNER_ID && kuserPeer::getKuserByEmail($partner->adminEmail, Partner::ADMIN_CONSOLE_PARTNER_ID) != null) {
             $ignorePassword = true;
         }
         list($pid, $subpid, $pass, $hashKey) = $partner_registration->initNewPartner($dbPartner->getName(), $dbPartner->getAdminName(), $dbPartner->getAdminEmail(), $dbPartner->getCommercialUse(), "yes", $dbPartner->getDescription(), $dbPartner->getUrl1(), $cmsPassword, $dbPartner, $ignorePassword);
         $dbPartner = PartnerPeer::retrieveByPK($pid);
         // send a confirmation email as well as the result of the service
         $partner_registration->sendRegistrationInformationForPartner($dbPartner, false, $existingUser);
     } catch (SignupException $se) {
         KalturaLog::INFO($se);
         throw new KalturaAPIException(APIErrors::PARTNER_REGISTRATION_ERROR, 'SE ' . $se->getMessage());
     } catch (Exception $ex) {
         KalturaLog::CRIT($ex);
         // this assumes the partner name is unique - TODO - remove key from DB !
         throw new KalturaAPIException(APIErrors::PARTNER_REGISTRATION_ERROR, $ex->getMessage());
     }
     $partner = new KalturaPartner();
     // start from blank
     $partner->fromPartner($dbPartner);
     $partner->secret = $dbPartner->getSecret();
     $partner->adminSecret = $dbPartner->getAdminSecret();
     $partner->cmsPassword = $pass;
     return $partner;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:66,代码来源:PartnerService.php

示例3: updateThumbnailForEntryFromSourceEntry

 protected function updateThumbnailForEntryFromSourceEntry($entryId, $sourceEntryId, $timeOffset, $entryType = null, $flavorParamsId = null)
 {
     $dbEntry = entryPeer::retrieveByPK($entryId);
     if (!$dbEntry || $entryType !== null && $dbEntry->getType() != $entryType) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
     }
     $sourceDbEntry = entryPeer::retrieveByPK($sourceEntryId);
     if (!$sourceDbEntry || $sourceDbEntry->getType() != KalturaEntryType::MEDIA_CLIP) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $sourceDbEntry);
     }
     // if session is not admin, we should check that the user that is updating the thumbnail is the one created the entry
     if (!$this->getKs() || !$this->getKs()->isAdmin()) {
         if (strtolower($dbEntry->getPuserId()) !== strtolower($this->getKs()->user)) {
             throw new KalturaAPIException(KalturaErrors::PERMISSION_DENIED_TO_UPDATE_ENTRY);
         }
     }
     $updateThumbnailResult = myEntryUtils::createThumbnailFromEntry($dbEntry, $sourceDbEntry, $timeOffset, $flavorParamsId);
     if (!$updateThumbnailResult) {
         KalturaLog::CRIT("An unknwon error occured while trying to update thumbnail");
         throw new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
     }
     try {
         $wrapper = objectWrapperBase::getWrapperClass($dbEntry);
         $wrapper->removeFromCache("entry", $dbEntry->getId());
     } catch (Exception $e) {
         KalturaLog::err($e);
     }
     myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_THUMBNAIL, $dbEntry, $dbEntry->getPartnerId(), $dbEntry->getPuserId(), null, null, $entryId);
     $ks = $this->getKs();
     $isAdmin = false;
     if ($ks) {
         $isAdmin = $ks->isAdmin();
     }
     $mediaEntry = KalturaEntryFactory::getInstanceByType($dbEntry->getType(), $isAdmin);
     $mediaEntry->fromObject($dbEntry);
     return $mediaEntry;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:37,代码来源:KalturaEntryService.php

示例4: appendMediaEntryAction

 /**
  * Appends a media entry to a the end of the mix timeline, this will save the mix timeline as a new version.
  * 
  * @action appendMediaEntry
  * @param string $mixEntryId Mix entry to append to its timeline
  * @param string $mediaEntryId Media entry to append to the timeline
  * @return KalturaMixEntry The mix entry
  */
 function appendMediaEntryAction($mixEntryId, $mediaEntryId)
 {
     $dbMixEntry = entryPeer::retrieveByPK($mixEntryId);
     if (!$dbMixEntry || $dbMixEntry->getType() != KalturaEntryType::MIX) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $mixEntryId);
     }
     $dbMediaEntry = entryPeer::retrieveByPK($mediaEntryId);
     if (!$dbMediaEntry || $dbMediaEntry->getType() != KalturaEntryType::MEDIA_CLIP) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $mediaEntryId);
     }
     $kshow = $dbMixEntry->getkshow();
     if (!$kshow) {
         KalturaLog::CRIT("Kshow was not found for mix id [" . $mixEntryId . "]");
         throw new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
     }
     // FIXME: temp hack  - when kshow doesn't have a roughcut, and the media entry is not ready, it cannob be queued for append upon import/conversion completion
     if ($dbMediaEntry->getStatus() != entryStatus::READY) {
         $kshow->setShowEntryId($mixEntryId);
         $kshow->save();
         $dbMediaEntry->setKshowId($kshow->getId());
         $dbMediaEntry->save();
     }
     $metadata = $kshow->getMetadata();
     $relevantKshowVersion = 1 + $kshow->getVersion();
     // the next metadata will be the first relevant version for this new entry
     $newMetadata = myMetadataUtils::addEntryToMetadata($metadata, $dbMediaEntry, $relevantKshowVersion, array());
     $dbMediaEntry->save();
     // FIXME: should be removed, needed for the prev hack
     if ($newMetadata) {
         // TODO - add thumbnail only for entries that are worthy - check they are not moderated !
         $thumbModified = myKshowUtils::updateThumbnail($kshow, $dbMediaEntry, false);
         if ($thumbModified) {
             $newMetadata = myMetadataUtils::updateThumbUrlFromMetadata($newMetadata, $dbMixEntry->getThumbnailUrl());
         }
         // it is very important to increment the version count because even if the entry is deferred
         // it will be added on the next version
         if (!$kshow->getHasRoughcut()) {
             // make sure the kshow now does have a roughcut
             $kshow->setHasRoughcut(true);
             $kshow->save();
         }
         $kshow->setMetadata($newMetadata, true);
     }
     $mixEntry = new KalturaMixEntry();
     $mixEntry->fromObject($dbMixEntry);
     return $mixEntry;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:55,代码来源:MixingService.php


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