本文整理汇总了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;
}
}