Skip to content

Conversation

@vstm
Copy link
Contributor

@vstm vstm commented Jul 1, 2013

The NodeTouchCommand uses dirname and basename for operations on PHPCR-paths. This causes problems because Windows might return \ instead of / as the root-path.

It breaks the unit test completely:

C:\[...]\jackalope-doctrine-dbal> phpunit
...  
Fatal error: Call to a member function addNode() on a non-object in C:\[...]\NodeTouchCommand.php on line 143

And just throws an exception if you want to "touch" a node:

C:\[...]\jackalope-doctrine-dbal> php bin\jackalope phpcr:node:touch /gopf --type nt:unstructured

  [PHPCR\RepositoryException]
  Not an absolute path '\'

This pull request solves the problem by simply replacing the "php-based" filesystem-functions with the PathHelper-counterparts.

…\' as root path and thus break the touch command
dantleech added a commit that referenced this pull request Jul 1, 2013
NodeTouchCommand failing on windows
@dantleech dantleech merged commit 7c64366 into phpcr:master Jul 1, 2013
@dantleech
Copy link
Member

My bad :) Thanks for the fix!

@lsmith77
Copy link
Member

lsmith77 commented Jul 1, 2013

we should probably grep all bundles, jackalope and phpcr repositories for dirname calls

@dbu
Copy link
Member

dbu commented Jul 1, 2013

found one dirname in symfony-cmf that i fiexed symfony-cmf/search-bundle@27edcab

@dbu
Copy link
Member

dbu commented Jul 1, 2013

@dbu
Copy link
Member

dbu commented Jul 1, 2013

jackalope and phpcr where cleaned up a moment ago when we created the PathHelper - i think this one just sneaked in. re-checked, there are no other occurrences currently.

@vstm vstm deleted the win-dirname-compat branch July 2, 2013 04:24
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

Successfully merging this pull request may close these issues.

4 participants