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


PHP kString::beginsWith方法代码示例

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


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

示例1: execute

 /**
  * Will forward to the regular swf player according to the widget_id 
  */
 public function execute()
 {
     $ui_conf_id = $this->getRequestParameter("ui_conf_id");
     $uiConf = uiConfPeer::retrieveByPK($ui_conf_id);
     if (!$uiConf) {
         die;
     }
     $partner_id = $uiConf->getPartnerId();
     $subp_id = $uiConf->getSubpId();
     if (!$subp_id) {
         $subp_id = 0;
     }
     $host = myPartnerUtils::getHost($partner_id);
     $ui_conf_swf_url = $uiConf->getSwfUrl();
     if (!$ui_conf_swf_url) {
         $ui_conf_swf_url = "/swf/ContributionWizard.swf";
     }
     if (kString::beginsWith($ui_conf_swf_url, "http")) {
         $swf_url = $ui_conf_swf_url;
         // absolute URL
     } else {
         $use_cdn = $uiConf->getUseCdn();
         $cdn_host = $use_cdn ? myPartnerUtils::getCdnHost($partner_id) : myPartnerUtils::getHost($partner_id);
         $swf_url = $cdn_host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . $ui_conf_swf_url;
         // relative to the current host
     }
     $params = "contentUrl=" . urlencode($swf_url) . "&host=" . str_replace("http://", "", str_replace("https://", "", $host)) . "&cdnHost=" . str_replace("http://", "", str_replace("https://", "", myPartnerUtils::getCdnHost($partner_id))) . "&uiConfId=" . $ui_conf_id;
     $wrapper_swf = myContentStorage::getFSFlashRootPath() . "/flexwrapper/" . kConf::get('kcw_flex_wrapper_version') . "/FlexWrapper.swf";
     $this->redirect($host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . "{$wrapper_swf}?{$params}");
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:33,代码来源:kcwAction.class.php

示例2: execute

 /**
  * Will forward to the uploader swf according to the ui_conf_id 
  */
 public function execute()
 {
     $ui_conf_id = $this->getRequestParameter("ui_conf_id");
     $uiConf = uiConfPeer::retrieveByPK($ui_conf_id);
     if (!$uiConf) {
         KExternalErrors::dieError(KExternalErrors::UI_CONF_NOT_FOUND, "UI conf not found");
     }
     $partner_id = $uiConf->getPartnerId();
     $subp_id = $uiConf->getSubpId();
     $host = requestUtils::getRequestHost();
     $ui_conf_swf_url = $uiConf->getSwfUrl();
     if (!$ui_conf_swf_url) {
         KExternalErrors::dieError(KExternalErrors::ILLEGAL_UI_CONF, "SWF URL not found in UI conf");
     }
     if (kString::beginsWith($ui_conf_swf_url, "http")) {
         $swf_url = $ui_conf_swf_url;
         // absolute URL
     } else {
         $use_cdn = $uiConf->getUseCdn();
         $cdn_host = $use_cdn ? myPartnerUtils::getCdnHost($partner_id) : myPartnerUtils::getHost($partner_id);
         $swf_url = $cdn_host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . $ui_conf_swf_url;
         // relative to the current host
     }
     $conf_vars = $uiConf->getConfVars();
     if ($conf_vars) {
         $conf_vars = "&" . $conf_vars;
     }
     $params = "host=" . $host . "&uiConfId=" . $ui_conf_id . $conf_vars;
     KExternalErrors::terminateDispatch();
     $this->redirect("{$swf_url}?{$params}");
 }
开发者ID:DBezemer,项目名称:server,代码行数:34,代码来源:kuploadAction.class.php

示例3: execute

 /**
  * Will forward to the uploader swf according to the ui_conf_id 
  */
 public function execute()
 {
     $ui_conf_id = $this->getRequestParameter("ui_conf_id");
     $uiConf = uiConfPeer::retrieveByPK($ui_conf_id);
     if (!$uiConf) {
         die;
     }
     $partner_id = $uiConf->getPartnerId();
     $subp_id = $uiConf->getSubpId();
     $host = requestUtils::getRequestHost();
     $ui_conf_swf_url = $uiConf->getSwfUrl();
     if (!$ui_conf_swf_url) {
         die;
     }
     if (kString::beginsWith($ui_conf_swf_url, "http")) {
         $swf_url = $ui_conf_swf_url;
         // absolute URL
     } else {
         $use_cdn = $uiConf->getUseCdn();
         $cdn_host = $use_cdn ? myPartnerUtils::getCdnHost($partner_id) : myPartnerUtils::getHost($partner_id);
         $swf_url = $cdn_host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . $ui_conf_swf_url;
         // relative to the current host
     }
     $conf_vars = $uiConf->getConfVars();
     if ($conf_vars) {
         $conf_vars = "&" . $conf_vars;
     }
     $params = "host=" . $host . "&uiConfId=" . $ui_conf_id . $conf_vars;
     $this->redirect("{$swf_url}?{$params}");
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:33,代码来源:kuploadAction.class.php

示例4: executeImpl

 /**
  * Executes addComment action, which returns a form enabling the insertion of a comment
  * The request may include 1 fields: entry id.
  */
 protected function executeImpl(kshow $kshow, entry &$entry)
 {
     $version = @$_REQUEST["version"];
     // it's a path on the disk
     if (kString::beginsWith($version, ".")) {
         // someone is trying to hack in the system
         return sfView::ERROR;
     }
     // in case we're making a roughcut out of a regular invite, we start from scratch
     if ($entry->getMediaType() != entry::ENTRY_MEDIA_TYPE_SHOW || $entry->getDataPath($version) === null) {
         $this->xml_content = "<xml></xml>";
         return;
     }
     // fetch content of file from disk - it should hold the XML
     $file_name = myContentStorage::getFSContentRootPath() . "/" . $entry->getDataPath($version);
     //echo "[$file_name]";
     if (kString::endsWith($file_name, "xml")) {
         if (file_exists($file_name)) {
             $this->xml_content = kFile::getFileContent($file_name);
             //	echo "[" . $this->xml_content . "]" ;
         } else {
             $this->xml_content = "<xml></xml>";
         }
         myMetadataUtils::updateEntryForPending($entry, $version, $this->xml_content);
     } else {
         return sfView::ERROR;
     }
     // this is NOT an xml file we are looking for !
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:33,代码来源:getMetadataAction.class.php

示例5: setValueFromHtmlFieldName

 public function setValueFromHtmlFieldName($prefix, $html_field_name, $value)
 {
     if (kString::beginsWith($html_field_name, $prefix)) {
         $field_name = substr($html_field_name, strlen($prefix));
         $this->setByName($field_name, $value);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:7,代码来源:skinContainer.class.php

示例6: execute

 /**
  * Will forward to the regular swf player according to the widget_id 
  */
 public function execute()
 {
     $ui_conf_id = $this->getRequestParameter("ui_conf_id");
     $uiConf = uiConfPeer::retrieveByPK($ui_conf_id);
     if (!$uiConf) {
         die;
     }
     $partner_id = $uiConf->getPartnerId();
     $subp_id = $uiConf->getSubpId();
     $host = myPartnerUtils::getHost($partner_id);
     $ui_conf_swf_url = $uiConf->getSwfUrl();
     if (!$ui_conf_swf_url) {
         $ui_conf_swf_url = "/swf/simpleeditor.swf";
     }
     if (kString::beginsWith($ui_conf_swf_url, "http")) {
         $swf_url = $ui_conf_swf_url;
         // absolute URL
     } else {
         $use_cdn = $uiConf->getUseCdn();
         $cdn_host = $use_cdn ? myPartnerUtils::getCdnHost($partner_id) : myPartnerUtils::getHost($partner_id);
         $swf_url = $cdn_host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . $ui_conf_swf_url;
         // relative to the current host
     }
     // handle buggy case for backward compatiblity
     $partner_host = $host;
     if ($partner_host == "http://www.kaltura.com") {
         $partner_host = 1;
     }
     // otherwise the kse will build a flawed url with [[IMPORT]]
     $params = "contentUrl=" . urlencode($swf_url) . "&host=" . str_replace("http://", "", str_replace("https://", "", $partner_host)) . "&cdnHost=" . str_replace("http://", "", str_replace("https://", "", myPartnerUtils::getCdnHost($partner_id))) . "&uiConfId=" . $ui_conf_id . "&disableurlhashing=" . kConf::get('disable_url_hashing');
     $wrapper_swf = myContentStorage::getFSFlashRootPath() . "/flexwrapper/" . kConf::get('editors_flex_wrapper_version') . "/FlexWrapper.swf";
     $this->redirect($host . myPartnerUtils::getUrlForPartner($partner_id, $subp_id) . "{$wrapper_swf}?{$params}");
 }
开发者ID:DBezemer,项目名称:server,代码行数:36,代码来源:kseAction.class.php

示例7: doGetFileSyncUrl

 /**
  * @param FileSync $fileSync
  * @return string
  */
 protected function doGetFileSyncUrl(FileSync $fileSync)
 {
     $url = parent::doGetFileSyncUrl($fileSync);
     if (in_array($fileSync->getPartnerId(), array(666132, 628012, 357521, 560751)) && kString::beginsWith($url, "mp4:")) {
         $url .= ".mp4";
     }
     return $url;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:12,代码来源:kLevel3UrlManager.php

示例8: removeFiles

 protected function removeFiles($namePrefix)
 {
     $namePrefix = $this->normalizeSlashes($namePrefix);
     foreach ($this->_files as $name => $data) {
         if (kString::beginsWith($name, $namePrefix)) {
             unset($this->_files[$name]);
         }
     }
 }
开发者ID:kubrickfr,项目名称:server,代码行数:9,代码来源:AndroidClientGenerator.php

示例9: execute

 /**
  * Will forward to the regular swf player according to the widget_id 
  */
 public function execute()
 {
     $uiconf_id = $this->getRequestParameter('uiconf_id');
     if (!$uiconf_id) {
         KExternalErrors::dieError(KExternalErrors::MISSING_PARAMETER, 'uiconf_id');
     }
     $uiConf = uiConfPeer::retrieveByPK($uiconf_id);
     if (!$uiConf) {
         KExternalErrors::dieError(KExternalErrors::UI_CONF_NOT_FOUND);
     }
     $partner_id = $this->getRequestParameter('partner_id', $uiConf->getPartnerId());
     if (!$partner_id) {
         KExternalErrors::dieError(KExternalErrors::MISSING_PARAMETER, 'partner_id');
     }
     $partner_host = myPartnerUtils::getHost($partner_id);
     $partner_cdnHost = myPartnerUtils::getCdnHost($partner_id);
     $use_cdn = $uiConf->getUseCdn();
     $host = $use_cdn ? $partner_cdnHost : $partner_host;
     $ui_conf_html5_url = $uiConf->getHtml5Url();
     if (kConf::hasMap("optimized_playback")) {
         $optimizedPlayback = kConf::getMap("optimized_playback");
         if (array_key_exists($partner_id, $optimizedPlayback)) {
             // force a specific kdp for the partner
             $params = $optimizedPlayback[$partner_id];
             if (array_key_exists('html5_url', $params)) {
                 $ui_conf_html5_url = $params['html5_url'];
             }
         }
     }
     if (kString::beginsWith($ui_conf_html5_url, "http")) {
         $url = $ui_conf_html5_url;
         // absolute URL
     } else {
         if ($ui_conf_html5_url) {
             $url = $host . $ui_conf_html5_url;
         } else {
             $html5_version = kConf::get('html5_version');
             $url = "{$host}/html5/html5lib/{$html5_version}/mwEmbedLoader.php";
         }
     }
     // append uiconf_id and partner id for optimizing loading of html5 library. append them only for "standard" urls by looking for the mwEmbedLoader.php suffix
     if (kString::endsWith($url, "mwEmbedLoader.php")) {
         $url .= "/p/{$partner_id}/uiconf_id/{$uiconf_id}";
         $entry_id = $this->getRequestParameter('entry_id');
         if ($entry_id) {
             $url .= "/entry_id/{$entry_id}";
         }
     }
     requestUtils::sendCachingHeaders(60);
     header("Pragma:");
     kFile::cacheRedirect($url);
     header("Location:{$url}");
     die;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:57,代码来源:embedIframeJsAction.class.php

示例10: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $entry_id = $this->getP("entry_id");
     $kshow_id = $this->getP("kshow_id");
     // Make sure the request is for a ready roughcut
     $c = entryPeer::getCriteriaFilter()->getFilter();
     $c->addAnd(entryPeer::STATUS, entryStatus::READY, Criteria::EQUAL);
     list($kshow, $entry, $error, $error_obj) = myKshowUtils::getKshowAndEntry($kshow_id, $entry_id);
     if ($error_obj) {
         $this->addError($error_obj);
         return;
     }
     $version = $this->getP("version");
     // it's a path on the disk
     if (kString::beginsWith($version, ".")) {
         // someone is trying to hack in the system
         return sfView::ERROR;
     } elseif ($version == "-1") {
         $version = null;
     }
     // in case we're making a roughcut out of a regular invite, we start from scratch
     $entry_data_path = kFileSyncUtils::getLocalFilePathForKey($entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $version));
     //replaced__getDataPath
     if ($entry->getMediaType() != entry::ENTRY_MEDIA_TYPE_SHOW || $entry_data_path === null) {
         $this->xml_content = "<xml></xml>";
         return;
     }
     $sync_key = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $version);
     $file_name = kFileSyncUtils::getReadyLocalFilePathForKey($sync_key, false);
     // fetch content of file from disk - it should hold the XML
     if (kString::endsWith($file_name, "xml")) {
         $xml_content = kFileSyncUtils::file_get_contents($sync_key, false, false);
         if (!$xml_content) {
             $xml_content = "<xml></xml>";
         }
         myMetadataUtils::updateEntryForPending($entry, $version, $xml_content);
         $this->addMsg("metadata", $xml_content);
     } else {
         $this->addError(APIErrors::INVALID_FILE_NAME, $file_name);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:41,代码来源:getmetadataAction.class.php

示例11: execute

 /**
  * Will execute the virus scan for the given file path and return the output from virus scanner program
  * and the error description
  * @param string $filePath
  * @param boolean $cleanIfInfected
  * @param string $errorDescription
  */
 public function execute($filePath, $cleanIfInfected, &$output, &$errorDescription)
 {
     if (!file_exists($filePath)) {
         $errorDescription = 'Source file does not exists [' . $filePath . ']';
         return KalturaVirusScanJobResult::SCAN_ERROR;
     }
     $scanPolicy = $cleanIfInfected ? 'scanrepair' : 'scan';
     $scanCommand = "FILEMOD icap://" . self::SCAN_ENGINE_HOST . ":" . self::SCAN_ENGINE_PORT . "/SYMCScanResp-AV?action={$scanPolicy} ICAP/1.0\nHost: 127.0.0.1:1344\nX-Filepath: {$filePath}\nConnection: close\nEncapsulated: null-body=0\n\n";
     for ($scanAttempts = 0; $scanAttempts < $this->maxScanRetries; sleep($this->sleepBetweenScanRetries)) {
         $response = $this->sendCommandToScanEngine($scanCommand);
         if ($response === false) {
             continue;
             // don't count this as an attempt, since the command wasn't sent to the server
         }
         KalturaLog::debug("Buffer received from scan engine: {$response}");
         if (!kString::beginsWith($response, 'ICAP/1.0 ')) {
             KalturaLog::err("Response does not start with ICAP/1.0");
             $scanAttempts++;
             continue;
         }
         $statusCode = explode(' ', $response);
         $statusCode = $statusCode[1];
         $statusCode = substr($statusCode, 0, 3);
         switch ($statusCode) {
             case '200':
             case '204':
                 return KalturaVirusScanJobResult::FILE_IS_CLEAN;
             case '201':
                 return KalturaVirusScanJobResult::FILE_WAS_CLEANED;
             case '205':
             case '403':
                 return KalturaVirusScanJobResult::FILE_INFECTED;
             case '502':
                 $errorDescription = 'Scan engine failed to access source file [' . $filePath . ']';
                 return KalturaVirusScanJobResult::SCAN_ERROR;
                 // no reason to retry
             // no reason to retry
             case '539':
             case '558':
                 $errorDescription = 'No virus scan license';
                 return KalturaVirusScanJobResult::SCAN_ERROR;
                 // no reason to retry
             // no reason to retry
             default:
                 // incl: 500 - internal error
                 KalturaLog::err("Got invalid scan status {$statusCode}");
                 $scanAttempts++;
                 continue;
         }
     }
     return KalturaVirusScanJobResult::SCAN_ERROR;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:59,代码来源:SymantecScanDirectEngine.php

示例12: setConfFilePath

 public function setConfFilePath($v)
 {
     if (kString::beginsWith($v, "..")) {
         $err = "Error in " . __METHOD__ . ": attmpting to set ConfFilePath to [{$v}]";
         KalturaLog::log($err);
         throw new APIException(APIErrors::ERROR_SETTING_FILE_PATH_FOR_UI_CONF, $v);
     }
     if ($this->getCreationMode() == self::UI_CONF_CREATION_MODE_MANUAL) {
         if (!kString::beginsWith($v, $this->getUiConfRootDirectory() . "uiconf/")) {
             $v = $this->getUiConfRootDirectory() . "uiconf/" . $v;
         }
         $real_v = realpath(dirname($v)) . "/" . pathinfo($v, PATHINFO_BASENAME);
         if ($v) {
             if ($real_v) {
                 /*
                  * TODO - add this id the service IS externally use via the API
                 					// the file exists - make sure we're not overiding someone elses file
                 					$ui_confs_with_same_path = uiConfPeer::retrieveByConfFilePath ( $real_v , $this->getId() );
                 					foreach ( $ui_confs_with_same_path as $ui_conf  )
                 					{
                 						if ( $ui_conf->getPartnerId ( ) != $this->getPartnerId() )
                 						{
                 							$err = "Error in " . __METHOD__ . ": attmpting to set ConfFilePath to [$v]";
                 							KalturaLog::log( $err );
                 							throw new APIException ( APIErrors::ERROR_SETTING_FILE_PATH_FOR_UI_CONF , $v );
                 						}
                 					}
                 */
                 $v = $real_v;
             }
         }
         parent::setConfFilePath($v);
     } else {
         parent::setConfFilePath($v);
         //			throw new APIException ( APIErrors::ERROR_SETTING_FILE_PATH_FOR_UI_CONF , $v );
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:37,代码来源:uiConf.php

示例13: monitorDatabaseAccess

 public static function monitorDatabaseAccess($sql, $sqlTook, $hostName = null)
 {
     if (!self::$stream) {
         return;
     }
     // strip the comment
     if (kString::beginsWith($sql, '/*')) {
         $eventType = self::EVENT_DATABASE;
         $commentEndPos = strpos($sql, '*/') + 2;
         $comment = substr($sql, 0, $commentEndPos);
         $matches = null;
         if (preg_match('~^/\\* [^\\]]+\\[\\d+\\]\\[([^\\]]+)\\] \\*/~', $comment, $matches)) {
             $hostName = $matches[1];
         }
         $sql = trim(substr($sql, $commentEndPos));
     } else {
         $eventType = self::EVENT_SPHINX;
     }
     // extract the query type
     $queryType = null;
     foreach (self::$queryTypes as $prefix => $curQueryType) {
         if (kString::beginsWith($sql, $prefix)) {
             $sql = substr($sql, strlen($prefix));
             $queryType = $curQueryType;
             break;
         }
     }
     if (!$queryType) {
         return;
     }
     // extract the table name
     $tableNameStart = 0;
     if ($queryType == 'SELECT') {
         $fromPos = strpos($sql, ' FROM ');
         if ($fromPos === false) {
             return;
         }
         $tableNameStart = $fromPos + 6;
     }
     $tableNameEnd = strpos($sql, ' ', $tableNameStart);
     if ($tableNameEnd === false) {
         return;
     }
     $tableName = substr($sql, $tableNameStart, $tableNameEnd - $tableNameStart);
     $tableName = str_replace('`', '', $tableName);
     $data = array_merge(self::$basicEventInfo, array(self::FIELD_EVENT_TYPE => $eventType, self::FIELD_DATABASE => $hostName, self::FIELD_TABLE => $tableName, self::FIELD_QUERY_TYPE => $queryType, self::FIELD_EXECUTION_TIME => $sqlTook));
     self::writeDeferredEvent($data);
 }
开发者ID:AdiTal,项目名称:server,代码行数:48,代码来源:KalturaMonitorClient.php

示例14: execute


//.........这里部分代码省略.........
             if (!$entry) {
                 KExternalErrors::dieError(KExternalErrors::ENTRY_NOT_FOUND);
             }
         }
     }
     $allowCache = true;
     $securityType = $widget->getSecurityType();
     switch ($securityType) {
         case widget::WIDGET_SECURITY_TYPE_TIMEHASH:
             // TODO - I don't know what should be validated here
             break;
         case widget::WIDGET_SECURITY_TYPE_MATCH_IP:
             $allowCache = false;
             // here we'll attemp to match the ip of the request with that from the customData of the widget
             $custom_data = $widget->getCustomData();
             $valid_country = false;
             if ($custom_data) {
                 // in this case the custom_data should be of format:
                 //  valid_county_1,valid_country_2,...,valid_country_n;falback_entry_id
                 $arr = explode(";", $custom_data);
                 $countries_str = $arr[0];
                 $fallback_entry_id = isset($arr[1]) ? $arr[1] : null;
                 $fallback_kshow_id = isset($arr[2]) ? $arr[2] : null;
                 $current_country = "";
                 $valid_country = requestUtils::matchIpCountry($countries_str, $current_country);
                 if (!$valid_country) {
                     KalturaLog::log("Attempting to access widget [{$widget_id}] and entry [{$entry_id}] from country [{$current_country}]. Retrning entry_id: [{$fallback_entry_id}] kshow_id [{$fallback_kshow_id}]");
                     $entry_id = $fallback_entry_id;
                 }
             }
             break;
         case widget::WIDGET_SECURITY_TYPE_FORCE_KS:
             $ks_str = $this->getRequestParameter('ks');
             try {
                 $ks = kSessionUtils::crackKs($ks_str);
             } catch (Exception $e) {
                 KExternalErrors::dieError(KExternalErrors::INVALID_KS);
             }
             $res = kSessionUtils::validateKSession2(1, $partner_id, 0, $ks_str, $ks);
             if ($res <= 0) {
                 KExternalErrors::dieError(KExternalErrors::INVALID_KS);
             }
             break;
         default:
             break;
     }
     $requestKey = $_SERVER["REQUEST_URI"];
     // check if we cached the redirect url
     $cache = new myCache("embedIframe", 10 * 60);
     // 10 minutes
     $cachedResponse = $cache->get($requestKey);
     if ($allowCache && $cachedResponse) {
         header("X-Kaltura: cached-action");
         header("Expires: Sun, 19 Nov 2000 08:52:00 GMT");
         header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
         header("Pragma: no-cache");
         header("Location:{$cachedResponse}");
         KExternalErrors::dieGracefully();
     }
     $uiconf_id = $this->getRequestParameter('uiconf_id');
     if (!$uiconf_id) {
         $uiconf_id = $widget->getUiConfId();
     }
     if (!$uiconf_id) {
         KExternalErrors::dieError(KExternalErrors::MISSING_PARAMETER, 'uiconf_id');
     }
     $partner_host = myPartnerUtils::getHost($partner_id);
     $partner_cdnHost = myPartnerUtils::getCdnHost($partner_id);
     $uiConf = uiConfPeer::retrieveByPK($uiconf_id);
     if (!$uiConf) {
         KExternalErrors::dieError(KExternalErrors::UI_CONF_NOT_FOUND);
     }
     $partner_host = myPartnerUtils::getHost($partner_id);
     $partner_cdnHost = myPartnerUtils::getCdnHost($partner_id);
     $html5_version = kConf::get('html5_version');
     $use_cdn = $uiConf->getUseCdn();
     $host = $use_cdn ? $partner_cdnHost : $partner_host;
     $ui_conf_html5_url = $uiConf->getHtml5Url();
     if ($ui_conf_html5_url) {
         $url = str_replace('mwEmbedLoader.php', 'mwEmbedFrame.php', $ui_conf_html5_url);
         if (!kString::beginsWith($ui_conf_html5_url, "http")) {
             // absolute URL
             $url = $host . $url;
         }
     } else {
         $url = $host;
         $url .= "/html5/html5lib/{$html5_version}/mwEmbedFrame.php";
     }
     if ($entry_id) {
         $url .= "/entry_id/{$entry_id}";
     }
     $url .= "/wid/{$widget_id}/uiconf_id/{$uiconf_id}";
     $url .= '?' . http_build_query($_GET, '', '&');
     // forward all GET parameters
     if ($allowCache) {
         $cache->put($requestKey, $url);
     }
     KExternalErrors::terminateDispatch();
     $this->redirect($url);
 }
开发者ID:DBezemer,项目名称:server,代码行数:101,代码来源:embedIframeAction.class.php

示例15: doAuthentication

 /**
  * Authenticates user on MySpace.com
  * @return boolean
  */
 function doAuthentication()
 {
     // Instructs to initialize cURL session
     $this->initCurl();
     // Sets the URL for authentication purpose
     $this->url = $this->loginURI;
     // Sets the number of fields to send via HTTP POST
     $this->usePostField = 1;
     // Sets the fields to be sent via HTTP POST as key=value
     $this->postFields = "email={$this->email}&password={$this->password}&Remember=&NextPage=fuseaction=profile.interests";
     $this->follow = 1;
     // Instructs to set Cookie Jar
     if ($this->setCookieJar() == FALSE) {
         $this->setError("cookie_error");
         return false;
     }
     // Checks if the cURL options are all set properly
     if ($this->setCurlOption()) {
         // Instructs to execute cURL session
         $this->hit_stack[] = "doAuthentication";
         $this->execCurl();
         // Checks if any cURL error is generated
         if ($this->getCurlError()) {
             $this->unlinkFile($this->cookieFileJar);
             $this->setError("curl_error");
             return false;
         }
         $this->log("step: 1\n");
         // Checks if the authentication failed, either invalid login or username is not registered
         if (preg_match("/Must Be Logged-In/i", $this->outputContent)) {
             // Instructs to close cURL session
             $this->closeCurl();
             // Unlinks the cookie file
             $this->unlinkFile($this->cookieFileJar);
             $this->setError("invalid_login");
             return false;
         }
         $this->log("step: 2\n");
         // Get the URL we are supposed to use for the Edit Profile action
         $link = self::getLinkString($this->outputContent, "Skip this Advertisement");
         if ($link != NULL) {
             $href = self::getHrefValue($link);
             if (!kString::beginsWith($href, "http")) {
                 $href = "http://login.myspace.com/index.cfm?" . $href;
             }
             $this->log("step: 3, Skip this Advertisement\n** href ** . {$href} ");
             $this->addDataURI = $href;
             $this->getDataURI = $href;
             $this->url = $href;
             //				$this->postFields = str_replace ( "fuseaction=profile.interests" , "fuseaction=user" , $this->postFields );
             $this->follow = 1;
             $this->setCurlOption();
             // have to follow an object that moved
             $this->execCurl();
             // Checks if any cURL error is generated
             if ($this->getCurlError()) {
                 $this->unlinkFile($this->cookieFileJar);
                 $this->setError("curl_error");
                 return false;
             }
             $this->log("step: 200, After - Skip this Advertisement\n");
             $link = self::getLinkString($this->outputContent, "here", "Object moved to");
             if ($link != NULL) {
                 $this->log("step: 300, Object moved to\n");
                 $href = self::getHrefValue($link);
                 $this->addDataURI = $href;
                 $this->getDataURI = $href;
             } else {
                 $this->log("step: 400, cannot follow href\n");
             }
         }
         $this->log("step: 4\n");
         // Try finding an 'Edit Profile' link
         $link = self::getLinkString($this->outputContent, "Edit Profile");
         $refinedURL = self::getHrefValue($link);
         if ($refinedURL == NULL) {
             $this->log("step: 7\n");
             $this->setError("parse_error");
             return false;
         }
         $this->log("step: 6\n ");
         $this->addDataURI = $refinedURL;
         $this->getDataURI = $refinedURL;
         $this->log("addDataURI: " . $this->addDataURI . " getDataURI: " . $this->getDataURI . "\n");
         $this->log("step: 9\n");
         $this->closeCurl();
     }
     unset($this->outputContent);
     $this->log("step: 10- ended doAuthentication successfully\n");
     return true;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:95,代码来源:___mySpaceUpdater.class.php


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