Anahita Project

Anahita Project's Topics

Taylor Wilson

Taylor Wilson

July 03 2013

bug (?) console installer does not call schemas/install.php or schemas/unistall.php

When using package:install or package:uninstall with new anahita console tool, schemas/install.php or schemas/unistall.php are not executed, e.g. com_groups has them. Is this an overlooked issue or such behavior is not intended to be supported. If latter is the case, there should be an alternative introduced so component developers would be still able to execute some custom php code during installation to account for sophisticated one time environment initialization.

Interesting point. However the composer do provide a way to run scripts for when a package is installed or uninstalled or updated. However at the time package installed using composer doesn't mean it's installed on anahita. Let me think about it and see waht I come up iwth. Also I should mention you can register callbacks for the any tasks. Have alook a the console application code. That means you can run a callback after certain packages have been installed.
I'm not sure i understand what you mean about composer, i was talking about installing packages with anahita console utility, e.g. groups package or custom one.
From what i understand, this new console tool is future replacement for package installation from withing admin area as well or alternative.
In any case, running `anahita pakage:install something` does install something executing install.sql, registering package component and plugins etc. So not running install.php (as would joomla system do) seems to be just an oversight, though it may be you going to intorduce more handy alternative
Hi Taylor,

A component in Anahita terms is really a package that can be installed using the composer. At the time we are using a special utility anahita to install components but technically composer can handle that for us. Why that relates to what you ask is because composer provides hooks (install, uninstall and update) for each package that's used within a project. A developer when building a package can use this hooks to perform various operation. However this will be probably implemented in the future releases so for now I think we can use the install.php and uninstall.php as you suggested.

FYI this branch has turned all the apps into packages with their own composer file.
ok, now it makes sense when there is a composer.json in each package, this is what i asked in the beginning - fix or alternative :)
so it is going to be possible to use full composer features, right? E.g. during package installation, i.e. calling 'anahita package:install something' would properly execute everything defined by composer.json?

Powered by Anahita