Skip to content
Snippets Groups Projects
Commit bee8e4a7 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Allow APPLICATION_PATH to be defined as an Apache environment variable

- Avoids use of __DIR__ (which doesn't work properly with symlinked files).
- Also use APPLICATION_PATH in theme base directory.
- Fixed line lengths in index.php.
parent d605f833
No related merge requests found
...@@ -61,4 +61,9 @@ Alias /vufind /usr/local/vufind/public ...@@ -61,4 +61,9 @@ Alias /vufind /usr/local/vufind/public
# Multiple modules may be specified separated by commas. This mechanism can be used to override # Multiple modules may be specified separated by commas. This mechanism can be used to override
# core VuFind functionality without modifying core code. # core VuFind functionality without modifying core code.
#SetEnv VUFIND_LOCAL_MODULES VuFindLocalTemplate #SetEnv VUFIND_LOCAL_MODULES VuFindLocalTemplate
# This line overrides the detection of VuFind base directory. By default it is determined from
# the location of the index.php file, but in case it is e.g. symlinked or there is another reason
# to define the path manually, you can uncomment and modify this line.
#SetEnv VUFIND_APPLICATION_PATH /usr/local/vufind
</Directory> </Directory>
...@@ -100,6 +100,6 @@ class Module ...@@ -100,6 +100,6 @@ class Module
*/ */
public static function getThemeInfo() public static function getThemeInfo()
{ {
return new ThemeInfo(realpath(__DIR__ . '/../../themes'), 'bootprint3'); return new ThemeInfo(realpath(APPLICATION_PATH . '/themes'), 'bootprint3');
} }
} }
...@@ -13,15 +13,25 @@ if (!empty($xhprof) && extension_loaded('xhprof')) { ...@@ -13,15 +13,25 @@ if (!empty($xhprof) && extension_loaded('xhprof')) {
// Define path to application directory // Define path to application directory
defined('APPLICATION_PATH') defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', dirname(__DIR__)); || define(
'APPLICATION_PATH',
(getenv('VUFIND_APPLICATION_PATH') ? getenv('VUFIND_APPLICATION_PATH')
: dirname(__DIR__))
);
// Define application environment // Define application environment
defined('APPLICATION_ENV') defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('VUFIND_ENV') ? getenv('VUFIND_ENV') : 'production')); || define(
'APPLICATION_ENV',
(getenv('VUFIND_ENV') ? getenv('VUFIND_ENV') : 'production')
);
// Define path to local override directory // Define path to local override directory
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 // Save original working directory in case we need to remember our context, then
// switch to the application directory for convenience: // switch to the application directory for convenience:
......
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