Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

PHP Auto Documentor
Friday, November 7th, 2008 at 1:35:50pm MST 

  1. <?php
  2.  
  3. include("conf/initiate.php");
  4. include_once HCo_Registry::getParam('Config','file_dir')."/libs/HCo_Admin.class.php";
  5.  
  6. // instantiate the class
  7. $Admin = new HCo_Admin();
  8.  
  9. // read the file into an array
  10. $fileLines = file('libs/HCo_Admin.class.php');
  11.  
  12. // get the class methods (internal method) easier to search this way
  13. $methods = get_class_methods($Admin);
  14.  
  15. // go through all the methods
  16. foreach($methods as $m) {
  17.     // get the method
  18.     $meth = new ReflectionMethod('HCo_Admin', $m);
  19.     $args = $meth->getParameters();
  20.    
  21.     $comment = "   
  22.     /**
  23.     * ".$meth->getName()." : xX_INFO_Xx
  24.     *";
  25.    
  26.         foreach($args as $a) {
  27.             $as = explode('=',$a);
  28.             $def = rtrim($as[1], "]");
  29.             if($def == "") $def = '""';
  30.             $comment .= "
  31.     * @param integer    $".$a->getName()."  xX_INFO_Xx";
  32.         }
  33. $comment .= "
  34.     * @access public
  35.     * @return array
  36.     **/
  37. ";
  38. $fileLines[$meth->getStartLine()-2] = $comment;
  39. }
  40.  
  41. $h = fopen('libs/documentorOutput.class.php','w');
  42. fwrite($h, implode($fileLines));
  43. fclose($h);
  44.  
  45. ?>
  46. Output sent to documentorOutput.class.php

Paste Details

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
worth-right
fantasy-obligation
fantasy-obligation