0

I have declared a XML manifest file for my extension of type file like this:

<?xml version="1.0" encoding="utf-8"?>
<extension type="file" version="2.5" method="upgrade">
    <name>os_mp</name>
...
...
    <scriptfile>script.php</scriptfile>
...
...
</extension>

The script file is like this:

defined('_JEXEC') or die;

class os_mpInstallerScript
{
    public function postflight($type, $parent)
    {
        echo '<h1>' . $type . '</h1>';

        var_dump($type);
        var_dump($parent);
    }
}

But the code of the scrip file doesn't seem to get executed.

Please advise!

1
  • What makes you say that the postflight isn't executed? If you're using the installer in J3 then you wouldn't see the var_dump on the screen if that's what you mean. Cause it's using an ajax file uploader and it redirects after processing. Commented Apr 7, 2018 at 2:19

1 Answer 1

0

Finally found the issue. I have miswritten the class name of the installer script

defined('_JEXEC') or die;

class os_mpInstallerScript
{
    public function postflight($type, $parent)
    {
        echo '<h1>' . $type . '</h1>';

        var_dump($type);
        var_dump($parent);
    }
}

To find the correct calss name that joomla installer expected, I debugged the setupScriptfile member function of JInstallerAdapter. The file is located at libraries/cms/installer/adapter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.