Help:Maintenance script rebuildConceptCache.php

From Linux Web Expert

(Redirected from Help:SMW conceptCache.php)

Template:MW file/noslash Template:MW file/noslash The "rebuildConceptCache.php" maintenance script manages the concept caching functionality provided by Semantic MediaWiki. The help page on concept caching provides detailed additional information on how to use this maintenance script. Semantic MediaWiki 3.2.0Released on an unknown date unknown versions of MediaWiki brought an improved client output to this maintenance script.1

This maintenance script deprecated the former "SMW_conceptCache.php" script starting with Semantic MediaWiki 1.9.2Released on an unknown date unknown versions of MediaWiki which was removed with the release of Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki in October 2018. When upgrading to Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki the migration to this script must be done.

Usage

php rebuildConceptCache.php [--status|--create|--delete] [--concept|--hard|--update|--old|-s|-e] [--verbose|--no-cache|--debug|--report-runtime|--with-maintenance-log]
This only shows the script specific parameters.

Parameters

Maintenance scripts provide generic maintenance parameters, script dependent parameters and depending on the maintenance script script specific parameters which are described on this page if provided.

Script specific parameters

Actions

Parameter Description
--status Show the cache status of the selected concepts.
--create Rebuild caches for the selected concepts.
--delete Remove all caches for the selected concepts.
If no further options are given, all concepts in the wiki are processed.

Selections

Parameter Description
--concept "Concept name" Process only this one concept.
--hard Process only concepts that are not allowed to be computed online according to the current wiki settings.
--update Process only concepts that already have some cache, i.e. do not create any new caches. For the opposite (only concepts without caches), use --old with a very high number.
--old <min> Process only concepts with caches older than <min> minutes or with no caches at all.
-s <startid> Process only concepts with page id of at least <startid>
-e <endid> Process only concepts with page id of at most <endid>
Selection options can be combined to process only concepts that meet all the requirements at once. If --concept is given, then -s and -e are ignored.

Options

Parameter Description
--verbose Give additional output. No effect if --quiet is given.
--no-cache Sets the $wgMainCacheType to none while running the script. Available since Semantic MediaWiki 2.2.0Released on an unknown date unknown versions of MediaWiki.2
--debug Sets global variables to support debug ouput while running. Available since Semantic MediaWiki 2.2.0Released on an unknown date unknown versions of MediaWiki.3
--report-runtime Will return memory usage and runtime of the respective script execution. Available since Semantic MediaWiki 2.2.0Released on an unknown date unknown versions of MediaWiki.4
--with-maintenance-log Adds a log entry to "Special:Logs" on the wiki and reports the script's runtime. Available since Semantic MediaWiki 2.4.0Released on an unknown date unknown versions of MediaWiki.5

File:OOjs UI icon lightbulb-yellow.svg <translate> Note:</translate> If you are using this parameter make sure that MediaWiki's configuration parameter $wgMaxNameChars (MediaWiki.org) is set to a value not lower than "25".6 Otherwise an exception will be issued informing about the minimum value for this setting ("32" or higher is recommended).7


Examples

The following command rebuilds existing concepts without prompting progress information.
php rebuildConceptCache.php --create --quiet
The following command rebuilds concept "English news" if it is older than one hour.
php rebuildConceptCache.php --create --old 60 --concept English_news
The following command verbosely rebuilds existing concepts and provides memory usage information after it has been completed.
php rebuildConceptCache.php --create --report-runtime
Example output:
Memory used: 5043456 (b: 17058680, a: 22102136) with a runtime of 0.12 sec
a) memory used after execution and b) memory used before the execution
#scite could not render a citation text for reference "gh:smw:829" because type "pullrequest" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:4462" because type "pullrequest" was not assigned to a template.

References

  1. ^ gh:smw:4462 
  2. ^ gh:smw:749 
  3. ^ gh:smw:766 
  4. ^ gh:smw:829 
  5. ^ gh:smw:1361 
  6. ^ gh:smw:1983 
  7. ^ gh:smw:1985