#1
  1. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Sep 2006
    Posts
    1,916
    Rep Power
    533

    Help with phpdoc


    I have my website (Centos 6.4/Apache) set up as follows, and note that I do not have html directly under /var/www:
    Code:
    /var/www/site1/html
    /var/www/site1/php_files_for_site1
    /var/www/site2/html
    /var/www/site1/php_files_for_site2
    I installed phpdoc as follows:
    Code:
    pear channel-discover pear.phpdoc.org
    pear install phpdoc/phpdocumentor
    It created the following directories:
    Code:
    /usr/share/pear/phpDocumentor
    /var/www/phpDocumentor
    The documentation talks about putting phpdoc.dist.xml in the "root of your project". Which directory is this? The documentation also talks about using an ini file. Is this an alternate to using the xml file, and which is the best approach, and where would I find the default.ini file? The documentation also discusses using a web interface instead of the command line. Should I use the web interface, and if so, how is it accessed?

    Since I haven't figure out the configuration files yet, I parse the code using the following:
    Code:
    phpdoc run -d phpdoc -t phpdoc_out
    I can access the the newly generated documentation website, but when attempting to view the code, either get errors like the following, no content, or actual output (i.e. the echo'd values) of the PHP code. What might be causing this?
    Code:
    <b>Fatal error</b>:  Class 'c2' not found in <b>/var/www/site1/html/testing/phpdoc_out/files/child/main.php.txt</b> on line <b>19</b><br />
    My test files I am trying to parse are:
    PHP Code:
    <?php

        spl_autoload_register
    (function ($class) {
            
    $class=strtolower($class);
            if(
    file_exists('../'.$class.'.php'))
            {
                require_once
    '../'.$class.'.php';
            }
        });

        
    /**
        * Short Description for class 32
        *
        * @param int an integer to add to the running total
        */
        
    class c3 extends c2
        
    {
            
    /**
            * Short Description for variable v3
            *
            * @param int an integer to add to the running total
            */
            
    public $v3;

            
    /**
            * Short Description for method m3
            *
            * @param int an integer to add to the running total
            */
            
    public function m3($x)
            {
                echo(
    $x);
            }
        }

        
    /**
        * Short Description for class c2
        *
        * @param int an integer to add to the running total
        */
        
    class c2 extends c1
        
    {
            
    /**
            * Short Description for variable v2
            *
            * @param int an integer to add to the running total
            */
            
    public $v2;

            
    /**
            * Short Description for method m2
            *
            * @param int an integer to add to the running total
            */
            
    public function m2($x)
            {
                echo(
    $x);
            }
            
    /**
            * Short Description for method m21
            *
            * @param int an integer to add to the running total
            */
            
    protected function m21($x)
            {
                echo(
    $x);
            }
        }

        
    $obj=new c2();
        
    $obj->m1('c1');
        
    $obj->m2('c2');

    ?>
    Where c1.php is as follows:
    PHP Code:
    <?php
        
    /**
         * Short Description for class c1
         *
         * @param int an integer to add to the running total
         */
        
    class c1
        
    {
            
    /**
            * Short Description for variable v1
            *
            * @param int an integer to add to the running total
            */
            
    public $v1;

        
    /**
         * Short Description for method m1
         *
         * @param int an integer to add to the running total
         */
            
    public function m1($x)
            {
                echo(
    $x);
            }

        
    /**
         * Short Description for method m11
         *
         * @param int an integer to add to the running total
         */
            
    protected function m11($x)
            {
                echo(
    $x);
            }
        }
    ?>

    Thank you
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Sep 2006
    Posts
    1,916
    Rep Power
    533
    The errors were a result of a recent change to Apache. Is anyone having this problem? See Apache Documentation and Remi Blog.

    I still would appreciate any advice regarding my questions of how best to configure phpdoc such as whether phpdoc.dist.xml or default.ini is used, and what is the "root of your project".
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    Nice research Notion. I haven't set up phpdoc in forever so I can't help with the configuration question. Do they have a mailing list or a google group or something?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Sep 2006
    Posts
    1,916
    Rep Power
    533
    Hi Dan,

    I believe there are a couple of groups, but they seem to be very little used.

    Turns out I figured out the xml configuration issues. It apparently needs to go into the same directory which you are parsing the PHP. This still doesn't really make sense to me as this xml file specifies the directories to parse.

    In regards to my phpdoc errors, as indicated by the links, it has nothing to do with phpdoc. Turns out PHP/Apache (not necessarily phpdoc) will parse any file that contains .php in its name. For instance, "someFile.php.txt" will be parsed! This is relatively recent.

IMN logo majestic logo threadwatch logo seochat tools logo