本文整理汇总了PHP中WebRequest::getRequestURL方法的典型用法代码示例。如果您正苦于以下问题:PHP WebRequest::getRequestURL方法的具体用法?PHP WebRequest::getRequestURL怎么用?PHP WebRequest::getRequestURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebRequest
的用法示例。
在下文中一共展示了WebRequest::getRequestURL方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUrl
/**
* Get a URL for submission back to the same script.
*
* @param $query array
* @return string
*/
public function getUrl($query = array())
{
$url = $this->request->getRequestURL();
# Remove existing query
$url = preg_replace('/\\?.*$/', '', $url);
if ($query) {
$url .= '?' . wfArrayToCgi($query);
}
return $url;
}
示例2: date
}
date_default_timezone_set($wgLocaltimezone);
if (is_null($wgLocalTZoffset)) {
$wgLocalTZoffset = date('Z') / 60;
}
if (!$wgDBerrorLogTZ) {
$wgDBerrorLogTZ = $wgLocaltimezone;
}
// Useful debug output
if ($wgCommandLineMode) {
$wgRequest = new FauxRequest(array());
wfDebug("\n\nStart command line script {$self}\n");
} else {
// Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
$wgRequest = new WebRequest();
$debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n";
if ($wgDebugPrintHttpHeaders) {
$debug .= "HTTP HEADERS:\n";
foreach ($wgRequest->getAllHeaders() as $name => $value) {
$debug .= "{$name}: {$value}\n";
}
}
wfDebug($debug);
}
Profiler::instance()->scopedProfileOut($ps_misc);
$ps_memcached = Profiler::instance()->scopedProfileIn($fname . '-memcached');
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
$parserMemc = wfGetParserCacheStorage();
wfDebugLog('caches', 'main: ' . get_class($wgMemc) . ', message: ' . get_class($messageMemc) . ', parser: ' . get_class($parserMemc));
Profiler::instance()->scopedProfileOut($ps_memcached);
示例3: process
private function process(WebRequest &$request, OutputPage &$output)
{
global $wgLinkTitlesTimeLimit;
// Start the stopwatch
$startTime = microtime(true);
// Connect to the database
$dbr = wfGetDB(DB_SLAVE);
// Fetch the start index and max number of records from the POST
// request.
$postValues = $request->getValues();
// Convert the start index to an integer; this helps preventing
// SQL injection attacks via forged POST requests.
$start = intval($postValues['s']);
// If an end index was given, we don't need to query the database
if (array_key_exists('e', $postValues)) {
$end = intval($postValues['e']);
} else {
// No end index was given. Therefore, count pages now.
$end = $this->countPages($dbr);
}
array_key_exists('r', $postValues) ? $reloads = $postValues['r'] : ($reloads = 0);
// Retrieve page names from the database.
$res = $dbr->select('page', 'page_title', array('page_namespace = 0'), __METHOD__, array('LIMIT' => 999999999, 'OFFSET' => $start));
// Iterate through the pages; break if a time limit is exceeded.
foreach ($res as $row) {
$curTitle = $row->page_title;
LinkTitles::processPage($curTitle, $this->getContext());
$start += 1;
// Check if the time limit is exceeded
if (microtime(true) - $startTime > $wgLinkTitlesTimeLimit) {
break;
}
}
$this->addProgressInfo($output, $curTitle, $start, $end);
// If we have not reached the last page yet, produce code to reload
// the extension's special page.
if ($start < $end) {
$reloads += 1;
// Build a form with hidden values and output JavaScript code that
// immediately submits the form in order to continue the process.
$output->addHTML($this->getReloaderForm($request->getRequestURL(), $start, $end, $reloads));
} else {
$this->addCompletedInfo($output, $start, $end, $reloads);
}
}
示例4: wfSuppressWarnings
wfSuppressWarnings();
$wgLocaltimezone = date_default_timezone_get();
wfRestoreWarnings();
}
date_default_timezone_set($wgLocaltimezone);
if (is_null($wgLocalTZoffset)) {
$wgLocalTZoffset = date('Z') / 60;
}
# Useful debug output
if ($wgCommandLineMode) {
$wgRequest = new FauxRequest(array());
wfDebug("\n\nStart command line script {$self}\n");
} else {
# Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
$wgRequest = new WebRequest();
$debug = "Start request\n\n{$_SERVER['REQUEST_METHOD']} {$wgRequest->getRequestURL()}";
if ($wgDebugPrintHttpHeaders) {
$debug .= "\nHTTP HEADERS:\n";
foreach ($wgRequest->getAllHeaders() as $name => $value) {
$debug .= "{$name}: {$value}\n";
}
}
wfDebug("{$debug}\n");
}
wfProfileOut($fname . '-misc1');
wfProfileIn($fname . '-memcached');
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
$parserMemc = wfGetParserCacheStorage();
wfDebug('CACHES: ' . get_class($wgMemc) . '[main] ' . get_class($messageMemc) . '[message] ' . get_class($parserMemc) . "[parser]\n");
wfProfileOut($fname . '-memcached');