Skip to content
Snippets Groups Projects
Commit b9342a13 authored by Demian Katz's avatar Demian Katz
Browse files

Fixed problem with relative paths passed to CLI tools.

parent 11f6fb6e
No related merge requests found
...@@ -56,6 +56,13 @@ class AbstractBase extends AbstractActionController ...@@ -56,6 +56,13 @@ class AbstractBase extends AbstractActionController
// Get access to information about the CLI request. // Get access to information about the CLI request.
$this->consoleOpts = new Getopt(array()); $this->consoleOpts = new Getopt(array());
// Switch the context back to the original working directory so that
// relative paths work as expected. (This constant is set in
// public/index.php)
if (defined('ORIGINAL_WORKING_DIRECTORY')) {
chdir(ORIGINAL_WORKING_DIRECTORY);
}
} }
/** /**
......
...@@ -23,6 +23,9 @@ defined('APPLICATION_ENV') ...@@ -23,6 +23,9 @@ defined('APPLICATION_ENV')
defined('LOCAL_OVERRIDE_DIR') defined('LOCAL_OVERRIDE_DIR')
|| define('LOCAL_OVERRIDE_DIR', (getenv('VUFIND_LOCAL_DIR') ? getenv('VUFIND_LOCAL_DIR') : '')); || define('LOCAL_OVERRIDE_DIR', (getenv('VUFIND_LOCAL_DIR') ? getenv('VUFIND_LOCAL_DIR') : ''));
// Save original working directory in case we need to remember our context, then
// switch to the application directory for convenience:
define('ORIGINAL_WORKING_DIRECTORY', getcwd());
chdir(APPLICATION_PATH); chdir(APPLICATION_PATH);
// Ensure vendor/ is on include_path; some PEAR components may not load correctly // Ensure vendor/ is on include_path; some PEAR components may not load correctly
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment