99 $level = Logger::DEBUG,
102 parent::__construct( $level, $bubble );
103 $this->uri = $stream;
113 'Missing stream uri, the stream can not be opened.' );
116 set_error_handler( [ $this,
'errorTrap' ] );
118 if ( substr( $this->uri, 0, 4 ) ==
'udp:' ) {
119 $parsed = parse_url( $this->uri );
120 if ( !isset( $parsed[
'host'] ) ) {
122 'Udp transport "%s" must specify a host', $this->uri
125 if ( !isset( $parsed[
'port'] ) ) {
127 'Udp transport "%s" must specify a port', $this->uri
131 $this->host = $parsed[
'host'];
132 $this->
port = $parsed[
'port'];
135 if ( isset( $parsed[
'path'] ) ) {
136 $this->prefix = ltrim( $parsed[
'path'],
'/' );
139 if ( filter_var( $this->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {
146 $this->sink = socket_create( $domain, SOCK_DGRAM, SOL_UDP );
149 $this->sink = fopen( $this->uri,
'a' );
151 restore_error_handler();
153 if ( !is_resource( $this->sink ) ) {
156 'The stream or file "%s" could not be opened: %s',
157 $this->uri, $this->error
176 return $this->host !== null;
180 if ( $this->useLegacyFilter &&
182 $record[
'channel'], $record[
'message'],
183 $record[
'level'], $record
192 if ( $this->sink === null ) {
196 $text = (
string)$record[
'formatted'];
200 if ( $this->prefix !==
'' ) {
201 $leader = ( $this->prefix ===
'{channel}' ) ?
202 $record[
'channel'] : $this->prefix;
203 $text = preg_replace(
'/^/m',
"{$leader} ", $text );
206 if ( strlen( $text ) > 65506 ) {
207 $text = substr( $text, 0, 65506 );
210 if ( substr( $text, -1 ) !=
"\n" ) {
214 } elseif ( strlen( $text ) > 65507 ) {
215 $text = substr( $text, 0, 65507 );
219 $this->sink, $text, strlen( $text ), 0, $this->host, $this->
port
223 fwrite( $this->sink, $text );
228 if ( is_resource( $this->sink ) ) {
230 socket_close( $this->sink );
233 fclose( $this->sink );
MediaWiki Logger LegacyLogger
the array() calling protocol came about after MediaWiki 1.4rc1.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
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 probably a stub 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