X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Flibs%2Frdbms%2Flbfactory%2FLBFactory.php;h=19b8fdc2389b6e462196b049980616623ff234ca;hb=48f931b9cb0f4b53e84cfc090e4313f71a130941;hp=bc428ece001822964d3428ac2f94822092370280;hpb=6a830879a594653842dd623c4fa36559e346cc5d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php b/includes/libs/rdbms/lbfactory/LBFactory.php index bc428ece00..19b8fdc238 100644 --- a/includes/libs/rdbms/lbfactory/LBFactory.php +++ b/includes/libs/rdbms/lbfactory/LBFactory.php @@ -52,6 +52,8 @@ abstract class LBFactory implements ILBFactory { protected $perfLogger; /** @var callable Error logger */ protected $errorLogger; + /** @var callable Deprecation logger */ + protected $deprecationLogger; /** @var BagOStuff */ protected $srvCache; /** @var BagOStuff */ @@ -109,7 +111,12 @@ abstract class LBFactory implements ILBFactory { $this->errorLogger = isset( $conf['errorLogger'] ) ? $conf['errorLogger'] : function ( Exception $e ) { - trigger_error( E_USER_WARNING, get_class( $e ) . ': ' . $e->getMessage() ); + trigger_error( get_class( $e ) . ': ' . $e->getMessage(), E_USER_WARNING ); + }; + $this->deprecationLogger = isset( $conf['deprecationLogger'] ) + ? $conf['deprecationLogger'] + : function ( $msg ) { + trigger_error( $msg, E_USER_DEPRECATED ); }; $this->profiler = isset( $conf['profiler'] ) ? $conf['profiler'] : null; @@ -124,7 +131,9 @@ abstract class LBFactory implements ILBFactory { 'ChronologyPositionIndex' => isset( $_GET['cpPosIndex'] ) ? $_GET['cpPosIndex'] : null ]; - $this->cliMode = isset( $conf['cliMode'] ) ? $conf['cliMode'] : PHP_SAPI === 'cli'; + $this->cliMode = isset( $conf['cliMode'] ) + ? $conf['cliMode'] + : ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ); $this->hostname = isset( $conf['hostname'] ) ? $conf['hostname'] : gethostname(); $this->agent = isset( $conf['agent'] ) ? $conf['agent'] : ''; @@ -514,6 +523,7 @@ abstract class LBFactory implements ILBFactory { 'connLogger' => $this->connLogger, 'replLogger' => $this->replLogger, 'errorLogger' => $this->errorLogger, + 'deprecationLogger' => $this->deprecationLogger, 'hostname' => $this->hostname, 'cliMode' => $this->cliMode, 'agent' => $this->agent,