svn: /pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/PackageFile/ Commands.php

[email protected] (Brett Bieber) Mon, 24 Jan 2011 21:18:47 +0000
Newsgroups php.pear.cvs,php.pear.core
Message-ID <[email protected]>
saltybeagle                              Mon, 24 Jan 2011 21:18:47 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=307722

Log:
Don't rely on the pear2/all svn layout. Look in the local package dir 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.

Changed paths:
    U   pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/PackageFile/Commands.php

Modified: pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/PackageFile/Commands.php
===================================================================
--- pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/PackageFile/Commands.php	2011-01-24 21:03:12 UTC (rev 307721)
+++ pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/PackageFile/Commands.php	2011-01-24 21:18:47 UTC (rev 307722)
@@ -235,14 +235,15 @@

         $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';