zend-patterns / ZendServerSDK

Pure ZF2 CLI for zpk creation and webapi client.
BSD 3-Clause "New" or "Revised" License
22 stars 17 forks source link

Structure of ZPK is strange when setting scriptsdir.includes #20

Closed minkbear closed 9 years ago

minkbear commented 10 years ago

My test case:

Case 1 scriptsdir in XML = zp_script scriptsdir.includes in file properties = scripts/post_activate.php

Output zp_script\scripts\post_activate.php

Expected zp_script\post_activate.php


Case 2 scriptsdir in XML = zp_script scriptsdir.includes in file properties = zp_script/includes/globals.php

Output zp_script\includes\globals.php

Expected zp_script\globals.php


Case 3 => Pass scriptsdir in XML = zp_script scriptsdir.includes in file properties = zp_script/post_activate.php

Output zp_script\post_activate.php

Expected zp_script\post_activate.php


I think that case 1 and 2 should be pass. Because scriptsdir.includes are the list of files or folders you want to push them into scriptsdir.

Anyways, I tested all my case with Eclipse PDT with GUI based and export ZPK file with the same XML and properties. The output is the same as my expected.

mkherlakian commented 10 years ago

That's interesting - to be honest I never checked cases 1 & 2 from studio or PDT... I will take a look, but from what I can see the expected behaviour would be to use whatever is defined in deployment.xml for scriptsdir directive as a prefix to the scripts in the archive, and completely ignore the prefix in deployment.properties?

In your project, are the scripts located in /scripts/* or in /zp_script/*?

I can make a fix pretty easily either way, I just want to make sure we get it right.

Thanks for your help!! :)

minkbear commented 10 years ago

As my understanding by testing in PDT, scriptsdir in XML is the name of script folder in ZPK so it is not existing in my project. scriptsdir.includes is the list of files or folder which are existing in my project to push them into scriptsdir in ZPK.

In my project, the scripts located in /scripts/* and I want to make the name of script folder in ZPK is "zp_script" as scriptsdir. So this is test case 1.

Hope this make you clear. Thank you too for fixing.

boedah commented 9 years ago

@slaff: do you know whats the reason to even set scriptsdir in the XML? Because this directory is moved to a temporary location during the deployment on Zend Server (and does not even exist in the application directory). So why would I as ZPK package creator want to customize it? All I want is to make sure all my scripts are executed and have the same structure as my in my repository.

I find it really awkward that the directory is stripped from the script paths and so the structure is changed in the zpk... Why not simply add one setting scriptsdir, the whole directory is included in the ZPK and this directory is moved out of the deployed application directory during deployment?