exakat
exakat copied to clipboard
Can't use extensions with a Phar version of Exakat
Issue
It seems that the Phar version of Exakat can't load extensions from the ext
folder. Looking at the code, it seems to come down to two issues:
-
The extension folder location is constructed using the
$this->config->dir_root
property. Its value is going to be different depending on whether Exakat is running as a Phar installation or not:- https://github.com/exakat/exakat/blob/master/library/Exakat/Tasks/Extension.php#L48
- https://github.com/exakat/exakat/blob/master/library/Exakat/Config.php#L60
This will make Exakat look for extensions inside the Phar archive itself.
I was able to confirm this behavior by setting the phar.readonly PHP configuration option to
1
. With the option enabled, it was possible to persist changes inside archive using theextension install <name>
andextension uninstall <name>
. Theext
folder I created beside the archive was left untouched. -
Even when I was able to make Exekat interact with the
ext
folder (see first issue), the extensions themselves still refused to load due to the way how theAutoloadExt
class scans for them. Theglob
function doesn't support wrappers (in this case phar://):- https://github.com/exakat/exakat/blob/master/library/Autoload.php#L67
Steps to reproduce
mkdir ext
curl -o ext/Symfony.phar https://www.exakat.io/extensions/index.php?file=Symfony
docker run --rm -it -v $(pwd)/ext:/usr/src/exakat/ext exakat/exakat extension local
@spideyfusion Thanks for the assessement of the situation. Indeed, the phar did skip the handling of the extensions, and, basically, couldn't handle them. It is being fixed ATM.