Skip to content

Commit 81484d5

Browse files
committed
Merge pull request silverstripe#189 from simonwelsh/custom-include-path
FEATURE Allow setting of constant CUSTOM_INCLUDE_PATH in _ss_enivronment...
2 parents f91b5b1 + 741f104 commit 81484d5

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

core/Core.php

+14-4
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,20 @@ function array_fill_keys($keys,$value) {
207207
///////////////////////////////////////////////////////////////////////////////
208208
// INCLUDES
209209

210-
set_include_path(BASE_PATH . '/sapphire' . PATH_SEPARATOR
211-
. BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
212-
. BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
213-
. get_include_path());
210+
if(defined('CUSTOM_INCLUDE_PATH')) {
211+
$includePath = CUSTOM_INCLUDE_PATH . PATH_SEPARATOR
212+
. BASE_PATH . '/sapphire' . PATH_SEPARATOR
213+
. BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
214+
. BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
215+
. get_include_path();
216+
} else {
217+
$includePath = BASE_PATH . '/sapphire' . PATH_SEPARATOR
218+
. BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
219+
. BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
220+
. get_include_path();
221+
}
222+
223+
set_include_path($includePath);
214224

215225
// Include the files needed the initial manifest building, as well as any files
216226
// that are needed for the boostrap process on every request.

0 commit comments

Comments
 (0)