Commons
111[edytuj | edytuj kod]
$wgForeignFileRepos[] = [ 'class' => ForeignAPIRepo::class, 'name' => 'commonswiki', // Must be a distinct name 'apibase' => 'https://commons.wikimedia.org/w/api.php', 'hashLevels' => 2, 'fetchDescription' => true, // Optional 'descriptionCacheExpiry' => 43200, // 12 hours, optional (values are seconds) 'apiThumbCacheExpiry' => 86400, // 24 hours, optional, but required for local thumb caching ];
222[edytuj | edytuj kod]
333[edytuj | edytuj kod]
if ( $wgUseSharedUploads ) { if ( $wgSharedUploadDBname ) { $wgForeignFileRepos[] = [ 'class' => ForeignDBRepo::class, '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' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT, 'tablePrefix' => $wgSharedUploadDBprefix, 'hasSharedCache' => $wgCacheSharedUploads, 'descBaseUrl' => $wgRepositoryBaseUrl, 'fetchDescription' => $wgFetchCommonsDescriptions, ]; } else { $wgForeignFileRepos[] = [ 'class' => FileRepo::class, 'name' => 'shared', 'directory' => $wgSharedUploadDirectory, 'url' => $wgSharedUploadPath, 'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0, 'thumbScriptUrl' => $wgSharedThumbnailScriptPath, 'transformVia404' => !$wgGenerateThumbnailOnParse, 'descBaseUrl' => $wgRepositoryBaseUrl, 'fetchDescription' => $wgFetchCommonsDescriptions, ]; } }
ForeignDBViaLBRepo class