Skip to content

Commit

Permalink
Merge branch 'feature-generator-path' of https://github.com/rafalwrze…
Browse files Browse the repository at this point in the history
…szcz/zf2 into hotfix/classmap-compare
  • Loading branch information
weierophinney committed Jan 3, 2012
2 parents 9624c2a + 98c3c78 commit 2673592
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/classmap_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,17 @@
// If both library path and classmap path are absolute, we have to make
// it relative to the classmap file.
$libraryPathCompare = rtrim(str_replace('\\', '/', realpath($libraryPath)), '/');
$classmapPathCompare = rtrim(str_replace('\\', '/', realpath($opts->o)), '/');


if (file_exists($opts->o) ) {
$classmapPathCompare = rtrim(str_replace('\\', '/', realpath($opts->o)), '/');
} else {
// realpath() won't work for unexisting files
$newFilePath = explode('/', str_replace('\\', '/', $opts->o));
// stip filename
array_pop($newFilePath);
$classmapPathCompare = rtrim(realpath(implode('/', $newFilePath)), '/');
}

if (is_file($libraryPathCompare)) {
$libraryPathCompare = str_replace('\\', '/', dirname($libraryPathCompare));
}
Expand Down

0 comments on commit 2673592

Please sign in to comment.