You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sessioncommunities.online/php/getenv.php

25 lines
532 B
PHP

<?php
$PROJECT_ROOT = dirname(__FILE__);
(function(){
global $PROJECT_ROOT;
$root_previous = "";
while (!file_exists("$PROJECT_ROOT/.phpenv")) {
if (
$PROJECT_ROOT == "/" ||
$PROJECT_ROOT == "" ||
$PROJECT_ROOT == $root_previous
)
throw new RuntimeException("Could not find .phpenv file.");
$root_previous = $PROJECT_ROOT;
$PROJECT_ROOT = dirname($PROJECT_ROOT);
}
})();
require_once "$PROJECT_ROOT/.phpenv";
// set_include_path(get_include_path() . PATH_SEPARATOR . $PROJECT_ROOT);
?>