当前位置: 首页>>代码示例>>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;未经允许,请勿转载。