Last active
December 23, 2015 12:09
-
-
Save olliebun/6633594 to your computer and use it in GitHub Desktop.
Getting the path to a PHP file without resolving symlinks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ln -s test.php foo.php | |
$ php test.php | |
/home/vagrant/test.php | |
$ php foo.php | |
/home/vagrant/foo.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print($_SERVER['PWD'] . "/" . $_SERVER['PHP_SELF']); |
We pretty much use this everywhere:
require_once __DIR__ . '/app.php';
FILE isn't used in LearnosityPackages at all
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like through apache you don't have
$_SERVER['PWD']
, though.