CodeDoc/Data/Class.php
authorAlan Knowles <alan@roojs.com>
Fri, 14 Oct 2016 02:34:04 +0000 (10:34 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 14 Oct 2016 02:34:04 +0000 (10:34 +0800)
CodeDoc/Data/Class.php [new file with mode: 0644]

diff --git a/CodeDoc/Data/Class.php b/CodeDoc/Data/Class.php
new file mode 100644 (file)
index 0000000..8c9a9af
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group                                |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license@php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Alan Knowles <alan@akbkhome.com>                      |
+// +----------------------------------------------------------------------+
+//
+require_once 'PHP/CodeDoc/Data.php';
+/**
+*   Class Data Container
+*
+*   @package  PHP_CodeDoc
+*   @access   public
+*   @author   Alan Knowles <alan@akbkhome.com>
+*
+*/
+class PHP_CodeDoc_Data_Class {
+    var $id;                     // id in the big classes array.
+    var $name;                   // the name of the class
+    var $filename;               // original filename
+    var $rfilename;              // relative filename in relation to root directory.
+    var $rdir;                   // relative directory
+    var $Parent;                 // Parent Class (maybe an array in PHP5?)
+    var $Operations =array();    // Array of Method Classes
+    var $Attributes =array();    // Array of Var Classes
+    var $iOperations =array();    // Array of inherited Method Classes
+    var $iAttributes =array();    // Array of inherited Var Classes
+  
+    var $package="";             // package name if any
+    var $copyright;              // copyright
+    var $extends = array();      // Array of Parents (names)
+  
+    var $description;            // phpdoc class
+
+    
+    function output_extends() { // cheesy tree?? = better ideas;
+        $indent=0;
+        $t = count($this->extends) -1;
+        for ($i=0;$i<$t+1;$i++) {
+            echo "\n";
+            if ($i)
+                echo str_repeat('   ',$i) . "|\n". str_repeat('   --',$i);
+
+            //if ($i != $t) { // last one = no link
+                echo '<a href="'.$this->extends[$i].'.html">'.$this->extends[$i].'</a>';
+            //} else {
+                //echo $this->extends[$i];
+            //}
+        }
+    } 
+// move later to inherited
+    function toJS()
+    {
+        $ret = array();
+        $cats = array();
+        foreach($this->Operations as $op) {
+            
+            if (!isset($cats[$op->description->category])) {
+                echo "missing Category for {$this->name}::{$op->name}\n";
+            } else {
+                $cats[$op->description->category] = isset($cats[$op->description->category]) ? $cats[$op->description->category] : array();
+                $cats[$op->description->category][] = strtolower($this->name)). '/'.$op->name;
+            }
+            $ret[str_replace('_','-',strtolower($this->name)). '/'.$op->name] = $op->toJS();
+        }
+        foreach($this->Attributes as $op) {
+         //   $ret[$this->name . '.'.$op->name] = $op->toJS();
+        }
+        return $ret;
+    }
+    
+
+}
+?>
\ No newline at end of file