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