elkuku / EasyCreator

EasyCreator helps creating extensions for the Joomla! CMS
http://extensions.joomla.org/extensions/miscellaneous/development/5908
50 stars 23 forks source link

ECr: Build-Package: archives site-folder as option ? #57

Open hgh-esn opened 6 years ago

hgh-esn commented 6 years ago

@elkuku Hi, when building a package, the project-files are are packed into an archives site-folder. Only the manifest..xml file is the archive-rout . That is made by ECr defaults and actually not changeable and gives the following archive-structure:

archive.zip

In my plugin I must run a install/update/uninstall script as joomla supports it.

Therefor I have the <scriptfile>script.php</scriptfile> tag in the manifest.xml. To get this working, the file script.php must be in the archiv-root (as the manifest.xml).

Any tryings with something like <scriptfile>site/script.php</scriptfile> don't work.

At least, I don't have any chance to put the script.php-file into the archiv rout via ecr, except, there would be an option to hide the site-folder-creation in the archive.zip.

For this, the archive-structure than must be as:

archive.zip

Is there a chance to get this option?

asking for this .... HGH

elkuku commented 6 years ago

Could you try the following: Put your script file into a install directory at the root of your project, so you would end up with <scriptfile>install/script.php</scriptfile> :wink:

hgh-esn commented 6 years ago

When building the zip-file via ECr, there are some more probs.

  1. In the build zip-file the scriptfile-tag isn't there. !!!!! Note: The install-folder is - as you said - now in the root and the script is in it.

    When I put the tag manually into the archive, the script doesn't work.

    I found out some strange things:

When the scriptfile-tag is <scriptfile>install/script.php</scriptfile> nothing works, when installing the plugin. When deinstalling the plugin, the functions : stophitcounts_PREFLIGHT_uninstall and stophitcounts_UNINSTALL will work. There are the following messages:

stophitcounts_PREFLIGHT_uninstall => nothing to do stophitcounts_UNINSTALL_TEXT

Only when the tag is <scriptfile>script.php</scriptfile> all works correct, but that doesn't match to the way, the zip-file is act. build.

# May be that is a joomla-bug. But I can't find the source-file, where it happens?

  1. I have some files for the media-folder of my project. The necessary xml-entry:

    <media destination="plg_stophitcounts" folder="site/assets">
    <folder>images</folder>
    </media>

    isn't generated in the build stophitcounts-xml. !!!!!

    When I put it manually into the archive, all works well.

  2. In the build zip-file, the config-tag entry is deformated #54

elkuku commented 6 years ago

OK here are some updates: First of all, the whole install script thing was only processed for components. IIRC it was only available for components when it was introduces back in J! 1.5... The was a @todo to change this for J! 1.6 but it was never done - until now.

So you have the option to put your script.php either at the root of your extension or inside an install folder. Both should produce an entry in your manifest.xml file. Please test both :wink:

As for the different processing: Maybe you dircovered a Joomla! bug, so you could easily make an example plugin to demonstrate the failure and submit a bug report :wink:

I haven't prepared a release yet, so please use https://github.com/elkuku/EasyCreator/archive/master.zip for testing.

For 2. and 3. - I'll investigate that..

hgh-esn commented 6 years ago

Hi elkuku,

thanks a lot for your engagement. I tested the install thing in both ways. First of all, the _VCSREV VAriable has gone ! :-))

The build of the xml runs, but there is a prob at least.

  1. When I specify an install-folder (with the script in it ;)) in the project and make this script-tag: <scriptfile>install/script.php</scriptfile> all went well.

  2. When I specify a script directly in the project-root and make this script-tag: <scriptfile>script.php</scriptfile> the manifest contains <scriptfile>script.php</scriptfile> , but the script is again in an install-folder in the root and could so not be found by joomla.

In this case the script should not be copied into the - in this case - unnecessary installation folder - it has to go directly into the project-root.

You can decide it by the scriptfile-tag. Do something like this: ... if scriptfile-tag contains a path-entry the path-entry must match a project-install-folder (if not - make a message) and copy that folder and it's content to the root of the archive-file. else put the script-file directly to the root of the archive-file. ...

I hope I could help.

PS: As for the different processing: ... I think joomla goes right, when your solution will work fine. ;)