views:

680

answers:

3

I'm trying everything I can to get phpdocumentor to allow me to use the DocBook tutorial format to supplement the documentation it creates:

  1. I am using Eclipse
  2. I've installed phpDocumentor via PEAR on an OSX machine
  3. I can run and auto generate code from my php classes
  4. It won't format Tutorials - I can't find a solution

I've tried moving the .pkg example file all over the file structure, in subfolders using a similar name to the package that is being referenced within the code .. I'm really at a loss - if someone could explain WHERE they place the .pkg and other DocBook files in relation to the code they are documenting and how they trigger phpdoc to format it I would appreciate it, I'm using this at the moment:

phpdoc -o HTML:Smarty:HandS
-d "/path/to/code/classes/", "/path/to/code/docs/tutorials/"
-t /path/to/output
+1  A: 

Have you read this?

It suggest the following path scheme: tutorials/package/package.pkg where package is the name of your package, did you do it this way?

André Hoffmann
Yes, I read that page in the documentation, many times.It recommends using <i>tutorials/package/package.pkg</i> - and I tried that scheme in about 4-5 locations - none of which made any difference. I also tried using just the individual name of the package as I couldn't get that to work.initially i had it set up as:/path/to/docs/tutorials/package/package.pkgthen:/path/to/code/tutorials/package/package.pkgthen:/path/to/tutorials/package/package.pkgthen:/path/to/docs/tutorials/package.pkgI think there may have been 2-3 more diff attempts as well.
Ket Majmudar
Well that's odd. Have you checked the permissions of the file?
André Hoffmann
DO you know what permissions the file should be - i've not checked it and would imagine it only needs to be readable by the user - I could try running the command as root, I will check.
Ket Majmudar
I am using location: trunk/tutorials/package/package.pkg and including -d trunk/tutorials/ in the command line. As a result I get: Tutorial/Extended Documentation Parsing Stage - done - so nothing happens. Where would I expect to see the docbook contents within the output folder if it did work ?
Ket Majmudar
Wondering if this could have something to do with the .ini file - can't figure out why .pkg / .proc does not get recognised when the documentation builds ...
Ket Majmudar
+2  A: 

I didn't expect to be answering my own question, but after 2 days of mind bending pain and a weekend to experiment it seems this is the problem:

The tutorial and my examples should work, but there seems to be a minor flaw in the way phpdoc interprets the switch values. Here is what I've been using:

phpdoc -o HTML:Smarty:HandS
-d "/path/to/code/classes/", "/path/to/code/docs/tutorials/"
-t /path/to/output

However if you use the following:

    phpdoc -o HTML:Smarty:HandS 
-d /path/to/code/classes/, /path/to/code/docs/tutorials/
-t /path/to/output

It will correctly format your tutorials and extending docs, all I did was drop the double quotes surrounding the directory paths. Single quotes don't work at all - as phpdoc itself wraps the directories in double quotes if there are no spaces ... this does seem like a bug with phpdoc, and the same behaviour occurred with the web based interface, so its an internal issue. my original attempt should have worked but didn't I will contact the developers and bring it to their attention.

Problem solved.

Ket Majmudar
A: 

Yes, your usage of the double quotes probably threw off phpDocumentor's internal runtime argument parsing, causing "-d /path/to/code/classes" to be one arg/value pair, without including "/path/to/code/docs/tutorials" as an additional directory value.

Typically, I've seen two other issues around tutorials not being created. One, the tutorial directory isn't what phpDocumentor expects. Two, no actual PHP code files are included in the execution. I remember adding verbiage to the manual specifically for these two scenarios [1].

[1] -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial%5Ftutorials.pkg.html#howto.location

ashnazg