Commons: Różnice pomiędzy wersjami
(→111) |
(→222) |
||
| Linia 12: | Linia 12: | ||
==222== | ==222== | ||
[[File:Wikipedia-Marker-commons.svg|thumb|A picture from Wikimedia Commons embedded in this Wiki]] | [[File:Wikipedia-Marker-commons.svg|thumb|A picture from Wikimedia Commons embedded in this Wiki]] | ||
==333== | |||
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 | |||
Wersja z 23:32, 7 sty 2022
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