Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hgh-esn opened this issue Oct 23, 2017 · 4 comments
Open

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

hgh-esn opened this issue Oct 23, 2017 · 4 comments

Comments

@hgh-esn
Copy link

hgh-esn commented Oct 23, 2017

@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

  • manifest.xml
  • site-folder
    • project-files
    • other folders/files

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

  • manifest.xml
  • script.php
  • project-files
  • other folders/files

Is there a chance to get this option?

asking for this .... HGH

@elkuku
Copy link
Owner

elkuku commented Oct 23, 2017

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> 😉

@hgh-esn
Copy link
Author

hgh-esn commented Oct 23, 2017

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.
  1. In the build zip-file, the config-tag entry is deformated ECr-0.0.27 build-package - manifest-file corrupted and log-warnings #54

@elkuku
Copy link
Owner

elkuku commented Oct 24, 2017

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 😉

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 😉

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
Copy link
Author

hgh-esn commented Oct 24, 2017

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. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants