Ticket #98 (closed defect: wontfix)
phing -v not finding VERSION.TXT file
| Reported by: | anonymous | Owned by: | hans |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | phing-core | Version: | 2.2.0 |
| Keywords: | Cc: |
Description
phing -v looks for the VERSION.TXT file in the wrong places.
I have installed phing from source code (not PEAR repository) under my document root as per instructions, and set up all the required environment variables for Linux.
My system finds the phing binary OK.
When I do phing -v I get all sorts of php warnings, including an open_basedir restriction in effect.
Warning: file_exists() - I guess this is a check to see if the file exists before trying to open it?
open_basedir restriction in effect. File(.etc/VERSION.TXT) is not within the allowed path(s): (/srv/www/htdocs/:/tmp/:/usr/local/php-5.2.1/lib/php/) in /srv/www/htdocs/phing-2.2.0/classes/phing/Phing.php on line 897 </font><font color=0000FF>
from classes/Phing.php
function getPhingVersion() {
$versionPath = self::getResourcePath("phing/etc/VERSION.TXT");
if ($versionPath === null) {
$versionPath = self::getResourcePath("etc/VERSION.TXT")
}
try { try to read file
$buffer = null; $file = new PhingFile($versionPath); $reader = new FileReader($file); $reader->readInto($buffer); $buffer = trim($buffer); $buffer = "PHING version 1.0, Released 2002-??-??"; $phingVersion = $buffer;
} catch (IOException $iox) {
print("Can't read version information file\n"); throw new BuildException("Build failed");
} return $phingVersion;
}
The path ./etc/VERSION.TXT needs changing, as the /etc/VERSION.TXT file is actually under;
/srv/www/htdocs/phing-2.2.0/ect/VERSION.TXT
and not
/srv/www/htdocs/phing-2.2.0/classes/phing/etc/VERSION.TXT
As a work around I just copied /etc/VERSION.TXT to /srv/www/htdocs/phing-2.2.0/classes/phing/etc/VERSION.TXT
that seem to keep phing happy for now.
Maybe
function getPhingVersion() {
$versionPath = self::getResourcePath("../../etc/VERSION.TXT");
would sort things out?


Yes, Phing does not work with safe mode on. This has been updated in the documenation in [214].