Create a simple component with the given script file.
Perform Install, update, uninstall.
On each action the script file should be able to do the processing via preflight and postflight.
On uninstall, the preflight and postflight are not called.
Joomla 3.7 (I know this was same earlier)
Why it was decided to do it that way?
script.php.txt Remove .txt
Labels |
Added:
?
|
Category | ⇒ | JavaScript |
postflight gets tricky because at that point the file would already be deleted
As long as the file is loaded into memory before deleted, the class and its methods will be available. So that's not an issue.
True enough :)
Status | New | ⇒ | Discussion |
I see at least one reason for preflight to fire on component uninstall. Currently if you install a package with say a component and 2, 3 plugins in it, you can the go on and uninstall one of them without uninstalling the whole package. But if the developer wants to "lock" this, say because they do not want extra checks in their plugins like "if the component exists" etc, they can setup preflight in such a way that it will abort the uninstall process with a warning in case you try to uninstall one of the extensions of that package. But in any case, you can never know what one may want to execute in preflight. In my tests preflight does not fire on component uninstall till J3.7.2.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-29 17:50:52 |
Closed_By | ⇒ | brianteeman |
preflight might work on uninstall, postflight gets tricky because at that point the file would already be deleted?
However I'm not sure what you would want to do in preflight? During installation, this allows to check if we can install the package and abort if some requirements aren't met. During uninstallation I can't see why we should abort an uninstallation. That should always be possible.