Manual:manageForeignResources.php

This page is a translated version of the page Manual:ManageForeignResources.php and the translation is 67% complete.
Other languages:

詳細

manageForeignResources.php is a maintenance script that manages foreign resources registered with ResourceLoader.

This helps developers with downloading, verifying, and updating local copies of upstream libraries registered as ResourceLoader modules. resources/lib/foreign-resources.yaml を参照してください。

オプション/引数

オプション 説明 必須かどうか 既定値
action One of "update", "verify" or "make-sri" 必須
module Name of a single module 省略可能 all
--verbose Be verbose 省略可能

Use the update action to download URLs specified in foreign-resources.yaml and unpack them to the resources directory. This will also verify them against the integrity hashes.

Use the verify action to verify that the files currently in the resources directory match what "update" would replace them with. This is effectively a dry run and will not change any module resources on disk.

Use the make-sri action to compute an integrity hash for upstreams that do not publish one themselves. Add or update the URLs in foreign-resources.yaml as needed, but omit (or leave empty) the "integrity" key. Then, run the "make-sri" action for the module, and copy the integrity into the file. Then, you can use "verify" or "update" normally.

使用法

php maintenance/manageForeignResources.php actionName [ moduleName| --verbose ]

Updating foreign resources

Terminal
$ php maintenance/manageForeignResources.php update

... updating 'CLDRPluralRuleParser'
... updating 'html5shiv'
... updating 'jquery'
... updating 'jquery.chosen'
... updating 'jquery.client'
... updating 'jquery.cookie'
... updating 'jquery.form'
... updating 'jquery.fullscreen'
... updating 'jquery.hoverIntent'
... updating 'jquery.i18n'
... updating 'jquery.jStorage'
... updating 'jquery.throttle-debounce'
... updating 'moment'
... updating 'mustache'
... updating 'oojs'
... updating 'oojs-router'
... updating 'ooui'
... updating 'pako'
... updating 'promise-polyfill'
..............................

Verifying a module

Terminal
$ php maintenance/manageForeignResources.php verify oojs

... verifying 'oojs'

Done!

Common errors

Unknown module name

As of 25 Oct 2021, the module name must be one of:

CLDRPluralRuleParser, html5shiv, jquery, jquery.chosen, jquery.client,
jquery.cookie, jquery.form, jquery.fullscreen, jquery.hoverIntent, jquery.i18n,
jquery.jStorage, jquery.throttle-debounce, moment, mustache, oojs, oojs-router,
ooui, pako, promise-polyfill, qunitjs, sinonjs, vue, vuex.

関連項目