Ah, I've found it, you define your own repository a few lines below:
However, this makes it impossible to depend on Matomo as a dependency installed by composer.
Hi, see https://github.com/matomo-org/matomo/pull/15180 for more information on why this is a slightly ugly hack.
Matomo 3.x supports PHP 5.5 or later, so it can not be updated to the latest version of lessphp(which dropped support a while ago).
But Matomo also needs to support PHP 7.4 which means this patch (https://github.com/matomo-org/lessphp/commit/f16f6984aa9098559ababa9f47154a397b974c24) needs to be applied to avoid warnings.
With Matomo 4 support for old PHP versions is dropped so it should not matter anymore, but this means https://github.com/leafo/lessphp/pull/647 still needs to be merged.
If this is resolved in Matomo 4 basically can we close this issue? Or we still wait for the other issue to be merged?
The composer file on branch
4.x-dev also contains references to the version
dev-php74-compat of the module
leafo/lessphp that only can be installed when directly cloning the Matomo repository and it is still not possible to depend on Matomo as a package / requirement / dependency.
In the current state, installing Matomo using the following command is not possible:
composer require piwik/piwik
The command fails with an error like this:
Using version ^3.13 for piwik/piwik Your requirements could not be resolved to an installable set of packages. Problem 1 - piwik/piwik 3.13.6 requires leafo/lessphp dev-php74-compat -> no matching package found.
Which is sad cause is both prevents users from installing and updating Matomo using composer and also makes it impossible to create other projects that depend on Matomo.
The core issue is that Matomo currently relies on two private packages that must be installed from custom repositories as configured in Matomos composer file but composer does not load the repositories of requirements:
Currently, every package that depends on Matomo must repeat the
repositories section in their own
Get rid of the section
composer.json by either:
Seeing the 4.0 release, I just tried to upgrade my composer based matomo project to v4.0 and found this same issue
Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires matomo/matomo ^4.0 -> satisfiable by matomo/matomo[4.0.0]. - matomo/matomo 4.0.0 requires leafo/lessphp dev-php74-compat -> found leafo/lessphp[dev-master, dev-pull-523, v0.3.5, ..., v0.5.0] but it does not match the constraint.
It'd be great to get this resolved now that v4 is released, so composer support isn't broken.
Once this is done and there is a new lessphp release (this part is optional as we could depend on a commit hash) we can simply use it instead.
I will check how easy it would be to maybe switch to https://github.com/wikimedia/less.php instead. Should be more maintained 🙈
Especially as it should not change the rest of the asset handling (as long as it compiles the css the same). (even though supporting source maps would be really nice for the future)