From 325f0cc46d9131b5cbad4cdf3994bfc193b48133 Mon Sep 17 00:00:00 2001 From: nicobn Date: Tue, 26 Jun 2007 04:45:24 +0000 Subject: [PATCH] lib directory deduction now covers all possible cases. --- tools/cli/bundle.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/cli/bundle.php b/tools/cli/bundle.php index ed2386e7f..405f821f5 100644 --- a/tools/cli/bundle.php +++ b/tools/cli/bundle.php @@ -29,7 +29,7 @@ * @link www.phpdoctrine.com * @since 1.0 */ - + if (count($argv) < 2) { echo "Usage: bundle.php [Target file] \n\n". "Note: If the library directory is ommited, the path will be deducted if possible\n"; @@ -39,8 +39,15 @@ if (count($argv) < 2) { } else { $pathInfos = pathinfo($_SERVER['PHP_SELF']); - $doctrineBaseDir = str_replace('tools/cli/'. $pathInfos['basename'], - 'lib', getcwd() .'/'. $_SERVER['SCRIPT_NAME'], $Cnt); + $Cnt = 0; + + if ($_SERVER['PHP_SELF'][0] == '/') { + $doctrineBaseDir = str_replace('tools/cli/' . $pathInfos['basename'], + 'lib', $_SERVER['SCRIPT_NAME'], &$Cnt); + } else { + $doctrineBaseDir = str_replace('tools/cli/'. $pathInfos['basename'], + 'lib', getcwd() .'/'. $_SERVER['SCRIPT_NAME'], &$Cnt); + } if ($Cnt != 1) { echo "Can't find library directory, please specify it as an argument\n";