本文整理汇总了PHP中Misc::makeUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::makeUrl方法的具体用法?PHP Misc::makeUrl怎么用?PHP Misc::makeUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Misc
的用法示例。
在下文中一共展示了Misc::makeUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeWikiHowUrl
public static function makeWikiHowUrl(&$pageTitle)
{
return Misc::makeUrl($pageTitle);
}
示例2: outputArticleReport
function outputArticleReport()
{
global $wgRequest;
$urls = split("\n", trim(Misc::getUrlDecodedData($wgRequest->getVal('data'))));
$dbr = wfGetDB(DB_SLAVE);
$articles = array();
foreach ($urls as $url) {
$t = Title::newFromText(str_replace("http://www.wikihow.com/", "", $url));
if ($t && $t->exists()) {
$articles[$t->getArticleId()] = array('url' => Misc::makeUrl($t->getText()));
if ($this->slowQuery) {
$wikitext = Wikitext::getWikitext($dbr, $t);
$articles[$t->getArticleId()]['alts'] = $this->hasAlternateMethods($wikitext) ? "Yes" : "No";
$articles[$t->getArticleId()]['size'] = $this->getArticleSize($t);
$articles[$t->getArticleId()]['imgs'] = $this->hasImages($wikitext);
}
}
}
$this->addPageCounts($articles);
if ($wgRequest->getVal('format') == 'csv') {
$output = $this->getArticleReportCSV($articles);
$this->sendFile('article_stats', $output);
} else {
$output = $this->getArticleReportHtml($articles);
$this->sendHtml($output);
}
}
示例3: displayDataCSV
/**
* Display data as CSV, not as a summary.
*/
private static function displayDataCSV($data)
{
self::httpDownloadHeaders();
$headers = array('__', '0-10s', '3+m', 'mobile-0-10s', 'mobile__');
print "page," . implode(",", $headers) . "\n";
foreach ($data as $page => $datum) {
$line = Misc::makeUrl($page);
self::computePercentagesForCSV($datum);
foreach ($headers as $header) {
$line .= ',' . (isset($datum[$header]) ? $datum[$header] : '');
}
print "{$line}\n";
}
exit;
}
示例4: getUrl
public function getUrl()
{
return Misc::makeUrl($this->page_title);
}