3
votes

I've written a component for Joomla 3.0. I want to create a sort of optional patchfile for this component that will add some functionality to it.

I don't want to repackage the whole component if I can help it, so I don't have to merge in changes from the main branch every time I update something.

I remember reading something about how you can leave all directories empty in an install archive, as long as the directory name still exists, and that the installer will ignore existing files in those directories.

So effectively what I'd do is create an empty skeleton of the component, with all directories in place but with only the new or changed files in the archive, and set it as an upgrade.

Can any Joomla aces tell me if this would this work or will it blow away existing structure in my site?

1

1 Answers

3
votes

You need to have at least one file inside the directory, you can have dummy index.html file for that purpose. To let existing files not deleted, in your Joomla installer xml, set method as upgrade

<extension type="component" version="2.5.0" method="upgrade">

Now the installer will not delete existing files as long as you have not changed anything in files section of the above file.

Please note that you need to keep all the files you have mentioned in files section of the above file. ex:

<files folder="site">
    <filename>index.html</filename>
    <filename>example.php</filename>
    <filename>router.php</filename>
    <folder>controllers</folder>
    <folder>models</folder>
    <folder>views</folder>
</files>

in above example, you need to keep index.html, example.php and router.php. the other folders mentioned above can have just index.html file.