Skip to content

Commit

Permalink
Don't rely on the pear2/all svn layout. Look in the local package dir…
Browse files Browse the repository at this point in the history
… for a vendor directory which contains a Pyrus controlled registry of packages. TODO: This could be improved to automatically find these from the latest releases on pear2.php.net.
  • Loading branch information
saltybeagle committed Jan 24, 2011
1 parent c7657d0 commit 95e011c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Pyrus/Developer/PackageFile/Commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,15 @@ function package($frontend, $args, $options)

$sourcepath = \PEAR2\Pyrus\Main::getSourcePath();
if (0 !== strpos($sourcepath, 'phar://')) {
// running from svn, assume we're in an all checkout
$svnall = realpath($sourcepath . '/../..');
if (!file_exists($svnall . '/Exception')) {
throw new \PEAR2\Pyrus\Developer\Creator\Exception('Cannot locate PEAR2/Exception and friends, bailing');
// running from svn, assume we're in a standard package layout with a vendor dir
// TODO: Improve this to automatically find latest releases from pear2.php.net
$exceptionpath = $autoloadpath = $multierrorspath = realpath($sourcepath . '/../../vendor/php') .
'/PEAR2';
if (!file_exists($exceptionpath . 'Exception.php')) {
throw new \PEAR2\Pyrus\Developer\Creator\Exception(
'Cannot locate PEAR2/Exception in a local vendor/ dir. '
. 'It is best to install the latest versions of these locally.');
}
$exceptionpath = $svnall . '/Exception/src';
$autoloadpath = $svnall . '/Autoload/src';
$multierrorspath = $svnall . '/MultiErrors/src';
} else {
$exceptionpath = $autoloadpath = $multierrorspath = dirname($sourcepath) .
'/PEAR2';
Expand Down

0 comments on commit 95e011c

Please sign in to comment.