當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WebRequest::getRequestURL方法代碼示例

本文整理匯總了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;
 }
開發者ID:Grprashanthkumar,項目名稱:ColfusionWeb,代碼行數:16,代碼來源:WebInstaller.php

示例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);
開發者ID:D66Ha,項目名稱:mediawiki,代碼行數:31,代碼來源:Setup.php

示例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);
     }
 }
開發者ID:tetsuya-zama,項目名稱:LinkTitles,代碼行數:45,代碼來源:SpecialLinkTitles.php

示例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');
開發者ID:schwarer2006,項目名稱:wikia,代碼行數:31,代碼來源:Setup.php


注:本文中的WebRequest::getRequestURL方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。