Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix for when file is called from another path #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

bugfix for when file is called from another path #4

wants to merge 4 commits into from

Conversation

elitan
Copy link
Contributor

@elitan elitan commented Aug 28, 2014

file_exists() does not work as expected when config.php is included from another path. From upgrade/ for instance.

@ext
Copy link
Member

ext commented Aug 28, 2014

Do you get an error without this? Most of the time PHP searches relative to the current file (in addition to a few other locations). What platform and versions?

The patch has the (nasty) side-effect of changing the working directory.

I would rather suggest something as following:

$basedir = dirname(__FILE__);
file_exists("$basedir/...")
require("$basedir/...");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants