本文整理匯總了PHP中MediaWiki\Logger\LoggerFactory::getProvider方法的典型用法代碼示例。如果您正苦於以下問題:PHP LoggerFactory::getProvider方法的具體用法?PHP LoggerFactory::getProvider怎麽用?PHP LoggerFactory::getProvider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MediaWiki\Logger\LoggerFactory
的用法示例。
在下文中一共展示了LoggerFactory::getProvider方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$wgLDAPPasswordHash = array('labs' => 'clear');
// 'invaliddomain' is set to true so that mail password options
// will be available on user creation and password mailing
$wgLDAPMailPassword = array('labs' => true, 'invaliddomain' => true);
$wgLDAPPreferences = array('labs' => array("email" => "mail"));
$wgLDAPUseFetchedUsername = array('labs' => true);
$wgLDAPLowerCaseUsernameScheme = array('labs' => false, 'invaliddomain' => false);
$wgLDAPLowerCaseUsername = array('labs' => false, 'invaliddomain' => false);
// Only enable UseLocal if you need to promote an LDAP user
#$wgLDAPUseLocal = true;
$wgLDAPDebug = 5;
// Maximally verbose logs for Andrew Bogott, 8-Dec-2015
// Local debug logging for troubleshooting LDAP issues
if (false) {
$wgLDAPDebug = 5;
$monolog = \Mediawiki\Logger\LoggerFactory::getProvider();
$monolog->mergeConfig(array('loggers' => array('ldap' => array('handlers' => array('wikitech-ldap'), 'processors' => array_keys($wmgMonologProcessors))), 'handlers' => array('wikitech-ldap' => array('class' => '\\Monolog\\Handler\\StreamHandler', 'args' => array('/tmp/ldap-s-1-debug.log'), 'formatter' => 'line'))));
}
require_once "{$IP}/extensions/OpenStackManager/OpenStackManager.php";
$wgOpenStackManagerNovaKeypairStorage = 'ldap';
$wgOpenStackManagerNovaIdentityURI = 'http://labcontrol1001.wikimedia.org:35357/v2.0';
$wgOpenStackManagerLDAPDomain = 'labs';
$wgOpenStackManagerLDAPProjectBaseDN = 'ou=projects,dc=wikimedia,dc=org';
$wgOpenStackManagerLDAPProjectGroupBaseDN = "ou=groups,dc=wikimedia,dc=org";
$wgOpenStackManagerLDAPInstanceBaseDN = 'ou=hosts,dc=wikimedia,dc=org';
$wgOpenStackManagerLDAPServiceGroupBaseDN = 'ou=servicegroups,dc=wikimedia,dc=org';
$wgOpenStackManagerLDAPDefaultGid = '500';
$wgOpenStackManagerLDAPDefaultShell = '/bin/bash';
$wgOpenStackManagerLDAPUseUidAsNamingAttribute = true;
$wgOpenStackManagerDNSOptions = array('enabled' => true, 'servers' => array('primary' => 'labcontrol1001.wikimedia.org'), 'soa' => array('hostmaster' => 'hostmaster.wikimedia.org', 'refresh' => '1800', 'retry' => '3600', 'expiry' => '86400', 'minimum' => '7200'));
$wgOpenStackManagerPuppetOptions = array('enabled' => true, 'defaultclasses' => array(), 'defaultvariables' => array());
示例2: restoreLoggers
/**
* Restores loggers replaced by setLogger().
* @since 1.27
*/
private function restoreLoggers()
{
$provider = LoggerFactory::getProvider();
$wrappedProvider = TestingAccessWrapper::newFromObject($provider);
$singletons = $wrappedProvider->singletons;
foreach ($this->loggers as $channel => $logger) {
if ($provider instanceof MonologSpi) {
if ($logger === null) {
unset($singletons['loggers'][$channel]);
} else {
$singletons['loggers'][$channel] = $logger;
}
} elseif ($provider instanceof LegacySpi) {
if ($logger === null) {
unset($singletons[$channel]);
} else {
$singletons[$channel] = $logger;
}
}
}
$wrappedProvider->singletons = $singletons;
$this->loggers = array();
}
示例3: array
// Register a handler that will buffer the event stream and
// pass events to the nested handler after closing the request
$wmgMonologConfig['handlers'][$bufferedHandler] = array('class' => '\\MediaWiki\\Logger\\Monolog\\BufferHandler', 'args' => array(function () use($handlerName) {
return LoggerFactory::getProvider()->getHandler($handlerName);
}));
}
$handlers[$idx] = $bufferedHandler;
}
}
if ($handlers) {
// T118057: wrap the collection of handlers in a WhatFailureGroupHandler
// to swallow any exceptions that might leak out otherwise
$failureGroupHandler = 'failuregroup|' . implode('|', $handlers);
if (!isset($wmgMonologConfig['handlers'][$failureGroupHandler])) {
$wmgMonologConfig['handlers'][$failureGroupHandler] = array('class' => '\\Monolog\\Handler\\WhatFailureGroupHandler', 'args' => array(function () use($handlers) {
$provider = LoggerFactory::getProvider();
return array_map(array($provider, 'getHandler'), $handlers);
}));
}
$wmgMonologConfig['loggers'][$channel] = array('handlers' => array($failureGroupHandler), 'processors' => array_keys($wmgMonologProcessors), 'calls' => $wmgMonologLoggerCalls);
} else {
// No handlers configured, so use the blackhole route
$wmgMonologConfig['loggers'][$channel] = array('handlers' => array('blackhole'), 'calls' => $wmgMonologLoggerCalls);
}
}
$wgMWLoggerDefaultSpi = array('class' => '\\MediaWiki\\Logger\\MonologSpi', 'args' => array($wmgMonologConfig));
// Bug: T99581 - force logger timezone to UTC
// Guard condition needed for Jenkins; class from mediawiki/vendor
if (method_exists('\\Monolog\\Logger', 'setTimezone')) {
\Monolog\Logger::setTimezone(new DateTimeZone('UTC'));
}