1
0
mirror of synced 2025-01-18 06:21:40 +03:00

lib directory deduction now covers all possible cases.

This commit is contained in:
nicobn 2007-06-26 04:45:24 +00:00
parent f3245d4389
commit 325f0cc46d

View File

@ -29,7 +29,7 @@
* @link www.phpdoctrine.com
* @since 1.0
*/
if (count($argv) < 2) {
echo "Usage: bundle.php [Target file] <Library directory>\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";