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


PHP MimeMagic::applyDefaultParameters方法代碼示例

本文整理匯總了PHP中MimeMagic::applyDefaultParameters方法的典型用法代碼示例。如果您正苦於以下問題:PHP MimeMagic::applyDefaultParameters方法的具體用法?PHP MimeMagic::applyDefaultParameters怎麽用?PHP MimeMagic::applyDefaultParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MimeMagic的用法示例。


在下文中一共展示了MimeMagic::applyDefaultParameters方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: RuntimeException

    if (!$secret) {
        throw new RuntimeException("Cannot use MWCryptHKDF without a secret.");
    }
    // In HKDF, the context can be known to the attacker, but this will
    // keep simultaneous runs from producing the same output.
    $context = [microtime(), getmypid(), gethostname()];
    // Setup salt cache. Use APC, or fallback to the main cache if it isn't setup
    $cache = $services->getLocalServerObjectCache();
    if ($cache instanceof EmptyBagOStuff) {
        $cache = ObjectCache::getLocalClusterInstance();
    }
    return new CryptHKDF($secret, $config->get('HKDFAlgorithm'), $cache, $context, $services->getCryptRand());
}, 'MediaHandlerFactory' => function (MediaWikiServices $services) {
    return new MediaHandlerFactory($services->getMainConfig()->get('MediaHandlers'));
}, 'MimeAnalyzer' => function (MediaWikiServices $services) {
    return new MimeMagic(MimeMagic::applyDefaultParameters([], $services->getMainConfig()));
}, 'ProxyLookup' => function (MediaWikiServices $services) {
    $mainConfig = $services->getMainConfig();
    return new ProxyLookup($mainConfig->get('SquidServers'), $mainConfig->get('SquidServersNoPurge'));
}, 'Parser' => function (MediaWikiServices $services) {
    $conf = $services->getMainConfig()->get('ParserConf');
    return ObjectFactory::constructClassInstance($conf['class'], [$conf]);
}, 'LinkCache' => function (MediaWikiServices $services) {
    return new LinkCache($services->getTitleFormatter(), ObjectCache::getMainWANInstance());
}, 'LinkRendererFactory' => function (MediaWikiServices $services) {
    return new LinkRendererFactory($services->getTitleFormatter(), $services->getLinkCache());
}, 'LinkRenderer' => function (MediaWikiServices $services) {
    global $wgUser;
    if (defined('MW_NO_SESSION')) {
        return $services->getLinkRendererFactory()->create();
    } else {
開發者ID:paladox,項目名稱:mediawiki,代碼行數:31,代碼來源:ServiceWiring.php


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