Move fatal PHP functions checks to initialization
[lhc/web/wiklou.git] / includes / Setup.php
index 5b19b5f..5877932 100644 (file)
@@ -45,6 +45,8 @@ if ( !isset( $wgVersion ) ) {
        die( 1 );
 }
 
+mb_internal_encoding( 'UTF-8' );
+
 // Set various default paths sensibly...
 $ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' );
 
@@ -850,15 +852,20 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
        if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
                $ps_autocreate = Profiler::instance()->scopedProfileIn( $fname . '-autocreate' );
                if ( $wgDisableAuthManager ) {
-                       MediaWiki\Session\SessionManager::autoCreateUser( $sessionUser );
+                       $res = MediaWiki\Session\SessionManager::autoCreateUser( $sessionUser );
                } else {
-                       MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
+                       $res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
                                $sessionUser,
-                               MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSSION,
+                               MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
                                true
                        );
                }
                Profiler::instance()->scopedProfileOut( $ps_autocreate );
+               \MediaWiki\Logger\LoggerFactory::getInstance( 'authmanager' )->info( 'Autocreation attempt', [
+                       'event' => 'autocreate',
+                       'status' => $res,
+               ] );
+               unset( $res );
        }
        unset( $sessionUser );
 }