Adding phpdoc.php to execution path does not work
Closed this issue · 2 comments
pgraham commented
Steps to reproduce (Unix):
- clone phpdoctor somewhere on your maching.
- cd /path/to/phpdoctor
- chmod +x phpdoc.php
- Add phpdoc.php to the environment path variable
(I have a private bin directory from which I've created a symlink to /path/to/phpdoc.php - cd /path/to/project
- Execute: phpdoc.php phpdoc.ini
Expected results:
phpdoctor should run
Actual results:
The following error is encountered:
PHP Warning: require(classes/doc.php): failed to open stream: No such file or directory in /home/pgraham/projects/phpdoctor/classes/phpDoctor.php on line 40
PHP Fatal error: require(): Failed opening required 'classes/doc.php' (include_path='.:/usr/share/php:/usr/share/pear:/home/pgraham/bin') in /home/pgraham/projects/phpdoctor/classes/phpDoctor.php on line 40
Patch:
The fix is pretty simple so I've included the diff here but if you prefer I can fork and make a Pull Request.
--- a/phpdoc.php
+++ b/phpdoc.php
@@ -32,7 +32,7 @@
if (!isset($argv[0])) {
}
// include PHPDoctor class
-set_include_path(get_include_path() . PATH_SEPARATOR . dirname($argv[0]));
+set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__));
require('classes'.DIRECTORY_SEPARATOR.'phpDoctor.php');
// get name of config file to use
peej commented
Thanks for the fix pgraham, this has been committed to master.
pgraham commented
No Problem. Thanks for the awesome documentation generator :)