本文整理匯總了PHP中jUrl::getRootUrlRessourceValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP jUrl::getRootUrlRessourceValue方法的具體用法?PHP jUrl::getRootUrlRessourceValue怎麽用?PHP jUrl::getRootUrlRessourceValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jUrl
的用法示例。
在下文中一共展示了jUrl::getRootUrlRessourceValue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRootUrl
/**
* get the root url for a given ressource type. Root URLs are stored in config file.
* @param string $ressourceType Name of the ressource
* @return string the root URL corresponding to this ressource, or basePath if unknown
*/
public static function getRootUrl($ressourceType)
{
$rootUrl = jUrl::getRootUrlRessourceValue($ressourceType);
if ($rootUrl !== null) {
if (substr($rootUrl, 0, 7) !== 'http://' && substr($rootUrl, 0, 8) !== 'https://' && substr($rootUrl, 0, 1) !== '/') {
//and is not relative to root
// so let's prepend basePath :
$rootUrl = jApp::config()->urlengine['basePath'] . $rootUrl;
}
} else {
// basePath by default :
$rootUrl = jApp::config()->urlengine['basePath'];
}
return $rootUrl;
}
示例2: _compile
/**
* Generate the WSDL content
*/
private function _compile()
{
$url = jUrl::get($this->module . '~' . $this->controller . ':index@soap', array(), jUrl::JURL);
$url->clearParam();
$url->setParam('service', $this->module . '~' . $this->controller);
$serverUri = jUrl::getRootUrlRessourceValue('soap');
if ($serverUri === null) {
$serverUri = jUrl::getRootUrlRessourceValue('soap-' . $this->module);
}
if ($serverUri === null) {
$serverUri = jUrl::getRootUrlRessourceValue('soap-' . $this->module . '-' . $this->controller);
}
if ($serverUri === null) {
$serverUri = jApp::coord()->request->getServerURI();
}
$serviceURL = $serverUri . $url->toString();
$serviceNameSpace = $serverUri . jApp::urlBasePath();
$wsdl = new WSDLStruct($serviceNameSpace, $serviceURL, SOAP_RPC, SOAP_ENCODED);
$wsdl->setService(new IPReflectionClass($this->controllerClassName));
try {
$gendoc = $wsdl->generateDocument();
} catch (WSDLException $exception) {
throw new JException('jsoap~errors.wsdl.generation', $exception->msg);
}
return $gendoc;
}
示例3: getRootUrl
public static function getRootUrl($ressourceType)
{
$rootUrl = jUrl::getRootUrlRessourceValue($ressourceType);
if ($rootUrl !== null) {
if (substr($rootUrl, 0, 7) !== 'http://' && substr($rootUrl, 0, 8) !== 'https://' && substr($rootUrl, 0, 1) !== '/') {
$rootUrl = jApp::config()->urlengine['basePath'] . $rootUrl;
}
} else {
$rootUrl = jApp::config()->urlengine['basePath'];
}
return $rootUrl;
}