當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZURL::urlByMD5方法代碼示例

本文整理匯總了PHP中eZURL::urlByMD5方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZURL::urlByMD5方法的具體用法?PHP eZURL::urlByMD5怎麽用?PHP eZURL::urlByMD5使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZURL的用法示例。


在下文中一共展示了eZURL::urlByMD5方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: modify


//.........這裏部分代碼省略.........
                         } else {
                             if ($checkExistence) {
                                 $operatorValue = false;
                                 return;
                             }
                             $tpl->error($operatorName, "Unknown get variable '{$httpName}'");
                         }
                         break;
                     case eZURLOperator::HTTP_OPERATOR_TYPE_SESSION:
                         if ($http->hasSessionVariable($httpName)) {
                             $operatorValue = !$checkExistence ? $http->sessionVariable($httpName) : true;
                         } else {
                             if ($checkExistence) {
                                 $operatorValue = false;
                                 return;
                             }
                             $tpl->error($operatorName, "Unknown session variable '{$httpName}'");
                         }
                         break;
                     case eZURLOperator::HTTP_OPERATOR_TYPE_COOKIE:
                         if (array_key_exists($httpName, $_COOKIE)) {
                             $operatorValue = !$checkExistence ? $_COOKIE[$httpName] : true;
                         } else {
                             if ($checkExistence) {
                                 $operatorValue = false;
                                 return;
                             }
                             $tpl->error($operatorName, "Unknown cookie variable '{$httpName}'");
                         }
                         break;
                 }
             } else {
                 $operatorValue = $http;
             }
             return;
             break;
         case $this->URLName:
             eZURI::transformURI($operatorValue, false, $namedParameters['server_url']);
             break;
         case $this->URLRootName:
             if (preg_match("#^[a-zA-Z0-9]+:#", $operatorValue) or substr($operatorValue, 0, 2) == '//') {
                 break;
             }
             if (strlen($operatorValue) > 0 and $operatorValue[0] != '/') {
                 $operatorValue = '/' . $operatorValue;
             }
             // Same as "ezurl" without "index.php" and the siteaccess name in the returned address.
             eZURI::transformURI($operatorValue, true, $namedParameters['server_url']);
             break;
         case $this->SysName:
             if (count($operatorParameters) == 0) {
                 $tpl->warning('eZURLOperator' . $operatorName, 'Requires attributename');
             } else {
                 $sysAttribute = $tpl->elementValue($operatorParameters[0], $rootNamespace, $currentNamespace);
                 if (!$this->Sys->hasAttribute($sysAttribute)) {
                     $tpl->warning('eZURLOperator' . $operatorName, "No such attribute '{$sysAttribute}' for eZSys");
                 } else {
                     $operatorValue = $this->Sys->attribute($sysAttribute);
                 }
             }
             return;
             break;
         case $this->ImageName:
             if (count($operatorParameters) == 2 && $tpl->elementValue($operatorParameters[1], $rootNamespace, $currentNamespace) == true && strlen($this->Sys->wwwDir()) == 0) {
                 $skipSlash = true;
             } else {
                 $skipSlash = false;
             }
             $operatorValue = $this->eZImage($tpl, $operatorValue, $operatorName, $skipSlash);
             break;
         case $this->ExtName:
             $urlMD5 = md5($operatorValue);
             $url = eZURL::urlByMD5($urlMD5);
             if ($url === false) {
                 eZURL::registerURL($operatorValue);
             } else {
                 $operatorValue = $url;
             }
             break;
         case $this->DesignName:
             $operatorValue = $this->eZDesign($tpl, $operatorValue, $operatorName);
             break;
     }
     $quote = "\"";
     $val = $namedParameters['quote_val'];
     if ($val == 'single') {
         $quote = "'";
     } else {
         if ($val == 'no') {
             $quote = false;
         }
     }
     $http = eZHTTPTool::instance();
     if (isset($http->UseFullUrl) and $http->UseFullUrl and strncasecmp($operatorValue, '/', 1) === 0) {
         $operatorValue = $http->createRedirectUrl($operatorValue, array('pre_url' => false));
     }
     if ($quote !== false) {
         $operatorValue = $quote . $operatorValue . $quote;
     }
 }
開發者ID:stevoland,項目名稱:ez_patch,代碼行數:101,代碼來源:ezurloperator.php


注:本文中的eZURL::urlByMD5方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。