Created
December 1, 2011 14:10
-
-
Save felixhummel/1416996 to your computer and use it in GitHub Desktop.
PHP Symfony get absolute path from relative Path
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
$relativePath = $this->config['foo']; | |
$pseudoPath = sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . $relativePath; | |
$absolutePath = realpath($pseudoPath); | |
if (!$absolutePath) { | |
throw new Exception("File not found: $pseudoPath"); | |
} | |
$this->use($absolutePath); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment