Closed JeroenDeDauw closed 4 years ago
Otherwise "it is not as easy as that" because Chameleon relies on other extensions that need to be installed in the proper directory. No idea what happens if you just run composer locally.
Yeah OK, that indeed complicates things, especially if those extensions define web resources.
Tried this "installing w/o composer" for BootstrapComponents. Back then, when it only relied on one other extension (Bootstrap) it was feasible. Now, that Bootstrap itself has multiple dependencies, BSC could still be installed w/o composer, but its dependency (Bootstrap) cannot.
Most important thing to allow for installation w/o composer is to migrate the class autoloading from composer.json to extension.json. This would have to be done in all extensions, chameleon requires to function and loads automatically (Bootstrap, SCSS), though.
I should note, composer can still be used for dependancies.. Just not be the only way installing the skin itself
So installing mediawiki/bootstrap and anything that depends on (recursively) using composer is fine
I'm not used to PHP (I'm a Java developer), but would it be possible to create a tar.gz with the dependencies bundled? In Java (using Maven) this is quite simple to do.
I think not. For one, composer puts all the extension-type dependencies in MW's extension folder and the rest in MW's vendor folder. Also, composer creates a classmapping file for class autoloading.
I think the easiest solution, when you don't have access to composer on your wiki machine, is to install composer someplace else (like your PC at home), prepare the MW software (install core, add config, install all the extensions and skins) and then copy the result over to your wiki server.
I note, again, the problem is not installing the skins dependencies using composer, it's installing the skin itself
In theory, you could probably make a phar of the skin and extensions, but that doesn't solve the problem either
@reedy then here is how I just installed chameleon w/o composer (except for dependencies):
"AutoloadNamespaces": {
"Skins\\Chameleon\\": "src"
},
wfLoadSkin( 'chameleon' );
$wgDefaultSkin = 'chameleon';
You shouldn't have to edit skin.json to make this work. That's part of the point for this request. While this is related to a skin, https://www.mediawiki.org/wiki/Do_not_hack_MediaWiki_core is very much still in play
Also, in this case, we don't use composer.local.json in Wikimedia production, so that doesn't help either. But the issues with mediawiki/bootstrap
and the existence of mediawiki/mediawiki: >=1.27.0
are technically out of scope of this request
See https://phabricator.wikimedia.org/T246949#6041968 for the related issue
@reedy seems, I missed the notion where this request wasn't about a specific wiki but a general request. @JeroenDeDauw, @kghbln, @s7eph4n: as I said above, if you want to support this request, we should try moving the autoloader from composer.json into skins.json. If not, say so. In my jury rigged case I described above, the unit tests all passed.
As per https://www.mediawiki.org/wiki/Composer/For_extensions this was never actually a supported way of installing skins/extensions
Continuation of https://github.com/ProfessionalWiki/chameleon/pull/71