Skip to content

Commit

Permalink
Avoid init.php file_exists(): open_basedir restriction in effect warning
Browse files Browse the repository at this point in the history
* Use README to check if install is from repo or user distro
* Checking the existence of a webapp directory in the parent can throw PHP open_basedir warnings on some server setups
* Since the README.md file is always in the application root, check for its existence instead to determine if the installation is from the repo or user zip distro package
  • Loading branch information
ginatrapani committed Apr 19, 2012
1 parent 6479797 commit 721d5a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webapp/init.php
Expand Up @@ -31,7 +31,7 @@
}

//Define path globals
if (file_exists(str_replace("\\",'/', dirname(dirname(__FILE__))) .'/' . 'webapp')) { // source repo
if (!file_exists('README.md')) { // source repo
define('THINKUP_ROOT_PATH', str_replace("\\",'/', dirname(dirname(__FILE__))) .'/');
define('THINKUP_WEBAPP_PATH', THINKUP_ROOT_PATH . 'webapp/');
} else { // distro package
Expand Down

0 comments on commit 721d5a8

Please sign in to comment.