I have class and do like this:
function __destruct() {
$this->load_file('epicEndingfile.php');
}
And I get an error:
Warning: require(...) [function.require]: failed to open stream: No such file or directory
And when I do the same with __construct it works. Why is that?
EDIT: I actually don’t require file, but I use method to do that.
require uses your CD (Current Directory), not the directory where you have your file put.
It might be changing in your application context (between construct and destruct),
If you want to provide relative file paths based on your current file, use this :
On PHP 5.2 and below and
On PHP 5.3+