PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Tools and Utilities » PhpDocumentor » Bug #8533

require() broken in a lot of places - cannot run!

Details

Submitted2006-08-22 13:53 UTC
Fromgiunta dot gaetano at sea-aeroportimilano dot it
Assignedcellog
StatusClosed
PackagePhpDocumentor
PHP Version5.1.4
OSwindows 2000
Roadmaps(Not assigned)

Comments

[2006-08-22 13:53 UTC] giunta dot gaetano at sea-aeroportimilano dot it

Description:
------------
Got phpdoc 1.3.0 from the web, dumped into a dir under the web root.

Open up the browser to localhost/phpdocumentor/ - all I get is:

Warning: require_once(PhpDocumentor/phpDocumentor/clone5.inc.php) [function.require-once]: failed to open stream: No such file or directory in E:\htdocs\phpDocumentor\phpDocumentor\common.inc.php on line 59

Looking at da code, I see:

if ('1.3.0' != '@'.'VER@')
{
if (_IN_PHP5) {
require_once 'PhpDocumentor/phpDocumentor/clone5.inc.php';
} else {
require_once 'PhpDocumentor/phpDocumentor/clone.inc.php';
}
} else {
if (_IN_PHP5) {
require_once dirname(__FILE__) . '/clone5.inc.php';
} else {
require_once dirname(__FILE__) . '/clone.inc.php';
}
}

This looks very suspicious: why should I include files using path 'PhpDocumentor/...' instead of dirname(__FILE__) ???

The same error is repeated here and there in the source code....

[2006-08-22 14:16 UTC] giunta dot gaetano at sea-aeroportimilano dot it

PS: I fixed it by inverting the 2 blocks of code, plus doing the same inversion in line 1651 of intermediateparser.inc

PPS: in .\Converters\PDF and .\Converters\XML\ there are still some files that always use include(''PhpDocumentor/...'), without doing appropriate indirection...

PPPS: are bugs to be reported here or on sf? not very clear...

[2006-09-09 14:32 UTC] jens at codes-concepts dot com

Same issue here on php 5.1.6 fcgi.

But it works fine when I use the pear installer.

[2006-10-06 20:45 UTC] ashnazg at users dot sourceforge dot net

That appears to be code that determines whether or not PhpDocumentor was installed via PEAR or not, as best I can tell via the CVS logs for these files.

[2006-10-10 14:30 UTC] ashnazg at users dot sourceforge dot net

I can work around this "no such file" error by running the phpdoc command from just above the PhpDocumentor directory, i.e if path to code is /opt/PhpDocumentor/phpDocumentor/phpdoc, then cd into /opt and run it from there. That seems to help line the hardcoded pathing up with your curring directory location, thereby allowing you to run it.

Again, not a fix, but a work-around.

This PEAR bug seems to have many duplicates on Sourceforge (#s 1574470, 1556091, 1551640, and 1544544).