From d6cf38e613385ab814c1d44f4ec5e46f9dd3ae17 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 16 Feb 2010 11:44:25 +0100 Subject: [PATCH] Try the current framework directory too. --- framework/bin/install_framework | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/framework/bin/install_framework b/framework/bin/install_framework index ce1502ed4..0f6981e8d 100755 --- a/framework/bin/install_framework +++ b/framework/bin/install_framework @@ -79,10 +79,14 @@ for ($i = 1; $i < count($argv); $i++) { // Try to auto-detect the source and dest dirs. $cwd = getcwd(); -if ($srcDir === null && is_dir($cwd . DIRECTORY_SEPARATOR . 'framework')) { - $srcDir = $cwd . DIRECTORY_SEPARATOR . 'framework'; +if ($srcDir === null) { + if (is_dir($cwd . '/framework')) { + $srcDir = $cwd . DIRECTORY_SEPARATOR . 'framework'; + } else { + $srcDir = dirname(__FILE__) . '/..'; + } } -if ($destDir === null && is_dir($cwd . DIRECTORY_SEPARATOR . 'lib')) { +if ($destDir === null && is_dir($cwd . '/lib')) { $destDir = $cwd . DIRECTORY_SEPARATOR . 'lib'; } @@ -110,10 +114,12 @@ if (strpos(ini_get('include_path'), $destDir) === false) { } // Do CLI checks and environment setup first. -if (!@include_once 'Horde/Cli.php') { - if (!@include_once $srcDir . '/Cli/lib/Horde/Cli.php') { - if (!@include_once $cwd . DIRECTORY_SEPARATOR . '../Cli/lib/Horde/Cli.php') { - print_usage('Horde_Cli library is not in the include_path or in the src directory.'); +if (!@include_once dirname(__FILE__) . '/../Cli/lib/Horde/Cli.php') { + if (!@include_once 'Horde/Cli.php') { + if (!@include_once $srcDir . '/Cli/lib/Horde/Cli.php') { + if (!@include_once $cwd . '/../Cli/lib/Horde/Cli.php') { + print_usage('Horde_Cli library is not in the include_path or in the src directory.'); + } } } } -- 2.11.0