Topic on Project:Support desk

Richarddteamaccent (talkcontribs)

Version: Media Wiki 1.29.0

I recently tried adding the Extension:Cargo, as instructed here: Extension:Cargo/Download and installation

As instructed, I copied the 'Cargo' directory into the MediaWiki 'extensions' directory.

I added the following line to the LocalSettings.php file:

wfLoadExtension( 'Cargo' );

The next instruction is as follows:

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

When I did that, I received the following error:

wiki@wikiserver:/var/www/html/mediawiki/maintenance$ php update.php

PHP Fatal error:  Uncaught Exception: /var/www/html/mediawiki/extensions/Cargo/extension.json does not exist! in /var/www/html/mediawiki/includes/registration/ExtensionRegistry.php:99

Stack trace:

#0 /var/www/html/mediawiki/includes/GlobalFunctions.php(118): ExtensionRegistry->queue('/var/www/html/m...')

#1 /var/www/html/mediawiki/LocalSettings.php(132): wfLoadExtension('Cargo')

#2 /var/www/html/mediawiki/maintenance/doMaintenance.php(84): require('/var/www/html/m...')

#3 /var/www/html/mediawiki/maintenance/update.php(219): require_once('/var/www/html/m...')

#4 {main}

  thrown in /var/www/html/mediawiki/includes/registration/ExtensionRegistry.php on line 99

wiki@wikiserver:/var/www/html/mediawiki/maintenance$ 

When I looked into the ExtensionRegistry.php file, the only item that I could find related to extension.json is the following excerpt:

 * Process a queue of extensions and return their extracted data

*

* @param array $queue keys are filenames, values are ignored

* @return array extracted info

* @throws Exception

*/

public function readFromQueue( array $queue ) {

global $wgVersion;

$autoloadClasses = [];

$autoloaderPaths = [];

$processor = new ExtensionProcessor();

$versionChecker = new VersionChecker( $wgVersion );

$extDependencies = [];

$incompatible = [];

$warnings = false;

foreach ( $queue as $path => $mtime ) {

$json = file_get_contents( $path );

if ( $json === false ) {

throw new Exception( "Unable to read $path, does it exist?" );

}

$info = json_decode( $json, /* $assoc = */ true );

if ( !is_array( $info ) ) {

throw new Exception( "$path is not a valid JSON file." );

}

if ( !isset( $info['manifest_version'] ) ) {

wfDeprecated(

"{$info['name']}'s extension.json or skin.json does not have manifest_version",

'1.29'

);

$warnings = true;

// For backwards-compatability, assume a version of 1

$info['manifest_version'] = 1;

}

$version = $info['manifest_version'];

Is there a way that I can enable the Extension:Cargo? How can I get past this error?

Thank you for you help.

2003:72:6D12:2000:C94E:BE54:24F1:D45D (talkcontribs)

When you included the Cargo extension in LocalSettings.php, you used a line starting with wfLoadExtension();. This approach is not (not yet) working for the Cargo extension.

Instead of using wfLoadExtension(), use

require_once('extensions/Cargo/Cargo.php');

---

Another option is to use the branch for MediaWiki 1.30 of the Cargo extension. This corresponds to version 1.4 of the Cargo extension. In this version, the extension does support the wfLoadExtension() approach.

Richarddteamaccent (talkcontribs)

Thank you for your assistance. The issue is now resolved.