Modify

Ticket #98 (closed defect: wontfix)

Opened 5 years ago

Last modified 5 years ago

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?

Attachments

version.cfg Download (133 bytes) - added by anonymous 4 years ago.

Change History

comment:1 Changed 5 years ago by hans

  • Status changed from new to closed
  • Resolution set to wontfix

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

Changed 4 years ago by anonymous

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.