本文整理匯總了PHP中wfHostName函數的典型用法代碼示例。如果您正苦於以下問題:PHP wfHostName函數的具體用法?PHP wfHostName怎麽用?PHP wfHostName使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了wfHostName函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setupExecuteAction
/**
* Set up for the execution.
* @return array
*/
protected function setupExecuteAction()
{
// First add the id to the top element
$result = $this->getResult();
$requestid = $this->getParameter('requestid');
if (!is_null($requestid)) {
$result->addValue(null, 'requestid', $requestid);
}
if ($this->getConfig()->get('ShowHostnames')) {
$servedby = $this->getParameter('servedby');
if ($servedby) {
$result->addValue(null, 'servedby', wfHostName());
}
}
if ($this->getParameter('curtimestamp')) {
$result->addValue(null, 'curtimestamp', wfTimestamp(TS_ISO_8601, time()), ApiResult::NO_SIZE_CHECK);
}
$params = $this->extractRequestParams();
$this->mAction = $params['action'];
if (!is_string($this->mAction)) {
$this->dieUsage('The API requires a valid action parameter', 'unknown_action');
}
return $params;
}
示例2: setupExecuteAction
/**
* Set up for the execution.
* @return array
*/
protected function setupExecuteAction()
{
// First add the id to the top element
$result = $this->getResult();
$requestid = $this->getParameter('requestid');
if (!is_null($requestid)) {
$result->addValue(null, 'requestid', $requestid);
}
$servedby = $this->getParameter('servedby');
if ($servedby) {
$result->addValue(null, 'servedby', wfHostName());
}
$params = $this->extractRequestParams();
$this->mShowVersions = $params['version'];
$this->mAction = $params['action'];
if (!is_string($this->mAction)) {
$this->dieUsage('The API requires a valid action parameter', 'unknown_action');
}
return $params;
}