Updated include_boinc() function to include files relative to the html subdirectory of the BOINC root

(DBOINCP-184)
This commit is contained in:
Tristan Olive 2015-06-18 09:46:39 -04:00
parent 427fd682f8
commit d625dfdc6a
1 changed files with 5 additions and 2 deletions

View File

@ -158,12 +158,15 @@ function require_boinc($libraries) {
/**
* Include BOINC code
* The path from the BOINC root must be included (e.g. user/file.php)
* The path from the BOINC html root must be included (e.g. user/file.php)
*/
function include_boinc($file) {
if ($include_dir = boinc_get_path()) {
$include_dir .= '/html';
$workingDir = getcwd();
chdir($include_dir);
$path = dirname($file);
$file = basename($file);
chdir("{$include_dir}/{$path}");
include($file);
chdir($workingDir);
}