本文整理汇总了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 {