本文整理汇总了PHP中objectWrapperBase::useCache方法的典型用法代码示例。如果您正苦于以下问题:PHP objectWrapperBase::useCache方法的具体用法?PHP objectWrapperBase::useCache怎么用?PHP objectWrapperBase::useCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类objectWrapperBase
的用法示例。
在下文中一共展示了objectWrapperBase::useCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
// it is very common to expect an updated ui_conf object
objectWrapperBase::useCache(false);
$widget_id = $this->getPM("widget_id");
$detailed = $this->getP("detailed", false);
$uiconf_id = $this->getP("uiconf_id", $this->getP("ui_conf_id", null));
self::$escape_text = true;
//$widget = widgetPeer::retrieveByHashedId( $widget_id );
$widget = widgetPeer::retrieveByPK($widget_id);
if (!$widget) {
$this->addError(APIErrors::INVALID_WIDGET_ID, $widget_id);
} else {
// check if this widget is public - if so , create a ks for viewing the related kshow
if ($uiconf_id) {
$widget->overrideUiConfId($uiconf_id);
}
// make sure the validation is done before leaving the action -
// because the getWidgetHtml might throw an exception - it's better to envke it here rather than tht UI
$widget->getWidgetHtml();
// TODO - call
//$result = kSessionUtils::startKSession ( $partner_id , $this->getP ( "secret" ) , $puser_id , $ks , $expiry , $admin , "" , $privileges );
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$this->addMsg("widget", objectWrapperBase::getWrapperClass($widget, $level));
}
}
示例2: execute
public function execute($add_extra_debug_data = true)
{
date_default_timezone_set(kConf::get("date_default_timezone"));
// TODO - remove for production - use some configuration to determine
kConfigTable::$should_use_cache = false;
$start_impl = $end_impl = 0;
$nocache = false;
if ($this->getP("nocache")) {
$nocache = true;
$this->logMessage("Not using cache!");
objectWrapperBase::useCache(false);
}
$add_benchmarks = $this->getP("add_benchmarks", false);
// while testing our system - will match each service agains its description
// $this->matchInDescription();
$this->msg = array();
$this->error = array();
$this->debug = array();
$start_time = microtime(true);
$start = microtime(true);
$this->benchmarkStart("beforeImpl");
$this->response_type = $this->getP("format", self::DEFAULT_FORMAT);
//
/*
$should_debug = $this->getP ( "should_debug" , true );
if ( $should_debug == "false" ) $this->should_debug = false;
*/
if ($this->should_debug && $add_extra_debug_data) {
$this->benchmarkStart("signature");
$sig_type = $this->getP("sigtype", self::SIG_TYPE_POST);
$signature_params = self::getParamsFromSigType($sig_type);
$signatura_valid = self::validateSignature($signature_params);
$this->benchmarkEnd("signature");
$this->addDebug("sigtype", $sig_type);
$this->addDebug("validateSignature", $signatura_valid);
$this->addDebug("signature", self::signature($signature_params));
// $this->addDebug( "rawsignature" , self::signature( $signature_params , false ) );
}
$partner_id = $this->getP("partner_id");
if (!$partner_id) {
$partner_id = $this->getP("partnerId");
}
$subp_id = $this->getP("subp_id");
if (!$subp_id) {
$subp_id = $this->getP("subpId");
}
$puser_id = $this->getP("uid");
$ks_str = $this->getP("ks");
if ($ks_str == "{ks}") {
$ks_str = "";
}
// if the client DIDN'T replace the dynamic ks - ignore it
// the $execution_cache_key can be used by services to cache the results depending on the inpu parameters
// if the $execution_cache_key is not null, the rendere will search for the result of the rendering depending on the $execution_cache_key
// if it doesn't find it - it will create it (per format) and store it for next time
$execution_cache_key = null;
// moved the renderer here to see if has the $execution_cache_key and if so - skip the implementation
$renderer = new kalturaWebserviceRenderer($this->response_context);
$private_partner_data = false;
try {
try {
$arr = list($partner_id, $subp_id, $uid, $private_partner_data) = $this->validateTicketSetPartner($partner_id, $subp_id, $puser_id, $ks_str);
} catch (Exception $ex) {
KalturaLog::log('validateTicketSetPartner failed - not caching response');
defPartnerservices2baseAction::disableCache();
throw $ex;
}
// if PS2 permission validation is enabled for the current partner, only the actions defined in kConf's parameter "ps2_actions_not_blocked_by_permissions" will be allowed
$currentPartner = $this->getPartner();
if ($currentPartner && $currentPartner->getEnabledService(PermissionName::FEATURE_PS2_PERMISSIONS_VALIDATION)) {
if (!in_array(strtolower(get_class($this)), kConf::get('ps2_actions_not_blocked_by_permissions'))) {
KalturaLog::log('PS2 action ' . get_class($this) . ' is being blocked for partner ' . $currentPartner->getId() . ' defined with FEATURE_PS2_PERMISSIONS_VALIDATION enabled');
$this->addException(APIErrors::SERVICE_FORBIDDEN, get_class($this));
}
}
$this->private_partner_data = $private_partner_data;
//print_r ( $arr );
// TODO - validate the matchIp is ok with the user's IP
$this->validateIp();
// most services should not attempt to cache the results - for them this will return null
$execution_cache_key = $this->getExecutionCacheKeyWrapper($partner_id, $subp_id, $puser_id);
// if the key is not null - it will be used in the renderer for using the cotent from the cache
if ($nocache) {
$renderer->deleteCacheKey($execution_cache_key, $this->response_type);
} else {
$renderer->setCacheKey($execution_cache_key);
}
if (!$renderer->hasContentForCacheKey($this->response_type)) {
$this->benchmarkStart("applyPartnerFilters");
//init entitlement before set the default criteire by myPartnerUtils::applyPartnerFilters
kEntitlementUtils::initEntitlementEnforcement();
// apply filters for Criteria so there will be no chance of exposure of date from other partners !
// TODO - add the parameter for allowing kaltura network
myPartnerUtils::applyPartnerFilters($partner_id, $private_partner_data, $this->partnerGroup2(), $this->kalturaNetwork2());
$this->benchmarkEnd("applyPartnerFilters");
$this->benchmarkStart("puserKuser");
list($partner_id, $subp_id, $puser_id, $partner_prefix) = $this->preparePartnerPuserDetails($partner_id, $subp_id, $puser_id);
$puser_kuser = $this->getPuserKuser($partner_id, $subp_id, $puser_id);
$this->benchmarkEnd("puserKuser");
$this->benchmarkEnd("beforeImpl");
//.........这里部分代码省略.........