当前位置: 首页>>代码示例>>PHP>>正文


PHP MWDebug::deprecated方法代码示例

本文整理汇总了PHP中MWDebug::deprecated方法的典型用法代码示例。如果您正苦于以下问题:PHP MWDebug::deprecated方法的具体用法?PHP MWDebug::deprecated怎么用?PHP MWDebug::deprecated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MWDebug的用法示例。


在下文中一共展示了MWDebug::deprecated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAvoidNonConsecutivesDuplicateDeprecations

 /**
  * @covers MWDebug::deprecated
  */
 public function testAvoidNonConsecutivesDuplicateDeprecations()
 {
     MWDebug::deprecated('wfOldFunction', '1.0', 'component');
     MWDebug::warning('some warning');
     MWDebug::log('we could have logged something too');
     // Another deprecation
     MWDebug::deprecated('wfOldFunction', '1.0', 'component');
     // assertCount() not available on WMF integration server
     $this->assertEquals(3, count(MWDebug::getLog()), "Only one deprecated warning per function should be kept");
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:13,代码来源:MWDebugTest.php

示例2: wfDeprecated

/**
 * Throws a warning that $function is deprecated
 *
 * @param string $function
 * @param string|bool $version Version of MediaWiki that the function
 *    was deprecated in (Added in 1.19).
 * @param string|bool $component Added in 1.19.
 * @param int $callerOffset How far up the call stack is the original
 *    caller. 2 = function that called the function that called
 *    wfDeprecated (Added in 1.20)
 *
 * @return null
 */
function wfDeprecated($function, $version = false, $component = false, $callerOffset = 2)
{
    MWDebug::deprecated($function, $version, $component, $callerOffset + 1);
}
开发者ID:D66Ha,项目名称:mediawiki,代码行数:17,代码来源:GlobalFunctions.php

示例3: wfDeprecated

/**
 * Throws a warning that $function is deprecated
 *
 * @param $function String
 * @param $version String|false: Added in 1.19.
 * @param $component String|false: Added in 1.19.
 *
 * @return null
 */
function wfDeprecated($function, $version = false, $component = false)
{
    static $functionsWarned = array();
    MWDebug::deprecated($function, $version, $component);
    if (!isset($functionsWarned[$function])) {
        $functionsWarned[$function] = true;
        if ($version) {
            global $wgDeprecationReleaseLimit;
            if ($wgDeprecationReleaseLimit && $component === false) {
                # Strip -* off the end of $version so that branches can use the
                # format #.##-branchname to avoid issues if the branch is merged into
                # a version of MediaWiki later than what it was branched from
                $comparableVersion = preg_replace('/-.*$/', '', $version);
                # If the comparableVersion is larger than our release limit then
                # skip the warning message for the deprecation
                if (version_compare($wgDeprecationReleaseLimit, $comparableVersion, '<')) {
                    return;
                }
            }
            $component = $component === false ? 'MediaWiki' : $component;
            wfWarn("Use of {$function} was deprecated in {$component} {$version}.", 2);
        } else {
            wfWarn("Use of {$function} is deprecated.", 2);
        }
    }
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:35,代码来源:GlobalFunctions.php


注:本文中的MWDebug::deprecated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。