Extension:GlobalUsage/tr: Difference between revisions
Updating to match new version of source page |
Updating to match new version of source page |
||
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
|username = Bryan |
|username = Bryan |
||
|author = Bryan Tong Minh |
|author = Bryan Tong Minh |
||
|description = Allows to view the global usage of images in a wiki farm with shared image repository |
|description = <span lang="en" dir="ltr" class="mw-content-ltr">Allows to view the global usage of images in a wiki farm with shared image repository</span> |
||
|image = Screenshot of the GlobalUsage Extension.jpg |
|image = Screenshot of the GlobalUsage Extension.jpg |
||
|version = 2.2.0 |
|version = 2.2.0 |
||
Line 19: | Line 19: | ||
|phabricator = GlobalUsage |
|phabricator = GlobalUsage |
||
}} |
}} |
||
The '''GlobalUsage '''extension allows to view the global usage of images in a wiki farm with shared image repository. |
<span lang="en" dir="ltr" class="mw-content-ltr">The '''GlobalUsage '''extension allows to view the global usage of images in a wiki farm with shared image repository.</span> |
||
It adds [[Special:GlobalUsage]] as well as a list of pages that include the image on image description pages. |
<span lang="en" dir="ltr" class="mw-content-ltr">It adds [[Special:GlobalUsage]] as well as a list of pages that include the image on image description pages.</span> |
||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
<div lang="en" dir="ltr" class="mw-content-ltr"> |
||
Line 31: | Line 30: | ||
|custom-steps0= |
|custom-steps0= |
||
|custom-steps= |
|custom-steps= |
||
* In LocalSettings, set <code>$wgGlobalUsageDatabase</code> to the identifier of the wiki where the GlobalUsage data is located (usually the database name). It should be the wiki's id as used by the load balancer. (i.e. It should be the database name. If using a table prefix, it should be <code>dbname-prefix</code>). Example: <syntaxhighlight lang=php inline>$wgGlobalUsageDatabase = 'commonswiki';</syntaxhighlight> |
* <span lang="en" dir="ltr" class="mw-content-ltr">In LocalSettings, set <code>$wgGlobalUsageDatabase</code> to the identifier of the wiki where the GlobalUsage data is located (usually the database name).</span> <span lang="en" dir="ltr" class="mw-content-ltr">It should be the wiki's id as used by the load balancer.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(i.e. It should be the database name. If using a table prefix, it should be <code>dbname-prefix</code>).</span> <span lang="en" dir="ltr" class="mw-content-ltr">Example:</span> <syntaxhighlight lang=php inline>$wgGlobalUsageDatabase = 'commonswiki';</syntaxhighlight> |
||
*: This name must also be registered to MediaWiki's load balancer: {{ll|Manual:$wgLBFactoryConf}}. This configuration structure maps database names to database servers. Note, you must register all databases used in your wikifarm in this structure, even if they are all on the same database server, for this extension to work. |
*: <span lang="en" dir="ltr" class="mw-content-ltr">This name must also be registered to MediaWiki's load balancer: {{ll|Manual:$wgLBFactoryConf}}.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This configuration structure maps database names to database servers.</span> <span lang="en" dir="ltr" class="mw-content-ltr">Note, you must register all databases used in your wikifarm in this structure, even if they are all on the same database server, for this extension to work.</span> |
||
* You must use either the {{ll|Manual:$wgConf|$wgConf}} site configuration system or the {{ll|Manual:sites table |
* <span lang="en" dir="ltr" class="mw-content-ltr">You must use either the {{ll|Manual:$wgConf|$wgConf}} site configuration system or the db {{ll|Manual:sites table}} for GlobalUsage to be able to link to your other wikis.</span> <span lang="en" dir="ltr" class="mw-content-ltr">You don't neccesarily have to use it for all your wiki configuration, but it is important to use it for $wgServer and $wgArticlePath.</span> |
||
* Run refreshGlobalimagelinks.php on '''all''' wikis in your farm. This will take a long time, but only needs to be done once when installing the extension |
* <span lang="en" dir="ltr" class="mw-content-ltr">Run refreshGlobalimagelinks.php on '''all''' wikis in your farm.</span> <span lang="en" dir="ltr" class="mw-content-ltr">This will take a long time, but only needs to be done once when installing the extension:</span> <code>php extensions/GlobalUsage/maintenance/refreshGlobalimagelinks.php --pages=existing,nonexisting</code> |
||
}} |
}} |
||
Line 40: | Line 39: | ||
== Specific guide on how to link file usage by sites table == |
== Specific guide on how to link file usage by sites table == |
||
</div> |
</div> |
||
#Make sure that $wgGlobalUsageDatabase and $wgLBFactoryConf were set properly. |
# <span lang="en" dir="ltr" class="mw-content-ltr">Make sure that $wgGlobalUsageDatabase and $wgLBFactoryConf were set properly.</span> |
||
#Use maintenance script importSites.php to build an XML format site list file. (Instruction can be found here: [https://github.com/wikimedia/mediawiki/blob/REL1_29/docs/sitelist.txt sitelist.txt], sample file can be found here: [https://github.com/wikimedia/mediawiki/blob/REL1_29/docs/sitelist-1.0.xsd sitelist-1.0.xsd].) |
# <span lang="en" dir="ltr" class="mw-content-ltr">Use maintenance script importSites.php to build an XML format site list file.</span> <span lang="en" dir="ltr" class="mw-content-ltr">(Instruction can be found here: [https://github.com/wikimedia/mediawiki/blob/REL1_29/docs/sitelist.txt sitelist.txt], sample file can be found here: [https://github.com/wikimedia/mediawiki/blob/REL1_29/docs/sitelist-1.0.xsd sitelist-1.0.xsd].)</span> |
||
#Use $wgSharedDB = 'commonswiki'; and $wgSharedTables[] = 'sites'; to share sites table across all wikis. |
# <span lang="en" dir="ltr" class="mw-content-ltr">Use $wgSharedDB = 'commonswiki'; and $wgSharedTables[] = 'sites'; to share sites table across all wikis.</span> |
||
#Clean all cache and force refresh like by refreshGlobalimagelinks.php. |
# <span lang="en" dir="ltr" class="mw-content-ltr">Clean all cache and force refresh like by refreshGlobalimagelinks.php.</span> |
||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
<div lang="en" dir="ltr" class="mw-content-ltr"> |
||
== API == |
== API == |
||
</div> |
</div> |
||
Extension:GlobalUsage includes an API extension that allows bots and other programs to query the global usage of a file. |
<span lang="en" dir="ltr" class="mw-content-ltr">Extension:GlobalUsage includes an API extension that allows bots and other programs to query the global usage of a file.</span> |
||
For example, this query on Wikimedia Commons returns global uses of [[:commons:File:Example.jpg|File:Example.jpg]]: |
<span lang="en" dir="ltr" class="mw-content-ltr">For example, this query on Wikimedia Commons returns global uses of [[:commons:File:Example.jpg|File:Example.jpg]]:</span> |
||
{{ApiEx |
{{ApiEx |
||
Line 81: | Line 80: | ||
</api> |
</api> |
||
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
By default, this returns only 10 results. |
By default, this returns only 10 results. |
||
</div> |
|||
The next 10 results can be retrieved using the gucontinue parameter included in the result above: |
<span lang="en" dir="ltr" class="mw-content-ltr">The next 10 results can be retrieved using the gucontinue= parameter included in the result above:</span> |
||
{{ApiEx |
{{ApiEx |
||
Line 93: | Line 93: | ||
}} |
}} |
||
The number of results returned is set with the <code>gulimit</code> parameter. |
<span lang="en" dir="ltr" class="mw-content-ltr">The number of results returned is set with the <code>gulimit</code> parameter.</span> |
||
The <code>guprop</code> parameter sets which properties to retrieve. |
<span lang="en" dir="ltr" class="mw-content-ltr">The <code>guprop</code> parameter sets which properties to retrieve.</span> |
||
The <code>gufilterlocal</code> parameter, when set to 1, will exclude uses on the same wiki as the file (e.g., on Commons). |
<span lang="en" dir="ltr" class="mw-content-ltr">The <code>gufilterlocal</code> parameter, when set to 1, will exclude uses on the same wiki as the file (e.g., on Commons).</span> |
||
The following query retrieves all properties and up to 100 results, excluding local uses: |
<span lang="en" dir="ltr" class="mw-content-ltr">The following query retrieves all properties and up to 100 results, excluding local uses:</span> |
||
{{ApiEx |
{{ApiEx |
||
Line 109: | Line 109: | ||
{{OnWikimedia}} |
{{OnWikimedia}} |
||
{{used by}} |
|||
[[Category:Extensions for data exchange with other local wikis{{#translation:}}]] |
[[Category:Extensions for data exchange with other local wikis{{#translation:}}]] |
Latest revision as of 09:12, 24 April 2024
GlobalUsage Sürüm durumu: kararlı |
|
---|---|
Uygulama | Özel sayfa , API |
Açıklama | Allows to view the global usage of images in a wiki farm with shared image repository |
Yazar(lar) | Bryan Tong Minh (Bryanmesaj) |
En son sürüm | 2.2.0 |
Uyumluluk politikası | MediaWiki ile birlikte anlık görüntüler yayımlanır. Master geriye dönük olarak uyumlu değil. |
MediaWiki | 1.28+ |
Veritabanı değişiklikleri | Evet |
Tablolar | globalimagelinks |
Lisans | MIT Lisansı |
İndir | README |
|
|
Quarterly downloads | 9 (Ranked 120th) |
Public wikis using | 964 (Ranked 248th) |
Translatewiki.net adresinde mevcutsa, GlobalUsage uzantısını çevirin | |
Sorunlar | Açık görevler · Hata bildir |
The GlobalUsage extension allows to view the global usage of images in a wiki farm with shared image repository. It adds Special:GlobalUsage as well as a list of pages that include the image on image description pages.
Install
- Dosyaları indirin ve
extensions/
klasörünüzdekiGlobalUsage
adlı dizine yerleştirin.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GlobalUsage - LocalSettings.php dosyanızın altına aşağıdaki kodu ekleyin:
wfLoadExtension( 'GlobalUsage' );
- Bu uzantının ihtiyaç duyduğu gerekli veritabanı tablolarını otomatik olarak oluşturacak betik güncelleme komutunu çalıştırın.
- In LocalSettings, set
$wgGlobalUsageDatabase
to the identifier of the wiki where the GlobalUsage data is located (usually the database name). It should be the wiki's id as used by the load balancer. (i.e. It should be the database name. If using a table prefix, it should bedbname-prefix
). Example:$wgGlobalUsageDatabase = 'commonswiki';
- This name must also be registered to MediaWiki's load balancer: Manual:$wgLBFactoryConf . This configuration structure maps database names to database servers. Note, you must register all databases used in your wikifarm in this structure, even if they are all on the same database server, for this extension to work.
- You must use either the $wgConf site configuration system or the db Manual:sites table for GlobalUsage to be able to link to your other wikis. You don't neccesarily have to use it for all your wiki configuration, but it is important to use it for $wgServer and $wgArticlePath.
- Run refreshGlobalimagelinks.php on all wikis in your farm. This will take a long time, but only needs to be done once when installing the extension:
php extensions/GlobalUsage/maintenance/refreshGlobalimagelinks.php --pages=existing,nonexisting
- Yapıldı – Uzantının başarıyla yüklendiğini doğrulamak için vikinizde Special:Version seçeneğine gidin.
Specific guide on how to link file usage by sites table
- Make sure that $wgGlobalUsageDatabase and $wgLBFactoryConf were set properly.
- Use maintenance script importSites.php to build an XML format site list file. (Instruction can be found here: sitelist.txt, sample file can be found here: sitelist-1.0.xsd.)
- Use $wgSharedDB = 'commonswiki'; and $wgSharedTables[] = 'sites'; to share sites table across all wikis.
- Clean all cache and force refresh like by refreshGlobalimagelinks.php.
API
Extension:GlobalUsage includes an API extension that allows bots and other programs to query the global usage of a file. For example, this query on Wikimedia Commons returns global uses of File:Example.jpg:
Sonuç |
---|
<?xml version="1.0"?>
<api>
<query>
<pages>
<page pageid="6428847" ns="6" title="File:Example.jpg">
<globalusage>
<gu title="Ашаблон:Ацқьа" wiki="ab.wikipedia.org" url="http://ab.wikipedia.org/wiki/%D0%90%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%90%D1%86%D2%9B%D1%8C%D0%B0" />
<gu title="Wikipedia_ውይይት:Can't_see_the_font?" wiki="am.wikipedia.org" url="http://am.wikipedia.org/wiki/Wikipedia_%E1%8B%8D%E1%8B%AD%E1%8B%AD%E1%89%B5:Can%27t_see_the_font%3F" />
<gu title="አባል:Blockinblox" wiki="am.wikipedia.org" url="http://am.wikipedia.org/wiki/%E1%8A%A0%E1%89%A3%E1%88%8D:Blockinblox" />
<gu title="አባል_ውይይት:Hana.oww" wiki="am.wikipedia.org" url="http://am.wikipedia.org/wiki/%E1%8A%A0%E1%89%A3%E1%88%8D_%E1%8B%8D%E1%8B%AD%E1%8B%AD%E1%89%B5:Hana.oww" />
<gu title="አባል:Beza" wiki="am.wikipedia.org" url="http://am.wikipedia.org/wiki/%E1%8A%A0%E1%89%A3%E1%88%8D:Beza" />
<gu title="መደብ:ኪነት" wiki="am.wikipedia.org" url="http://am.wikipedia.org/wiki/%E1%88%98%E1%8B%B0%E1%89%A5:%E1%8A%AA%E1%8A%90%E1%89%B5" />
<gu title="መደብ_ውይይት:ተረትና_ምሳሌ" wiki="am.wikipedia.org" url="http://am.wikipedia.org/wiki/%E1%88%98%E1%8B%B0%E1%89%A5_%E1%8B%8D%E1%8B%AD%E1%8B%AD%E1%89%B5:%E1%89%B0%E1%88%A8%E1%89%B5%E1%8A%93_%E1%88%9D%E1%88%B3%E1%88%8C" />
<gu title="ስዕል:መርጡለ_ማርያም_ገዳም_.jpg" wiki="am.wikipedia.org" url="http://am.wikipedia.org/wiki/%E1%88%B5%E1%8B%95%E1%88%8D:%E1%88%98%E1%88%AD%E1%8C%A1%E1%88%88_%E1%88%9B%E1%88%AD%E1%8B%AB%E1%88%9D_%E1%8C%88%E1%8B%B3%E1%88%9D_.jpg" />
<gu title="User_talk:Rasheduzzaman_Raj" wiki="ang.wikipedia.org" url="http://ang.wikipedia.org/wiki/User_talk:Rasheduzzaman_Raj" />
<gu title="User:Danceteamcherleaders" wiki="ang.wikipedia.org" url="http://ang.wikipedia.org/wiki/User:Danceteamcherleaders" />
</globalusage>
</page>
</pages>
</query>
<query-continue>
<globalusage gucontinue="Example.jpg|arwiki|77967" />
</query-continue>
</api>
|
By default, this returns only 10 results.
The next 10 results can be retrieved using the gucontinue= parameter included in the result above:
The number of results returned is set with the gulimit
parameter.
The guprop
parameter sets which properties to retrieve.
The gufilterlocal
parameter, when set to 1, will exclude uses on the same wiki as the file (e.g., on Commons).
The following query retrieves all properties and up to 100 results, excluding local uses:
Bu uzantı bir veya daha fazla Wikimedia projelerinde kullanılıyor. Bu, muhtemelen uzantının kararlı olduğu ve bu tür yüksek trafikli web siteleri tarafından kullanılacak kadar iyi çalıştığı anlamına gelir. Nerede kurulduğunu görmek için bu uzantının adını Wikimedia'nın CommonSettings.php ve InitialiseSettings.php yapılandırma dosyalarında arayın. Belirli bir vikide yüklü olan uzantılar listesinin tamamı vikinin Special:Version sayfasında görülebilir. |
This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |
- Stable extensions/tr
- Special page extensions/tr
- API extensions/tr
- MIT licensed extensions/tr
- Extensions in Wikimedia version control/tr
- ArticleDeleteComplete extensions/tr
- FileDeleteComplete extensions/tr
- FileUndeleteComplete extensions/tr
- ImagePageAfterImageLinks extensions/tr
- ImagePageShowTOC extensions/tr
- LinksUpdateComplete extensions/tr
- LoadExtensionSchemaUpdates extensions/tr
- PageMoveComplete extensions/tr
- UploadComplete extensions/tr
- WgQueryPages extensions/tr
- All extensions/tr
- Extensions used on Wikimedia/tr
- Extensions included in Miraheze/tr
- Extensions included in WikiForge/tr
- Extensions for data exchange with other local wikis/tr