25use Monolog\Handler\AbstractProcessingHandler;
27use UnexpectedValueException;
98 $level = Logger::DEBUG,
101 parent::__construct( $level, $bubble );
102 $this->uri = $stream;
111 throw new LogicException(
112 'Missing stream uri, the stream can not be opened.' );
115 set_error_handler( [ $this,
'errorTrap' ] );
117 if ( substr( $this->uri, 0, 4 ) ==
'udp:' ) {
118 $parsed = parse_url( $this->uri );
119 if ( !isset( $parsed[
'host'] ) ) {
120 throw new UnexpectedValueException( sprintf(
121 'Udp transport "%s" must specify a host', $this->uri
124 if ( !isset( $parsed[
'port'] ) ) {
125 throw new UnexpectedValueException( sprintf(
126 'Udp transport "%s" must specify a port', $this->uri
130 $this->host = $parsed[
'host'];
131 $this->
port = $parsed[
'port'];
134 if ( isset( $parsed[
'path'] ) ) {
135 $this->prefix = ltrim( $parsed[
'path'],
'/' );
138 if ( filter_var( $this->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {
145 $this->sink = socket_create( $domain, SOCK_DGRAM, SOL_UDP );
148 $this->sink = fopen( $this->uri,
'a' );
150 restore_error_handler();
152 if ( !is_resource( $this->sink ) ) {
154 throw new UnexpectedValueException( sprintf(
155 'The stream or file "%s" could not be opened: %s',
156 $this->uri, $this->
error
175 return $this->host !==
null;
179 if ( $this->useLegacyFilter &&
181 $record[
'channel'], $record[
'message'],
182 $record[
'level'], $record
191 if ( $this->sink ===
null ) {
195 $text = (
string)$record[
'formatted'];
198 if ( $this->prefix !==
'' ) {
199 $leader = ( $this->prefix ===
'{channel}' ) ?
201 $text = preg_replace(
'/^/m',
"{$leader} ", $text );
204 if ( strlen( $text ) > 65506 ) {
205 $text = substr( $text, 0, 65506 );
208 if ( substr( $text, -1 ) !=
"\n" ) {
212 } elseif ( strlen( $text ) > 65507 ) {
213 $text = substr( $text, 0, 65507 );
217 $this->sink, $text, strlen( $text ), 0, $this->host, $this->
port
221 fwrite( $this->sink, $text );
226 if ( is_resource( $this->sink ) ) {
228 socket_close( $this->sink );
231 fclose( $this->sink );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults error
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
storage can be distributed across multiple and multiple web servers can use the same cache cluster *********************W A R N I N G ***********************Memcached has no security or authentication Please ensure that your server is appropriately and that the port(s) used for memcached servers are not publicly accessible. Otherwise
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))