3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2002 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.02 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Alan Knowles <alan@akbkhome.com> |
17 // +----------------------------------------------------------------------+
19 require_once 'PHP/CodeDoc/Data.php';
21 * Class Data Container
23 * @package PHP_CodeDoc
25 * @author Alan Knowles <alan@akbkhome.com>
28 class PHP_CodeDoc_Data_Class {
29 var $id; // id in the big classes array.
30 var $name; // the name of the class
31 var $filename; // original filename
32 var $rfilename; // relative filename in relation to root directory.
33 var $rdir; // relative directory
34 var $Parent; // Parent Class (maybe an array in PHP5?)
35 var $Operations =array(); // Array of Method Classes
36 var $Attributes =array(); // Array of Var Classes
37 var $iOperations =array(); // Array of inherited Method Classes
38 var $iAttributes =array(); // Array of inherited Var Classes
40 var $package=""; // package name if any
41 var $copyright; // copyright
42 var $extends = array(); // Array of Parents (names)
44 var $description; // phpdoc class
47 function output_extends() { // cheesy tree?? = better ideas;
49 $t = count($this->extends) -1;
50 for ($i=0;$i<$t+1;$i++) {
53 echo str_repeat(' ',$i) . "|\n". str_repeat(' --',$i);
55 //if ($i != $t) { // last one = no link
56 echo '<a href="'.$this->extends[$i].'.html">'.$this->extends[$i].'</a>';
58 //echo $this->extends[$i];
62 // move later to inherited
67 foreach($this->Operations as $op) {
69 if (!isset($cats[$op->description->category])) {
70 echo "missing Category for {$this->name}::{$op->name}\n";
72 $cats[$op->description->category] = isset($cats[$op->description->category]) ? $cats[$op->description->category] : array();
73 $cats[$op->description->category][] = $op->name;
75 $ret[str_replace('_','-',strtolower($this->name)). '/'.$op->name] = $op->toJS();
77 foreach($this->Attributes as $op) {
78 // $ret[$this->name . '.'.$op->name] = $op->toJS();
80 $ret[str_replace('_','-',strtolower($this->name))] = $cats;