Extension:Cargo/Download and installation

From MediaWiki.org
Jump to: navigation, search
Cargo - navigation
Basics Main pageExtension:Cargo (talk) · Download and installationExtension:Cargo/Download and installation · Quick start guideExtension:Cargo/Quick start guide · Other documentationExtension:Cargo/Other documentation · SMW migration guideExtension:Cargo/SMW migration guide
Using Cargo Storing dataExtension:Cargo/Storing data · Querying dataExtension:Cargo/Querying data (Display formatsExtension:Cargo/Display formats) · Browsing dataExtension:Cargo/Browsing data · Exporting dataExtension:Cargo/Exporting data · Other featuresExtension:Cargo/Other features
Resources for help Common problemsExtension:Cargo/Common problems · Known bugs and planned featuresExtension:Cargo/Known bugs and planned features · Getting supportExtension:Cargo/Getting support
About Cargo Authors and creditsExtension:Cargo/Authors and credits · Version historyExtension:Cargo/Version history · Sites that use CargoExtension:Cargo/Sites that use Cargo · Cargo and Semantic MediaWikiExtension:Cargo/Cargo and Semantic MediaWiki · FAQExtension:Cargo/FAQ

Download[edit]

You can download the Cargo code, in .zip format, here.

You can also download the code directly via Git from the MediaWiki source code repository (see available tags). From a command line, you can call the following:

git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Cargo

To view the code online, including version history for each file, go here.

Installation[edit]

To install the extension, place the entire 'Cargo' directory within your MediaWiki 'extensions' directory, then add one of the following lines to your 'LocalSettings.php' file:

  • For MediaWiki 1.25 and above:
    wfLoadExtension( 'Cargo' );
    
  • For MediaWiki versions earlier than 1.25:
    require_once( "$IP/extensions/Cargo/Cargo.php" );
    

Once you have the code set up, Cargo has two database tables in the main database that it requires. You will need to set these up by going to MediaWiki's /maintenance directory and calling the following:

php update.php

If your wiki also has Semantic MediaWiki installed on it, you will probably need to add the following line to LocalSettings.php to have Semantic MediaWiki work:

$smwgEnabledCompatibilityMode = true;

Finally, you need to make sure that the database account with which the code accesses the database has the ability to both create and drop tables. This may or may not be the standard MediaWiki database account; see below.

Setting the Cargo database[edit]

By default, Cargo uses the standard MediaWiki database to hold its data; it differentiates its DB tables from all the rest by starting all their names with "cargo__". You can change this to have Cargo use any other database. (Though Cargo's two "helper" tables, cargo_tables and cargo_pages, will remain in the main MW database.)

There are two main reasons why using a separate database may be a good idea:

  • There is the possibility that Cargo has a security leak, i.e. that Cargo queries allow for the inclusion of malicious SQL that would let users access information that they're not supposed to, or even modify the database. There are no known security leaks - and Cargo uses a lot of safeguards to try to prevent any such leaks - but that does not mean that no leak exists. If there is any such vulnerability, having a separate database using a separate database user with restricted permissions is the safer option.
  • If slow, intensive queries are run, either unknowingly or maliciously, having a separate database on a separate database server would prevent such queries from interfering with the regular operation of the wiki.

Cargo offers the following global settings to let you set a separate database:

  • $wgCargoDBtype
  • $wgCargoDBserver
  • $wgCargoDBname
  • $wgCargoDBuser
  • $wgCargoDBpassword

These are set in the same way as their non-Cargo equivalents, which can be found in LocalSettings.php. To set this custom database, add lines for those five variables to LocalSettings.php, under the inclusion of Cargo.