X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=a5e204809930990b4315e1e745deca548759e3b3;hb=aab04d9b84d9581f3c58c2403d7b46e7aef16c9d;hp=8a9436e04950c7f2db99fbedcde5a984591eb27d;hpb=984ac2288dfe7298626727e630abfca2e3cff35d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index 8a9436e049..a5e2048099 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -1,7 +1,6 @@ 'LocalRepo', + 'name' => 'local', + 'directory' => $wgUploadDirectory, + 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath, + 'hashLevels' => $wgHashedUploadDirectory ? 2 : 0, + 'thumbScriptUrl' => $wgThumbnailScriptPath, + 'transformVia404' => !$wgGenerateThumbnailOnParse, + 'initialCapital' => $wgCapitalLinks, + ); +} +/** + * Initialise shared repo from backwards-compatible settings + */ +if ( $wgUseSharedUploads ) { + if ( $wgSharedUploadDBname ) { + $wgForeignFileRepos[] = array( + 'class' => 'ForeignDBRepo', + 'name' => 'shared', + 'directory' => $wgSharedUploadDirectory, + 'url' => $wgSharedUploadPath, + 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0, + 'thumbScriptUrl' => $wgSharedThumbnailScriptPath, + 'transformVia404' => !$wgGenerateThumbnailOnParse, + 'dbType' => $wgDBtype, + 'dbServer' => $wgDBserver, + 'dbUser' => $wgDBuser, + 'dbPassword' => $wgDBpassword, + 'dbName' => $wgSharedUploadDBname, + 'dbFlags' => DBO_DEFAULT, + 'tablePrefix' => $wgSharedUploadDBprefix, + 'hasSharedCache' => $wgCacheSharedUploads, + 'descBaseUrl' => $wgRepositoryBaseUrl, + 'fetchDescription' => $wgFetchCommonsDescriptions, + ); + } else { + $wgForeignFileRepos[] = array( + 'class' => 'FSRepo', + 'name' => 'shared', + 'directory' => $wgSharedUploadDirectory, + 'url' => $wgSharedUploadPath, + 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0, + 'thumbScriptUrl' => $wgSharedThumbnailScriptPath, + 'transformVia404' => !$wgGenerateThumbnailOnParse, + 'descBaseUrl' => $wgRepositoryBaseUrl, + 'fetchDescription' => $wgFetchCommonsDescriptions, + ); + } +} + require_once( "$IP/includes/AutoLoader.php" ); wfProfileIn( $fname.'-exception' ); @@ -131,13 +187,14 @@ if ( $wgDBprefix ) { } else { $wgCookiePrefix = $wgDBname; } +$wgCookiePrefix = strtr($wgCookiePrefix, "=,; +.\"'\\[", "__________"); # If session.auto_start is there, we can't touch session name # if( !ini_get( 'session.auto_start' ) ) session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' ); -if( !$wgCommandLineMode && ( isset( $_COOKIE[session_name()] ) || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) { +if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) { wfIncrStats( 'request_with_session' ); wfSetupSession(); $wgSessionStarted = true; @@ -164,6 +221,10 @@ if ( !$wgDBservers ) { $wgLoadBalancer = new StubObject( 'wgLoadBalancer', 'LoadBalancer', array( $wgDBservers, false, $wgMasterWaitTimeout, true ) ); $wgContLang = new StubContLang; + +// Now that variant lists may be available... +$wgRequest->interpolateTitle(); + $wgUser = new StubUser; $wgLang = new StubUserLang; $wgOut = new StubObject( 'wgOut', 'OutputPage' ); @@ -196,6 +257,9 @@ $wgPostCommitUpdateList = array(); if ( $wgAjaxSearch ) $wgAjaxExportList[] = 'wfSajaxSearch'; if ( $wgAjaxWatch ) $wgAjaxExportList[] = 'wfAjaxWatch'; +if ( $wgAjaxUploadDestCheck ) $wgAjaxExportList[] = 'UploadForm::ajaxGetExistsWarning'; +if( $wgAjaxLicencePreview ) + $wgAjaxExportList[] = 'UploadForm::ajaxGetLicencePreview'; wfSeedRandom(); @@ -229,4 +293,4 @@ $wgFullyInitialised = true; wfProfileOut( $fname.'-extensions' ); wfProfileOut( $fname ); -?> +