Skip to content

Commit

Permalink
Inserts a new method to return web server document root in server lib…
Browse files Browse the repository at this point in the history
…rary.
  • Loading branch information
JB Lebrun committed Mar 10, 2020
1 parent f3e7f32 commit 0616637
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Core/Libraries/Tools/server.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* @brief Server specific methods
* @details Engine / Tool Library
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.0
* @version 1.0.1
* @date Creation: Dec 2019
* @date Modification: Dec 2019
* @copyright 2019 CaMykS Team
* @date Modification: Mar 2020
* @copyright 2019 - 2020 CaMykS Team
* @note This program is distributed as is - WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
Expand Down Expand Up @@ -54,4 +54,18 @@ function server_checkModuleAvailability($module='') {
return true;
}

/**
* Return server document root.
* @return string
*/
function server_getDocumentRoot() {
/* Do the check for Apache httpd */
switch (server_getSoftwareName()) {
case 'Apache': return getEnv('DOCUMENT_ROOT');
}

/* No software found, return defaut value */
return '';
}

?>

0 comments on commit 0616637

Please sign in to comment.