本文整理汇总了PHP中ParserOptions::getDateFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP ParserOptions::getDateFormat方法的具体用法?PHP ParserOptions::getDateFormat怎么用?PHP ParserOptions::getDateFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParserOptions
的用法示例。
在下文中一共展示了ParserOptions::getDateFormat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: matches
/**
* Check if these options match that of another options set
*
* This ignores report limit settings that only affect HTML comments
*
* @param ParserOptions $other
* @return bool
* @since 1.25
*/
public function matches(ParserOptions $other)
{
$fields = array_keys(get_class_vars(__CLASS__));
$fields = array_diff($fields, array('mEnableLimitReport', 'onAccessCallback'));
foreach ($fields as $field) {
if (!is_object($this->{$field}) && $this->{$field} !== $other->{$field}) {
return false;
}
}
// Check the object and lazy-loaded options
return $this->mUserLang->getCode() === $other->mUserLang->getCode() && $this->getDateFormat() === $other->getDateFormat();
}
示例2: internalParse
/**
* Helper function for parse() that transforms wiki markup into
* HTML. Only called for $mOutputType == self::OT_HTML.
*
* @private
*
* @param $text string
* @param $isMain bool
* @param $frame bool
*
* @return string
*/
function internalParse($text, $isMain = true, $frame = false)
{
wfProfileIn(__METHOD__);
$origText = $text;
# Hook to suspend the parser in this state
if (!wfRunHooks('ParserBeforeInternalParse', array(&$this, &$text, &$this->mStripState))) {
wfProfileOut(__METHOD__);
return $text;
}
# if $frame is provided, then use $frame for replacing any variables
if ($frame) {
# use frame depth to infer how include/noinclude tags should be handled
# depth=0 means this is the top-level document; otherwise it's an included document
if (!$frame->depth) {
$flag = 0;
} else {
$flag = Parser::PTD_FOR_INCLUSION;
}
$dom = $this->preprocessToDom($text, $flag);
$text = $frame->expand($dom);
} else {
# if $frame is not provided, then use old-style replaceVariables
$text = $this->replaceVariables($text);
}
wfRunHooks('InternalParseBeforeSanitize', array(&$this, &$text, &$this->mStripState));
$text = Sanitizer::removeHTMLtags($text, array(&$this, 'attributeStripCallback'), false, array_keys($this->mTransparentTagHooks));
wfRunHooks('InternalParseBeforeLinks', array(&$this, &$text, &$this->mStripState));
# Tables need to come after variable replacement for things to work
# properly; putting them before other transformations should keep
# exciting things like link expansions from showing up in surprising
# places.
$text = $this->doTableStuff($text);
$text = preg_replace('/(^|\\n)-----*/', '\\1<hr />', $text);
$text = $this->doDoubleUnderscore($text);
$text = $this->doHeadings($text);
if ($this->mOptions->getUseDynamicDates()) {
$df = DateFormatter::getInstance();
$text = $df->reformat($this->mOptions->getDateFormat(), $text);
}
$text = $this->replaceInternalLinks($text);
$text = $this->doAllQuotes($text);
$text = $this->replaceExternalLinks($text);
# replaceInternalLinks may sometimes leave behind
# absolute URLs, which have to be masked to hide them from replaceExternalLinks
$text = str_replace($this->mUniqPrefix . 'NOPARSE', '', $text);
$text = $this->doMagicLinks($text);
$text = $this->formatHeadings($text, $origText, $isMain);
wfProfileOut(__METHOD__);
return $text;
}