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

Fix bug in case using real path in windows #19

Closed
minkbear opened this issue Nov 14, 2013 · 7 comments
Closed

Fix bug in case using real path in windows #19

minkbear opened this issue Nov 14, 2013 · 7 comments
Assignees

Comments

@minkbear
Copy link
Contributor

If pass parameter in windows like this:
--folder="C:\tests"
--destination="C:\tests"

It shows error

The application has thrown an exception!

Zend\ServiceManager\Exception\RuntimeException
The specified directory does not have deployment.xml.

But it is existing deployment.xml at that path.
After that I took a look on the code and met:
PathInvokable.getAbsolute send the result is wrong for example

running cmd at c:\wamp\www\ZendServerSDK\tests
parameter --folder="C:\wamp\www\ZendServerSDK" 

result from PathInvokable.getAbsolute is

C:\\wamp\\www\\ZendServerSDK\\tests/C:\\wamp\\www\\ZendServerSDK\\tests

I just finished fix it but unable to pull request only my 1 commit.
Please take a look at minkbear/ZendServerSDK@d27b5ac

@ghost ghost assigned slaff Nov 14, 2013
slaff pushed a commit that referenced this issue Nov 14, 2013
@slaff
Copy link
Contributor

slaff commented Nov 14, 2013

Minkbear, can you please get the latest source code of the tool and check if this fix forks for you?

@minkbear
Copy link
Contributor Author

@slaff I clone you git for my testing. The result of my testing is the same.
Error show:

======================================================================
   The application has thrown an exception!
======================================================================
 Zend\ServiceManager\Exception\RuntimeException
 The specified directory does not have deployment.xml.

Because of strpos($path, '/')!==0 return true.
strpos($path, '/') return FALSE
then FALSE !== 0 is true

strpos Returns FALSE if the needle was not found.

ref: strpos

slaff pushed a commit that referenced this issue Nov 15, 2013
slaff pushed a commit that referenced this issue Nov 15, 2013
slaff pushed a commit that referenced this issue Nov 15, 2013
@slaff
Copy link
Contributor

slaff commented Nov 15, 2013

That should fix the issue. @minkbear can you try again on your system?

@minkbear
Copy link
Contributor Author

@slaff
It's work now. no error anymore.
Thanks

But in ZPK looks strange.

my scriptsdir is zp_script. and my properties is:
scriptsdir.includes = scripts/post_activate.php

Expected in ZPK should be
zp_script\post_activate.php

But it's below like #5
zp_script\scripts\post_activate.php

@slaff
Copy link
Contributor

slaff commented Nov 15, 2013

Thank for testing it mate! I will close this issue now. Can you please open
another issue for the zpk problem?
On 15 Nov 2013 13:21, "minkbear" notifications@github.com wrote:

@slaff https://github.com/slaff
It's work now. no error anymore.
Thanks

But in ZPK looks strange.

my scriptsdir is zp_script. and my properties is:
scriptsdir.includes = scripts/post_activate.php

Expected in ZPK should be
zp_script\post_activate.php

But it's below like #5#5
zp_script\scripts\post_activate.php


Reply to this email directly or view it on GitHubhttps://github.com//issues/19#issuecomment-28565292
.

@mkherlakian
Copy link

@minkbear it's a behavior we probably should document and guard against a bit better - but if your scriptsdir in deployment.xml is zp_script, then in deployment.properties the entry should look like:
Scriptsdir.includes=zp_script/post_activate.php

Such that the prefix is the same. Could you test and let me know please?

@minkbear
Copy link
Contributor Author

@slaff Thank you too. created as #20
@mkherlakian Please take a look at #20

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

3 participants