| 1 |
lars |
1 |
<?php
|
|
|
2 |
//
|
|
|
3 |
// +------------------------------------------------------------------------+
|
|
|
4 |
// | phpDocumentor |
|
|
|
5 |
// +------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (c) 2000-2003 Joshua Eichorn, Gregory Beaver |
|
|
|
7 |
// | Email jeichorn@phpdoc.org, cellog@phpdoc.org |
|
|
|
8 |
// | Web http://www.phpdoc.org |
|
|
|
9 |
// | Mirror http://phpdocu.sourceforge.net/ |
|
|
|
10 |
// | PEAR http://pear.php.net/package/PhpDocumentor |
|
|
|
11 |
// +------------------------------------------------------------------------+
|
|
|
12 |
// | This source file is subject to version 3.00 of the PHP License, |
|
|
|
13 |
// | that is available at http://www.php.net/license/3_0.txt. |
|
|
|
14 |
// | If you did not receive a copy of the PHP license and are unable to |
|
|
|
15 |
// | obtain it through the world-wide-web, please send a note to |
|
|
|
16 |
// | license@php.net so we can mail you a copy immediately. |
|
|
|
17 |
// +------------------------------------------------------------------------+
|
|
|
18 |
//
|
|
|
19 |
/**
|
|
|
20 |
* XML output converter for DocBook.
|
|
|
21 |
* This Converter takes output from the {@link Parser} and converts it to DocBook output
|
|
|
22 |
*
|
|
|
23 |
* @package Converters
|
|
|
24 |
* @subpackage XMLDocBook
|
|
|
25 |
* @see parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar
|
|
|
26 |
* @author Greg Beaver <cellog@php.net>
|
|
|
27 |
* @since 1.0
|
|
|
28 |
* @version $Id: XMLDocBookConverter.inc 234145 2007-04-19 20:20:57Z ashnazg $
|
|
|
29 |
*/
|
|
|
30 |
/**
|
|
|
31 |
* XML DocBook converter.
|
|
|
32 |
* This Converter takes output from the {@link Parser} and converts it to DocBook output
|
|
|
33 |
*
|
|
|
34 |
* @package Converters
|
|
|
35 |
* @subpackage XMLDocBook
|
|
|
36 |
* @see parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar
|
|
|
37 |
* @author Greg Beaver <cellog@php.net>
|
|
|
38 |
* @since 1.0
|
|
|
39 |
* @version $Id: XMLDocBookConverter.inc 234145 2007-04-19 20:20:57Z ashnazg $
|
|
|
40 |
* @todo indexes for other DocBook converters not based on peardoc
|
|
|
41 |
* @todo templates
|
|
|
42 |
*/
|
|
|
43 |
class XMLDocBookConverter extends Converter
|
|
|
44 |
{
|
|
|
45 |
/**
|
|
|
46 |
* XMLDocBookConverter wants elements sorted by type as well as alphabetically
|
|
|
47 |
* @see Converter::$sort_page_contents_by_type
|
|
|
48 |
* @var boolean
|
|
|
49 |
*/
|
|
|
50 |
var $sort_page_contents_by_type = true;
|
|
|
51 |
/** @var string */
|
|
|
52 |
var $outputformat = 'XML';
|
|
|
53 |
/** @var string */
|
|
|
54 |
var $name = 'DocBook';
|
|
|
55 |
/**
|
|
|
56 |
* indexes of elements by package that need to be generated
|
|
|
57 |
* @var array
|
|
|
58 |
*/
|
|
|
59 |
var $leftindex = array('classes' => true, 'pages' => true, 'functions' => false, 'defines' => false, 'globals' => false);
|
|
|
60 |
/**
|
|
|
61 |
* whether a @see is going to be in the {@link $base_dir}, or in a package/subpackage subdirectory of $base_dir
|
|
|
62 |
* @var boolean
|
|
|
63 |
*/
|
|
|
64 |
var $local = true;
|
|
|
65 |
|
|
|
66 |
/**
|
|
|
67 |
* name of current page being converted
|
|
|
68 |
* @var string
|
|
|
69 |
*/
|
|
|
70 |
var $page;
|
|
|
71 |
|
|
|
72 |
/**
|
|
|
73 |
* path of current page being converted
|
|
|
74 |
* @var string
|
|
|
75 |
*/
|
|
|
76 |
var $path;
|
|
|
77 |
|
|
|
78 |
/**
|
|
|
79 |
* name of current class being converted
|
|
|
80 |
* @var string
|
|
|
81 |
*/
|
|
|
82 |
var $class;
|
|
|
83 |
|
|
|
84 |
/**
|
|
|
85 |
* template for the procedural page currently being processed
|
|
|
86 |
* @var Template
|
|
|
87 |
*/
|
|
|
88 |
var $page_data;
|
|
|
89 |
|
|
|
90 |
/**
|
|
|
91 |
* output directory for the current procedural page being processed
|
|
|
92 |
* @var string
|
|
|
93 |
*/
|
|
|
94 |
var $page_dir;
|
|
|
95 |
|
|
|
96 |
/**
|
|
|
97 |
* target directory passed on the command-line.
|
|
|
98 |
* {@link $targetDir} is malleable, always adding package/ and package/subpackage/ subdirectories onto it.
|
|
|
99 |
* @var string
|
|
|
100 |
*/
|
|
|
101 |
var $base_dir;
|
|
|
102 |
|
|
|
103 |
/**
|
|
|
104 |
* output directory for the current class being processed
|
|
|
105 |
* @var string
|
|
|
106 |
*/
|
|
|
107 |
var $class_dir;
|
|
|
108 |
|
|
|
109 |
/**
|
|
|
110 |
* template for the class currently being processed
|
|
|
111 |
* @var Template
|
|
|
112 |
*/
|
|
|
113 |
var $class_data;
|
|
|
114 |
|
|
|
115 |
/**
|
|
|
116 |
* array of converted package page names.
|
|
|
117 |
* Used to link to the package page in the left index
|
|
|
118 |
* @var array Format: array(package => 1)
|
|
|
119 |
*/
|
|
|
120 |
var $package_pages = array();
|
|
|
121 |
|
|
|
122 |
/**
|
|
|
123 |
* controls formatting of parser informative output
|
|
|
124 |
*
|
|
|
125 |
* Converter prints:
|
|
|
126 |
* "Converting /path/to/file.php... Procedural Page Elements... Classes..."
|
|
|
127 |
* Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there
|
|
|
128 |
* is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that
|
|
|
129 |
* and is purely cosmetic
|
|
|
130 |
* @var boolean
|
|
|
131 |
*/
|
|
|
132 |
var $juststarted = false;
|
|
|
133 |
|
|
|
134 |
/**
|
|
|
135 |
* contains all of the template procedural page element loop data needed for the current template
|
|
|
136 |
* @var array
|
|
|
137 |
*/
|
|
|
138 |
var $current;
|
|
|
139 |
|
|
|
140 |
/**
|
|
|
141 |
* contains all of the template class element loop data needed for the current template
|
|
|
142 |
* @var array
|
|
|
143 |
*/
|
|
|
144 |
var $currentclass;
|
|
|
145 |
/**
|
|
|
146 |
* template options. Currently only 1 recognized option usepear
|
|
|
147 |
*
|
|
|
148 |
* usepear tells the getLink() function to return a package link to PEAR and PEAR_ERROR if possible, and to link directly
|
|
|
149 |
* to the fully-delimited link package#class.method or package#file.method in PEAR style, if possible, even if the
|
|
|
150 |
* package is not parsed. This will allow parsing of separate PEAR packages without parsing the entire thing at once!
|
|
|
151 |
* @var array
|
|
|
152 |
*/
|
|
|
153 |
var $template_options = array('usepear' => false);
|
|
|
154 |
|
|
|
155 |
var $function_data = array();
|
|
|
156 |
var $method_data = array();
|
|
|
157 |
var $sourceloc = '';
|
|
|
158 |
/**
|
|
|
159 |
* peardoc2 Category
|
|
|
160 |
* @var string
|
|
|
161 |
*/
|
|
|
162 |
var $category;
|
|
|
163 |
/**
|
|
|
164 |
* sets {@link $base_dir} to $targetDir
|
|
|
165 |
* @see Converter()
|
|
|
166 |
*/
|
|
|
167 |
function XMLDocBookConverter(&$allp, &$packp, &$classes, &$procpages, $po, $pp, $qm, $targetDir, $templateDir, $title)
|
|
|
168 |
{
|
|
|
169 |
die("XMLDocBookConverter is not supported in this development version. Use XML:DocBook/peardoc2:default");
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
/**
|
|
|
173 |
* do that stuff in $template_options
|
|
|
174 |
*/
|
|
|
175 |
function &getLink($expr, $package = false, $packages = false)
|
|
|
176 |
{
|
|
|
177 |
return Converter::getLink($expr, $package, $packages);
|
|
|
178 |
}
|
|
|
179 |
|
|
|
180 |
function unmangle($s,$sourcecode)
|
|
|
181 |
{
|
|
|
182 |
return '<programlisting role="php"><![CDATA[
|
|
|
183 |
'.$sourcecode.']]></programlisting>';
|
|
|
184 |
}
|
|
|
185 |
|
|
|
186 |
function type_adjust($typename)
|
|
|
187 |
{
|
|
|
188 |
if (isset($this->template_options['typechanging'][trim($typename)]))
|
|
|
189 |
return $this->template_options['typechanging'][trim($typename)];
|
|
|
190 |
$a = $this->getLink($typename);
|
|
|
191 |
if (is_object($a))
|
|
|
192 |
{
|
|
|
193 |
if (phpDocumentor_get_class($a) == 'classlink')
|
|
|
194 |
return '<classname>'.$typename.'</classname>';
|
|
|
195 |
if (phpDocumentor_get_class($a) == 'functionlink' || phpDocumentor_get_class($a) == 'methodlink')
|
|
|
196 |
return '<function>'.$typename.'</function>';
|
|
|
197 |
if (phpDocumentor_get_class($a) == 'definelink')
|
|
|
198 |
return '<constant>'.$typename.'</constant>';
|
|
|
199 |
if (phpDocumentor_get_class($a) == 'varlink')
|
|
|
200 |
return '<varname>'.$typename.'</varname>';
|
|
|
201 |
}
|
|
|
202 |
return $typename;
|
|
|
203 |
}
|
|
|
204 |
|
|
|
205 |
function &SmartyInit(&$templ)
|
|
|
206 |
{
|
|
|
207 |
$this->makeLeft();
|
|
|
208 |
$templ->assign("packageindex",$this->package_index);
|
|
|
209 |
return $templ;
|
|
|
210 |
}
|
|
|
211 |
|
|
|
212 |
/**
|
|
|
213 |
* Writes out the template file of {@link $class_data} and unsets the template to save memory
|
|
|
214 |
* @see registerCurrentClass()
|
|
|
215 |
* @see parent::endClass()
|
|
|
216 |
*/
|
|
|
217 |
function endClass()
|
|
|
218 |
{
|
|
|
219 |
$a = '../';
|
|
|
220 |
if (!empty($this->subpackage)) $a .= '../';
|
|
|
221 |
if ($this->juststarted)
|
|
|
222 |
{
|
|
|
223 |
$this->juststarted = false;
|
|
|
224 |
phpDocumentor_out("\n");
|
|
|
225 |
flush();
|
|
|
226 |
}
|
|
|
227 |
foreach($this->method_data as $func)
|
|
|
228 |
{
|
|
|
229 |
$func[0]->assign("phpdocversion",PHPDOCUMENTOR_VER);
|
|
|
230 |
$func[0]->assign("phpdocwebsite",PHPDOCUMENTOR_WEBSITE);
|
|
|
231 |
$this->setTargetDir($this->base_dir . PATH_DELIMITER . strtolower($this->class_dir . PATH_DELIMITER . str_replace(array('_','.'),array('-','--'),$this->class)));
|
|
|
232 |
$this->writefile(strtolower($func[1] ). '.xml',$func[0]->fetch('method.tpl'));
|
|
|
233 |
}
|
|
|
234 |
if (isset($this->template_options['separatepage']) && $this->template_options['separatepage'])
|
|
|
235 |
{
|
|
|
236 |
$this->setTargetDir($this->base_dir . PATH_DELIMITER . strtolower($this->class_dir) . PATH_DELIMITER . str_replace(array('_','.'),array('-','--'),strtolower($this->class)));
|
|
|
237 |
$this->writefile(str_replace(array('_','.'),array('-','--'),strtolower($this->class)).'-summary.xml',$this->class_summary->fetch('class_summary.tpl'));
|
|
|
238 |
}
|
|
|
239 |
$this->setTargetDir($this->base_dir . PATH_DELIMITER . strtolower($this->class_dir));
|
|
|
240 |
$this->writefile(str_replace(array('_','.'),array('-','--'),strtolower($this->class)) . '.xml',$this->class_data->fetch('class.tpl'));
|
|
|
241 |
unset($this->class_data);
|
|
|
242 |
}
|
|
|
243 |
|
|
|
244 |
/**
|
|
|
245 |
* Writes out the template file of {@link $page_data} and unsets the template to save memory
|
|
|
246 |
* @see registerCurrent()
|
|
|
247 |
* @see parent::endPage()
|
|
|
248 |
*/
|
|
|
249 |
function endPage()
|
|
|
250 |
{
|
|
|
251 |
$this->package = $this->curpage->package;
|
|
|
252 |
$this->subpackage = $this->curpage->subpackage;
|
|
|
253 |
$a = '../';
|
|
|
254 |
if (!empty($this->subpackage)) $a .= '../';
|
|
|
255 |
foreach($this->function_data as $func)
|
|
|
256 |
{
|
|
|
257 |
$func[0]->assign("phpdocversion",PHPDOCUMENTOR_VER);
|
|
|
258 |
$func[0]->assign("phpdocwebsite",PHPDOCUMENTOR_WEBSITE);
|
|
|
259 |
$this->setTargetDir($this->base_dir . PATH_DELIMITER . strtolower($this->page_dir . PATH_DELIMITER . $this->page));
|
|
|
260 |
$this->writefile(str_replace('_','-',strtolower($func[1])) . '.xml',$func[0]->fetch('function.tpl'));
|
|
|
261 |
}
|
|
|
262 |
if (isset($this->template_options['separatepage']) && $this->template_options['separatepage'])
|
|
|
263 |
{
|
|
|
264 |
$this->setTargetDir($this->base_dir . PATH_DELIMITER . strtolower($this->page_dir . PATH_DELIMITER . $this->page));
|
|
|
265 |
$this->writefile(strtolower($this->page).'-summary.xml',$this->page_summary->fetch('page_summary.tpl'));
|
|
|
266 |
}
|
|
|
267 |
$this->setTargetDir($this->base_dir . PATH_DELIMITER . strtolower($this->page_dir));
|
|
|
268 |
$this->writefile(strtolower($this->page) . '.xml',$this->page_data->fetch('page.tpl'));
|
|
|
269 |
unset($this->page_data);
|
|
|
270 |
}
|
|
|
271 |
|
|
|
272 |
/**
|
|
|
273 |
* @param string
|
|
|
274 |
* @param string
|
|
|
275 |
* @return string <ulink url="'.$link.'">'.$text.'</ulink>
|
|
|
276 |
*/
|
|
|
277 |
function returnLink($link,$text)
|
|
|
278 |
{
|
|
|
279 |
return '<ulink url="'.$link.'">'.$text.'</ulink>';
|
|
|
280 |
}
|
|
|
281 |
|
|
|
282 |
function makeLeft()
|
|
|
283 |
{
|
|
|
284 |
static $done = false;
|
|
|
285 |
if ($done) return;
|
|
|
286 |
$done = true;
|
|
|
287 |
if (!isset($this->package_index))
|
|
|
288 |
foreach($this->all_packages as $key => $val)
|
|
|
289 |
{
|
|
|
290 |
if (isset($this->pkg_elements[$key]))
|
|
|
291 |
{
|
|
|
292 |
if (!isset($start)) $start = $key;
|
|
|
293 |
$this->package_index[] = array('link' => "li_$key.html", 'title' => $key);
|
|
|
294 |
}
|
|
|
295 |
}
|
|
|
296 |
foreach($this->page_elements as $package => $o1)
|
|
|
297 |
{
|
|
|
298 |
foreach($o1 as $subpackage => $links)
|
|
|
299 |
{
|
|
|
300 |
for($i=0;$i<count($links);$i++)
|
|
|
301 |
{
|
|
|
302 |
$this->left[$package][$subpackage][] =
|
|
|
303 |
array("link" => $this->returnSee($links[$i], false, false, false), "title" => $links[$i]->name);
|
|
|
304 |
}
|
|
|
305 |
}
|
|
|
306 |
}
|
|
|
307 |
foreach($this->class_elements as $package => $o1)
|
|
|
308 |
{
|
|
|
309 |
foreach($o1 as $subpackage => $links)
|
|
|
310 |
{
|
|
|
311 |
for($i=0;$i<count($links);$i++)
|
|
|
312 |
{
|
|
|
313 |
$this->left['#class'][$package][$subpackage][] =
|
|
|
314 |
array("link" => $this->returnSee($links[$i], false, false, false), "title" => $links[$i]->name);
|
|
|
315 |
}
|
|
|
316 |
}
|
|
|
317 |
}
|
|
|
318 |
}
|
|
|
319 |
|
|
|
320 |
/**
|
|
|
321 |
* HTMLdefaultConverter chooses to format both package indexes and the complete index here
|
|
|
322 |
*
|
|
|
323 |
* This function formats output for the elementindex.html and pkgelementindex.html template files. It then
|
|
|
324 |
* writes them to the target directory
|
|
|
325 |
* @see generateElementIndex(), generatePkgElementIndex()
|
|
|
326 |
*/
|
|
|
327 |
function formatPkgIndex()
|
|
|
328 |
{
|
|
|
329 |
// will implement in next release with other templates than peardoc2
|
|
|
330 |
return;
|
|
|
331 |
list($package_indexes,$packages,$mletters) = $this->generatePkgElementIndexes();
|
|
|
332 |
for($i=0;$i<count($package_indexes);$i++)
|
|
|
333 |
{
|
|
|
334 |
$template = &$this->newSmarty();
|
|
|
335 |
$this->package = $package_indexes[$i]['package'];
|
|
|
336 |
$this->subpackage = '';
|
|
|
337 |
$template->assign("compiledclassindex",$this->getClassLeft());
|
|
|
338 |
$template->assign("compiledfileindex",$this->getPageLeft());
|
|
|
339 |
$template->assign("index",$package_indexes[$i]['pindex']);
|
|
|
340 |
$template->assign("package",$package_indexes[$i]['package']);
|
|
|
341 |
$template->assign("letters",$mletters[$package_indexes[$i]['package']]);
|
|
|
342 |
$template->assign("title","Package ".$package_indexes[$i]['package']." Element Index");
|
|
|
343 |
$template->assign("date",date("r",time()));
|
|
|
344 |
// $this->writefile('elementindex_'.$package_indexes[$i]['package'].'.html',$template->fetch('pkgelementindex.tpl'));
|
|
|
345 |
}
|
|
|
346 |
phpDocumentor_out("\n");
|
|
|
347 |
flush();
|
|
|
348 |
}
|
|
|
349 |
|
|
|
350 |
/**
|
|
|
351 |
* HTMLdefaultConverter uses this function to format template index.html and packages.html
|
|
|
352 |
*
|
|
|
353 |
* This function generates the package list from {@link $all_packages}, eliminating any
|
|
|
354 |
* packages that don't have any entries in their package index (no files at all, due to @ignore
|
|
|
355 |
* or other factors). Then it uses the default package name as the first package index to display.
|
|
|
356 |
* It sets the right pane to be either a blank file with instructions on making package-level docs,
|
|
|
357 |
* or the package-level docs for the default package.
|
|
|
358 |
* @global string Used to set the starting package to display
|
|
|
359 |
*/
|
|
|
360 |
function formatIndex()
|
|
|
361 |
{
|
|
|
362 |
// will implement in next release with other templates than peardoc2
|
|
|
363 |
return;
|
|
|
364 |
global $phpDocumentor_DefaultPackageName;
|
|
|
365 |
list($elindex,$mletters) = $this->generateElementIndex();
|
|
|
366 |
$template = &$this->newSmarty();
|
|
|
367 |
$template->assign("index",$elindex);
|
|
|
368 |
$template->assign("letters",$mletters);
|
|
|
369 |
$template->assign("title","Element Index");
|
|
|
370 |
$template->assign("date",date("r",time()));
|
|
|
371 |
phpDocumentor_out("\n");
|
|
|
372 |
flush();
|
|
|
373 |
$this->setTargetDir($this->base_dir);
|
|
|
374 |
// $this->writefile('elementindex.html',$template->fetch('elementindex.tpl'));
|
|
|
375 |
uksort($this->package_index,"strnatcasecmp");
|
|
|
376 |
$index = &$this->newSmarty();
|
|
|
377 |
foreach($this->all_packages as $key => $val)
|
|
|
378 |
{
|
|
|
379 |
if (isset($this->pkg_elements[$key]))
|
|
|
380 |
{
|
|
|
381 |
if (!isset($start)) $start = $key;
|
|
|
382 |
if (!isset($this->package_pages[$key])) $this->writeNewPPage($key);
|
|
|
383 |
}
|
|
|
384 |
}
|
|
|
385 |
// Created index.html
|
|
|
386 |
if (isset($this->package_index[$phpDocumentor_DefaultPackageName])) $start = $phpDocumentor_DefaultPackageName;
|
|
|
387 |
$this->package = $start;
|
|
|
388 |
$this->subpackage = '';
|
|
|
389 |
$index->assign("compiledclassindex",$this->getClassLeft());
|
|
|
390 |
$index->assign("compiledfileindex",$this->getPageLeft());
|
|
|
391 |
$index->assign("date",date("r",time()));
|
|
|
392 |
$index->assign("title",$this->title);
|
|
|
393 |
$index->assign("start","li_$start.html");
|
|
|
394 |
if (isset($this->package_pages[$start]))
|
|
|
395 |
{
|
|
|
396 |
$index->assign("contents",$this->package_pages[$start]);
|
|
|
397 |
}
|
|
|
398 |
phpDocumentor_out("\n");
|
|
|
399 |
flush();
|
|
|
400 |
$this->setTargetDir($this->base_dir);
|
|
|
401 |
// $this->writefile("index.html",$index->fetch('index.tpl'));
|
|
|
402 |
unset($index);
|
|
|
403 |
|
|
|
404 |
}
|
|
|
405 |
|
|
|
406 |
function writeNewPPage($key)
|
|
|
407 |
{
|
|
|
408 |
// will implement in next release with other templates than peardoc2
|
|
|
409 |
return;
|
|
|
410 |
$template = &$this->newSmarty();
|
|
|
411 |
$this->package = $key;
|
|
|
412 |
$this->subpackage = '';
|
|
|
413 |
$template->assign("compiledclassindex",$this->getClassLeft());
|
|
|
414 |
$template->assign("compiledfileindex",$this->getPageLeft());
|
|
|
415 |
$template->assign("date",date("r",time()));
|
|
|
416 |
$template->assign("title",$this->title);
|
|
|
417 |
$template->assign("package",$key);
|
|
|
418 |
phpDocumentor_out("\n");
|
|
|
419 |
flush();
|
|
|
420 |
$this->setTargetDir($this->base_dir);
|
|
|
421 |
// $this->writefile("li_$key.html",$template->fetch('index.tpl'));
|
|
|
422 |
unset($template);
|
|
|
423 |
}
|
|
|
424 |
|
|
|
425 |
/**
|
|
|
426 |
* Generate indexes for li_package.html and classtree output files
|
|
|
427 |
*
|
|
|
428 |
* This function generates the li_package.html files from the template file left.html. It does this by
|
|
|
429 |
* iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve
|
|
|
430 |
* the pre-sorted {@link abstractLink} descendants needed for index generation. Conversion of these links to
|
|
|
431 |
* text is done by {@link returnSee()}. The {@link $local} parameter is set to false to ensure that paths are correct.
|
|
|
432 |
*
|
|
|
433 |
* Then it uses {@link generateFormattedClassTrees()} to create class trees from the template file classtrees.html. Output
|
|
|
434 |
* filename is classtrees_packagename.html. This function also unsets {@link $elements} and {@link $pkg_elements} to free
|
|
|
435 |
* up the considerable memory these two class vars use
|
|
|
436 |
* @see $page_elements, $class_elements, $function_elements
|
|
|
437 |
*/
|
|
|
438 |
function formatLeftIndex()
|
|
|
439 |
{
|
|
|
440 |
// will implement in next release with other templates than peardoc2
|
|
|
441 |
return;
|
|
|
442 |
phpDocumentor_out("\n");
|
|
|
443 |
flush();
|
|
|
444 |
$this->setTargetDir($this->base_dir);
|
|
|
445 |
if (!isset($this->left))
|
|
|
446 |
{
|
|
|
447 |
debug("Nothing parsed, check the command-line");
|
|
|
448 |
die();
|
|
|
449 |
}
|
|
|
450 |
foreach($this->all_packages as $package => $rest)
|
|
|
451 |
{
|
|
|
452 |
if (!isset($this->pkg_elements[$package])) continue;
|
|
|
453 |
// Create class tree page
|
|
|
454 |
$template = &$this->newSmarty();
|
|
|
455 |
$template->assign("classtrees",$this->generateFormattedClassTrees($package));
|
|
|
456 |
$template->assign("package",$package);
|
|
|
457 |
$template->assign("date",date("r",time()));
|
|
|
458 |
$template->assign("title","Class Trees for Package $package");
|
|
|
459 |
// $this->writefile("classtrees_$package.html",$template->fetch('classtrees.tpl'));
|
|
|
460 |
phpDocumentor_out("\n");
|
|
|
461 |
flush();
|
|
|
462 |
}
|
|
|
463 |
// free up considerable memory
|
|
|
464 |
unset($this->elements);
|
|
|
465 |
unset($this->pkg_elements);
|
|
|
466 |
}
|
|
|
467 |
|
|
|
468 |
/**
|
|
|
469 |
* This function takes an {@link abstractLink} descendant and returns an html link
|
|
|
470 |
*
|
|
|
471 |
* @param abstractLink a descendant of abstractlink should be passed, and never text
|
|
|
472 |
* @param string text to display in the link
|
|
|
473 |
* @param boolean this parameter is not used, and is deprecated
|
|
|
474 |
* @param boolean determines whether the returned text is enclosed in an <a> tag
|
|
|
475 |
*/
|
|
|
476 |
function returnSee(&$element, $eltext = false, $local = true, $with_a = true)
|
|
|
477 |
{
|
|
|
478 |
if (!$element) return false;
|
|
|
479 |
if (!$eltext)
|
|
|
480 |
{
|
|
|
481 |
$eltext = '';
|
|
|
482 |
switch($element->type)
|
|
|
483 |
{
|
|
|
484 |
case 'tutorial' :
|
|
|
485 |
$eltext = $element->title;
|
|
|
486 |
break;
|
|
|
487 |
case 'class' :
|
|
|
488 |
$eltext = '<classname>'.$element->name.'</classname>';
|
|
|
489 |
break;
|
|
|
490 |
case 'method' :
|
|
|
491 |
$eltext .= '<function>';
|
|
|
492 |
case 'var' :
|
|
|
493 |
if ($element->type == 'var') $eltext .= '<varname>';
|
|
|
494 |
$eltext .= $element->class.'::';
|
|
|
495 |
case 'page' :
|
|
|
496 |
case 'define' :
|
|
|
497 |
if ($element->type == 'define')
|
|
|
498 |
$eltext .= '<constant>';
|
|
|
499 |
case 'function' :
|
|
|
500 |
if ($element->type == 'function')
|
|
|
501 |
$eltext .= '<function>';
|
|
|
502 |
case 'global' :
|
|
|
503 |
default :
|
|
|
504 |
$eltext .= $element->name;
|
|
|
505 |
if ($element->type == 'function' || $element->type == 'method') $eltext .= '()</function>';
|
|
|
506 |
if ($element->type == 'var') $eltext .= '</varname>';
|
|
|
507 |
if ($element->type == 'define') $eltext .= '</constant>';
|
|
|
508 |
break;
|
|
|
509 |
}
|
|
|
510 |
}
|
|
|
511 |
$a = '';
|
|
|
512 |
if (!empty($element->subpackage))
|
|
|
513 |
{
|
|
|
514 |
$a = $element->subpackage.'.';
|
|
|
515 |
}
|
|
|
516 |
switch ($element->type)
|
|
|
517 |
{
|
|
|
518 |
case 'page' :
|
|
|
519 |
if ($with_a)
|
|
|
520 |
return '<link linkend="package.'.strtolower($element->package.'.'.$a).$element->fileAlias.'">'.$eltext.'</link>';
|
|
|
521 |
else
|
|
|
522 |
return 'package.'.strtolower($element->package.'.'.$a).$element->fileAlias;
|
|
|
523 |
break;
|
|
|
524 |
case 'define' :
|
|
|
525 |
if ($with_a)
|
|
|
526 |
return '<link linkend="package.'.strtolower($element->package.'.'.$a).$element->fileAlias.'.'.urlencode($element->name).'">'.$eltext.'</link>';
|
|
|
527 |
else
|
|
|
528 |
return 'package.'.strtolower($element->package.'.'.$a).$element->fileAlias.'.'.urlencode($element->name);
|
|
|
529 |
break;
|
|
|
530 |
case 'global' :
|
|
|
531 |
if ($with_a)
|
|
|
532 |
return '<link linkend="package.'.strtolower($element->package.'.'.$a).$element->fileAlias.'.'.urlencode($element->name).'">'.$eltext.'</link>';
|
|
|
533 |
else
|
|
|
534 |
return 'package.'.strtolower($element->package.'.'.$a).$element->fileAlias.'.'.urlencode($element->name);
|
|
|
535 |
break;
|
|
|
536 |
case 'class' :
|
|
|
537 |
if ($with_a)
|
|
|
538 |
return '<link linkend="package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->name)).'">'.$eltext.'</link>';
|
|
|
539 |
else
|
|
|
540 |
return 'package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->name));
|
|
|
541 |
break;
|
|
|
542 |
case 'function' :
|
|
|
543 |
if ($with_a)
|
|
|
544 |
return '<link linkend="package.'.strtolower($element->package.'.'.$a.$element->fileAlias.'.'.str_replace('_','-',$element->name)).'">'.$eltext.'</link>';
|
|
|
545 |
else
|
|
|
546 |
return 'package.'.strtolower($element->package.'.'.$a.$element->fileAlias.'.'.str_replace('_','-',$element->name));
|
|
|
547 |
break;
|
|
|
548 |
case 'method' :
|
|
|
549 |
if ($with_a)
|
|
|
550 |
return '<link linkend="package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->class).'.'.str_replace('_','-',$element->name)).'">'.$eltext.'</link>';
|
|
|
551 |
else
|
|
|
552 |
return 'package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->class).'.'.str_replace('_','-',$element->name));
|
|
|
553 |
break;
|
|
|
554 |
case 'var' :
|
|
|
555 |
if ($with_a)
|
|
|
556 |
return '<link linkend="package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->class).'.'.$element->name).'">'.$eltext.'</link>';
|
|
|
557 |
else
|
|
|
558 |
return 'package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->class).'.'.$element->name);
|
|
|
559 |
break;
|
|
|
560 |
case 'tutorial' :
|
|
|
561 |
if ($with_a)
|
|
|
562 |
return '<link linked="package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->name).'-tutorial">'.$eltext).'</link>';
|
|
|
563 |
else
|
|
|
564 |
return 'package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->name)).'-tutorial';
|
|
|
565 |
}
|
|
|
566 |
}
|
|
|
567 |
|
|
|
568 |
/**
|
|
|
569 |
* Get the id value needed to allow linking
|
|
|
570 |
* @param mixed descendant of parserElement or parserData/parserPage
|
|
|
571 |
* @see parserElement, parserData, parserPage
|
|
|
572 |
* @return string the id value for this element type
|
|
|
573 |
*/
|
|
|
574 |
function getId(&$el)
|
|
|
575 |
{
|
|
|
576 |
if (phpDocumentor_get_class($el) == 'parserdata')
|
|
|
577 |
{
|
|
|
578 |
$element = $this->addLink($el->parent);
|
|
|
579 |
$elp = $el->parent;
|
|
|
580 |
} else
|
|
|
581 |
{
|
|
|
582 |
$elp = $el;
|
|
|
583 |
$element = $this->addLink($el);
|
|
|
584 |
}
|
|
|
585 |
$a = '';
|
|
|
586 |
if (!empty($element->subpackage))
|
|
|
587 |
{
|
|
|
588 |
$a = $element->subpackage.'.';
|
|
|
589 |
}
|
|
|
590 |
switch ($element->type)
|
|
|
591 |
{
|
|
|
592 |
case 'page' :
|
|
|
593 |
return 'package.'.strtolower($element->package.'.'.$a.$element->fileAlias);
|
|
|
594 |
break;
|
|
|
595 |
case 'define' :
|
|
|
596 |
return 'package.'.$element->package.'.'.strtolower($a.$element->fileAlias.'.'.str_replace(array('$','_','"',"'"),array('var--','-','-','-'),$element->name));
|
|
|
597 |
break;
|
|
|
598 |
case 'global' :
|
|
|
599 |
return 'package.'.strtolower($element->package.'.'.$a.$element->fileAlias.'.'.str_replace(array('$','_','"',"'"),array('var--','-','-','-'),$element->name));
|
|
|
600 |
break;
|
|
|
601 |
case 'class' :
|
|
|
602 |
return 'package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->name));
|
|
|
603 |
break;
|
|
|
604 |
case 'function' :
|
|
|
605 |
return 'package.'.strtolower($element->package.'.'.$a.$element->fileAlias.'.'.str_replace('_','-',$element->name));
|
|
|
606 |
break;
|
|
|
607 |
case 'method' :
|
|
|
608 |
return 'package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->class).'.'.str_replace('_','-',$element->name));
|
|
|
609 |
break;
|
|
|
610 |
case 'var' :
|
|
|
611 |
return 'package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->class).'-summary.vars.'.str_replace(array('$','_'),array('var--','-'),$element->name));
|
|
|
612 |
break;
|
|
|
613 |
case 'tutorial' :
|
|
|
614 |
return 'package.'.strtolower($element->package.'.'.$a.str_replace(array('_','.'),array('-','--'),$element->name)).'-tutorial';
|
|
|
615 |
break;
|
|
|
616 |
}
|
|
|
617 |
}
|
|
|
618 |
|
|
|
619 |
/**
|
|
|
620 |
* Create errors.html template file output
|
|
|
621 |
*
|
|
|
622 |
* This method takes all parsing errors and warnings and spits them out ordered by file and line number.
|
|
|
623 |
* @global ErrorTracker We'll be using it's output facility
|
|
|
624 |
*/
|
|
|
625 |
function ConvertErrorLog()
|
|
|
626 |
{
|
|
|
627 |
global $phpDocumentor_errors;
|
|
|
628 |
$allfiles = array();
|
|
|
629 |
$files = array();
|
|
|
630 |
$warnings = $phpDocumentor_errors->returnWarnings();
|
|
|
631 |
$errors = $phpDocumentor_errors->returnErrors();
|
|
|
632 |
$template = &$this->newSmarty();
|
|
|
633 |
foreach($warnings as $warning)
|
|
|
634 |
{
|
|
|
635 |
$file = '##none';
|
|
|
636 |
$linenum = 'Warning';
|
|
|
637 |
if ($warning->file)
|
|
|
638 |
{
|
|
|
639 |
$file = $warning->file;
|
|
|
640 |
$allfiles[$file] = 1;
|
|
|
641 |
$linenum .= ' on line '.$warning->linenum;
|
|
|
642 |
}
|
|
|
643 |
$files[$file]['warnings'][] = array('name' => $linenum, 'listing' => $warning->data);
|
|
|
644 |
}
|
|
|
645 |
foreach($errors as $error)
|
|
|
646 |
{
|
|
|
647 |
$file = '##none';
|
|
|
648 |
$linenum = 'Error';
|
|
|
649 |
if ($error->file)
|
|
|
650 |
{
|
|
|
651 |
$file = $error->file;
|
|
|
652 |
$allfiles[$file] = 1;
|
|
|
653 |
$linenum .= ' on line '.$error->linenum;
|
|
|
654 |
}
|
|
|
655 |
$files[$file]['errors'][] = array('name' => $linenum, 'listing' => $error->data);
|
|
|
656 |
}
|
|
|
657 |
$i=1;
|
|
|
658 |
$af = array();
|
|
|
659 |
foreach($allfiles as $file => $num)
|
|
|
660 |
{
|
|
|
661 |
$af[$i++] = $file;
|
|
|
662 |
}
|
|
|
663 |
$allfiles = $af;
|
|
|
664 |
usort($allfiles,'strnatcasecmp');
|
|
|
665 |
$allfiles[0] = "Post-parsing";
|
|
|
666 |
foreach($allfiles as $i => $a)
|
|
|
667 |
{
|
|
|
668 |
$allfiles[$i] = array('file' => $a);
|
|
|
669 |
}
|
|
|
670 |
$out = array();
|
|
|
671 |
foreach($files as $file => $data)
|
|
|
672 |
{
|
|
|
673 |
if ($file == '##none') $file = 'Post-parsing';
|
|
|
674 |
$out[$file] = $data;
|
|
|
675 |
}
|
|
|
676 |
$template->assign("files",$allfiles);
|
|
|
677 |
$template->assign("all",$out);
|
|
|
678 |
$template->assign("title","phpDocumentor Parser Errors and Warnings");
|
|
|
679 |
$this->setTargetDir($this->base_dir);
|
|
|
680 |
$this->writefile("errors.html",$template->fetch('errors.tpl'));
|
|
|
681 |
unset($template);
|
|
|
682 |
phpDocumentor_out("\n\nTo view errors and warnings, look at ".$this->base_dir. PATH_DELIMITER . "errors.html\n");
|
|
|
683 |
flush();
|
|
|
684 |
}
|
|
|
685 |
|
|
|
686 |
function postProcess($text)
|
|
|
687 |
{
|
|
|
688 |
return htmlentities($text);
|
|
|
689 |
}
|
|
|
690 |
|
|
|
691 |
function prepareDocBlock(&$element, $nopackage = true)
|
|
|
692 |
{
|
|
|
693 |
return parent::prepareDocBlock($element, array('staticvar' => 'staticvar','deprec' => 'deprecated','abstract' => 'abstract','TODO' => 'todo', 'uses' => 'see', 'usedby' => 'see', 'tutorial' => 'see'), $nopackage);
|
|
|
694 |
}
|
|
|
695 |
|
|
|
696 |
function getTutorialId($package,$subpackage,$tutorial,$id)
|
|
|
697 |
{
|
|
|
698 |
$subpackage = (empty($subpackage) ? '' : '.'.$subpackage);
|
|
|
699 |
$id = (empty($id) ? '' : '.'.$id);
|
|
|
700 |
return 'package.'.strtolower($package.$subpackage.str_replace(array('_','.'),array('-','--'),$tutorial).$id);
|
|
|
701 |
}
|
|
|
702 |
|
|
|
703 |
function getCData($value)
|
|
|
704 |
{
|
|
|
705 |
return '<!CDATA['.$value.']]>';
|
|
|
706 |
}
|
|
|
707 |
|
|
|
708 |
/**
|
|
|
709 |
* Converts package page and sets its package as used in {@link $package_pages}
|
|
|
710 |
* @param parserPackagePage
|
|
|
711 |
*/
|
|
|
712 |
function convertPackagePage(&$element)
|
|
|
713 |
{
|
|
|
714 |
return;
|
|
|
715 |
phpDocumentor_out("\n");
|
|
|
716 |
flush();
|
|
|
717 |
$template = &$this->newSmarty();
|
|
|
718 |
$this->package = $element->package;
|
|
|
719 |
$this->subpackage = '';
|
|
|
720 |
$template->assign("compiledclassindex",$this->getClassLeft());
|
|
|
721 |
$template->assign("compiledfileindex",$this->getPageLeft());
|
|
|
722 |
$template->assign("date",date("r",time()));
|
|
|
723 |
$template->assign("title",$this->title);
|
|
|
724 |
$template->assign("package",$element->package);
|
|
|
725 |
$x = $element->Convert($this);
|
|
|
726 |
$x = substr($x,strpos($x,'<body'));
|
|
|
727 |
$template->assign("contents",trim(substr($x,strpos($x,'>') + 1)));
|
|
|
728 |
phpDocumentor_out("\n");
|
|
|
729 |
flush();
|
|
|
730 |
$this->setTargetDir($this->base_dir);
|
|
|
731 |
// $this->writefile("li_".$element->package.".html",$template->fetch('index.tpl'));
|
|
|
732 |
unset($template);
|
|
|
733 |
$this->package_pages[$element->package] = trim(substr($x,strpos($x,'>') + 1));
|
|
|
734 |
}
|
|
|
735 |
|
|
|
736 |
function convertTutorial(&$element)
|
|
|
737 |
{
|
|
|
738 |
$template = &parent::convertTutorial($element);
|
|
|
739 |
phpDocumentor_out("\n");
|
|
|
740 |
flush();
|
|
|
741 |
$x = $element->Convert($this,false);
|
|
|
742 |
if ($element->ini)
|
|
|
743 |
{ // add child tutorial list to the tutorial through a slight hack :)
|
|
|
744 |
$subtutorials = '';
|
|
|
745 |
$b = '';
|
|
|
746 |
if (!empty($element->subpackage)) $b = '.'.$element->subpackage;
|
|
|
747 |
foreach($element->ini['Linked Tutorials'] as $child)
|
|
|
748 |
{
|
|
|
749 |
$subtutorials .= ' &'.$element->package.$b.'.'.str_replace(array('_','.'),array('-','--'),$child).'-'.$element->tutorial_type."-tutorial;\n";
|
|
|
750 |
}
|
|
|
751 |
$x = str_replace('</refsect1></refentry>','</refsect1>
|
|
|
752 |
<refsect1>
|
|
|
753 |
<title>Related Docs</title>
|
|
|
754 |
<para>
|
|
|
755 |
'.$subtutorials.
|
|
|
756 |
' </para>
|
|
|
757 |
</refsect1></refentry>',$x);
|
|
|
758 |
}
|
|
|
759 |
$template->assign('contents',$x);
|
|
|
760 |
$contents = $template->fetch('tutorial.tpl');
|
|
|
761 |
$a = '';
|
|
|
762 |
if ($element->subpackage) $a = PATH_DELIMITER . $element->subpackage;
|
|
|
763 |
phpDocumentor_out("\n");
|
|
|
764 |
flush();
|
|
|
765 |
$this->setTargetDir($this->base_dir . PATH_DELIMITER . strtolower($element->package . $a));
|
|
|
766 |
$this->writeFile(str_replace(array('_','.'),array('-','--'),strtolower($element->name)).'-tutorial.xml',$contents);
|
|
|
767 |
}
|
|
|
768 |
|
|
|
769 |
/**
|
|
|
770 |
* Converts class variables for template output.
|
|
|
771 |
* @see prepareDocBlock(), getFormattedOverrides()
|
|
|
772 |
* @param parserVar
|
|
|
773 |
*/
|
|
|
774 |
function convertVar(&$element)
|
|
|
775 |
{
|
|
|
776 |
$docblock = $this->prepareDocBlock($element);
|
|
|
777 |
$b = 'mixed';
|
|
|
778 |
if ($element->docblock->var)
|
|
|
779 |
{
|
|
|
780 |
$b = $element->docblock->var->converted_returnType;
|
|
|
781 |
}
|
|
|
782 |
// var_dump($this->getFormattedOverrides($element));
|
|
|
783 |
if (isset($this->template_options['separatepage']) && $this->template_options['separatepage'])
|
|
|
784 |
$this->class_summary->append('vars',array('sdesc' => $docblock['sdesc'],
|
|
|
785 |
'desc' => $docblock['desc'],
|
|
|
786 |
'tags' => $docblock['tags'],
|
|
|
787 |
'var_name' => $this->type_adjust($element->getName()),
|
|
|
788 |
'var_default' => htmlspecialchars($element->getValue()),
|
|
|
789 |
'var_type' => $b,
|
|
|
790 |
'var_overrides' => $this->getFormattedOverrides($element),
|
|
|
791 |
'line_number' => $element->getLineNumber(),
|
|
|
792 |
'id' => $this->getId($element)));
|
|
|
793 |
else
|
|
|
794 |
$this->class_data->append('vars',array('sdesc' => $docblock['sdesc'],
|
|
|
795 |
'desc' => $docblock['desc'],
|
|
|
796 |
'tags' => $docblock['tags'],
|
|
|
797 |
'var_name' => $this->type_adjust($element->getName()),
|
|
|
798 |
'var_default' => htmlspecialchars($element->getValue()),
|
|
|
799 |
'var_type' => $b,
|
|
|
800 |
'var_overrides' => $this->getFormattedOverrides($element),
|
|
|
801 |
'line_number' => $element->getLineNumber(),
|
|
|
802 |
'id' => $this->getId($element)));
|
|
|
803 |
}
|
|
|
804 |
|
|
|
805 |
/**
|
|
|
806 |
* Converts class for template output
|
|
|
807 |
* @see prepareDocBlock(), generateChildClassList(), generateFormattedClassTree(), getFormattedConflicts()
|
|
|
808 |
* @see getFormattedInheritedMethods(), getFormattedInheritedVars()
|
|
|
809 |
* @param parserClass
|
|
|
810 |
*/
|
|
|
811 |
function convertClass(&$element)
|
|
|
812 |
{
|
|
|
813 |
parent::convertClass($element);
|
|
|
814 |
$docblock = $this->prepareDocBlock($element);
|
|
|
815 |
$this->class_dir = $element->docblock->package;
|
|
|
816 |
if (!empty($element->docblock->subpackage)) $this->class_dir .= PATH_DELIMITER . $element->docblock->subpackage;
|
|
|
817 |
$docblock = $this->prepareDocBlock($element,false);
|
|
|
818 |
|
|
|
819 |
$this->class_data->assign("sdesc",$docblock['sdesc']);
|
|
|
820 |
$this->class_data->assign("desc",$docblock['desc']);
|
|
|
821 |
$this->class_data->assign("tags",$docblock['tags']);
|
|
|
822 |
|
|
|
823 |
$this->class_data->assign("source_location",$element->getSourceLocation($this,$this->template_options['usepear']));
|
|
|
824 |
$this->class_data->assign("id",$this->getId($element));
|
|
|
825 |
$this->class_data->assign("method_ids",array());
|
|
|
826 |
if ($t = $element->getTutorial())
|
|
|
827 |
{
|
|
|
828 |
$this->class_data->append("method_ids",$this->getId($t));
|
|
|
829 |
}
|
|
|
830 |
|
|
|
831 |
if (isset($this->template_options['separatepage']) && $this->template_options['separatepage'])
|
|
|
832 |
{
|
|
|
833 |
$this->class_summary = &$this->newSmarty(true);
|
|
|
834 |
if ($t = $element->getTutorial())
|
|
|
835 |
{
|
|
|
836 |
$this->class_summary->assign("tutorial",$this->returnSee($t));
|
|
|
837 |
}
|
|
|
838 |
|
|
|
839 |
$this->class_summary->assign("class_name",$this->type_adjust($element->getName()));
|
|
|
840 |
$this->class_summary->assign("sdesc",$docblock['sdesc']);
|
|
|
841 |
$this->class_summary->assign("desc",$docblock['desc']);
|
|
|
842 |
$this->class_summary->assign("tags",$docblock['tags']);
|
|
|
843 |
$this->class_summary->assign("vars",array());
|
|
|
844 |
$this->class_summary->assign("methods",array());
|
|
|
845 |
$this->class_summary->assign("package",$element->docblock->package);
|
|
|
846 |
|
|
|
847 |
$this->class_summary->assign("children", $this->generateChildClassList($element));
|
|
|
848 |
$this->class_summary->assign("class_tree", $this->generateFormattedClassTree($element));
|
|
|
849 |
$this->class_summary->assign("conflicts", $this->getFormattedConflicts($element,"classes"));
|
|
|
850 |
|
|
|
851 |
$this->class_summary->assign("source_location",$element->getSourceLocation($this,$this->template_options['usepear']));
|
|
|
852 |
$this->class_summary->assign("id",$this->getId($element).'-summary');
|
|
|
853 |
$this->class_data->append("method_ids",$this->getId($element).'.'.strtolower(str_replace('_','-',$element->getName())).'-summary');
|
|
|
854 |
$inherited_methods = $this->getFormattedInheritedMethods($element);
|
|
|
855 |
if (!empty($inherited_methods))
|
|
|
856 |
{
|
|
|
857 |
$this->class_summary->assign("imethods",$inherited_methods);
|
|
|
858 |
}
|
|
|
859 |
$inherited_vars = $this->getFormattedInheritedVars($element);
|
|
|
860 |
if (!empty($inherited_vars))
|
|
|
861 |
{
|
|
|
862 |
$this->class_summary->assign("ivars",$inherited_vars);
|
|
|
863 |
}
|
|
|
864 |
}
|
|
|
865 |
$this->sourceloc = $element->getSourceLocation($this,$this->template_options['usepear']);
|
|
|
866 |
}
|
|
|
867 |
|
|
|
868 |
/**
|
|
|
869 |
* Converts method for template output
|
|
|
870 |
* @see prepareDocBlock(), parserMethod::getFunctionCall(), getFormattedDescMethods(), getFormattedOverrides()
|
|
|
871 |
* @param parserMethod
|
|
|
872 |
*/
|
|
|
873 |
function convertMethod(&$element)
|
|
|
874 |
{
|
|
|
875 |
$fname = $element->getName();
|
|
|
876 |
if ($element->isConstructor)
|
|
|
877 |
{
|
|
|
878 |
$fname = 'constructor '.$element->getName();
|
|
|
879 |
}
|
|
|
880 |
$docblock = $this->prepareDocBlock($element);
|
|
|
881 |
$returntype = 'void';
|
|
|
882 |
if ($element->docblock->return)
|
|
|
883 |
{
|
|
|
884 |
$a = $element->docblock->return->Convert($this);
|
|
|
885 |
$returntype = $element->docblock->return->converted_returnType;
|
|
|
886 |
if ($returntype != $element->docblock->return->returnType)
|
|
|
887 |
{
|
|
|
888 |
$returntype = "<replaceable>$returntype</replaceable>";
|
|
|
889 |
}
|
|
|
890 |
}
|
|
|
891 |
$params = array();
|
|
|
892 |
if (count($element->docblock->params))
|
|
|
893 |
foreach($element->docblock->params as $param => $val)
|
|
|
894 |
{
|
|
|
895 |
$a = $val->Convert($this);
|
|
|
896 |
$params[$param] = array("var" => $param,"datatype" => $val->converted_returnType,"data" => $a);
|
|
|
897 |
}
|
|
|
898 |
|
|
|
899 |
if (isset($this->template_options['separatepage']) && $this->template_options['separatepage'])
|
|
|
900 |
{
|
|
|
901 |
$this->class_data->append('method_ids',$this->getId($element));
|
|
|
902 |
$this->class_summary->append('methods',array('id' => $this->getId($element),
|
|
|
903 |
'sdesc' => $docblock['sdesc'],
|
|
|
904 |
'desc' => $docblock['desc'],
|
|
|
905 |
'tags' => $docblock['tags'],
|
|
|
906 |
'is_constructor' => $element->isConstructor,
|
|
|
907 |
'function_name' => $element->getName(),
|
|
|
908 |
'function_return' => $returntype,
|
|
|
909 |
'function_call' => $element->getIntricateFunctionCall($this,$params),
|
|
|
910 |
'descmethod' => $this->getFormattedDescMethods($element),
|
|
|
911 |
'method_overrides' => $this->getFormattedOverrides($element),
|
|
|
912 |
'line_number' => $element->getLineNumber(),
|
|
|
913 |
'params' => $params));
|
|
|
914 |
} else
|
|
|
915 |
{
|
|
|
916 |
$this->class_data->append('method_ids',$this->getId($element));
|
|
|
917 |
$this->class_data->append('methods',array('id' => $this->getId($element),
|
|
|
918 |
'sdesc' => $docblock['sdesc'],
|
|
|
919 |
'desc' => $docblock['desc'],
|
|
|
920 |
'tags' => $docblock['tags'],
|
|
|
921 |
'is_constructor' => $element->isConstructor,
|
|
|
922 |
'function_name' => $element->getName(),
|
|
|
923 |
'function_return' => $returntype,
|
|
|
924 |
'function_call' => $element->getIntricateFunctionCall($this,$params),
|
|
|
925 |
'descmethod' => $this->getFormattedDescMethods($element),
|
|
|
926 |
'method_overrides' => $this->getFormattedOverrides($element),
|
|
|
927 |
'line_number' => $element->getLineNumber(),
|
|
|
928 |
'params' => $params));
|
|
|
929 |
}
|
|
|
930 |
if (!isset($this->method_data)) $this->method_data = array();
|
|
|
931 |
$this->method_data[$i = count($this->method_data) - 1][0] = $this->newSmarty(true);
|
|
|
932 |
$this->method_data[$i][1] = $element->getName();
|
|
|
933 |
$this->method_data[$i][0]->assign('class',$this->class);
|
|
|
934 |
$this->method_data[$i][0]->assign('source_location',$this->returnSee($this->getLink(basename($this->curpage->getFile())),$this->sourceloc));
|
|
|
935 |
$this->method_data[$i][0]->assign('sdesc',$docblock['sdesc']);
|
|
|
936 |
$this->method_data[$i][0]->assign('desc',$docblock['desc']);
|
|
|
937 |
$this->method_data[$i][0]->assign('tags',$docblock['tags']);
|
|
|
938 |
$this->method_data[$i][0]->assign('function_name',$fname);
|
|
|
939 |
$this->method_data[$i][0]->assign('function_return',$returntype);
|
|
|
940 |
$this->method_data[$i][0]->assign('function_call',$element->getIntricateFunctionCall($this,$params));
|
|
|
941 |
$this->method_data[$i][0]->assign('descmethod',$this->getFormattedDescMethods($element));
|
|
|
942 |
$this->method_data[$i][0]->assign('method_overrides',$this->getFormattedOverrides($element));
|
|
|
943 |
$this->method_data[$i][0]->assign('params',$params);
|
|
|
944 |
$this->method_data[$i][0]->assign('id',$this->getId($element));
|
|
|
945 |
}
|
|
|
946 |
|
|
|
947 |
/**
|
|
|
948 |
* Converts function for template output
|
|
|
949 |
* @see prepareDocBlock(), parserFunction::getFunctionCall(), getFormattedConflicts()
|
|
|
950 |
* @param parserFunction
|
|
|
951 |
*/
|
|
|
952 |
function convertFunction(&$element)
|
|
|
953 |
{
|
|
|
954 |
parent::convertFunction($element);
|
|
|
955 |
$docblock = $this->prepareDocBlock($element);
|
|
|
956 |
$fname = $element->getName();
|
|
|
957 |
$params = array();
|
|
|
958 |
if (count($element->docblock->params))
|
|
|
959 |
foreach($element->docblock->params as $param => $val)
|
|
|
960 |
{
|
|
|
961 |
$a = $val->Convert($this);
|
|
|
962 |
$params[$param] = array("var" => $param,"datatype" => $val->converted_returnType,"data" => $a);
|
|
|
963 |
}
|
|
|
964 |
$returntype = 'void';
|
|
|
965 |
if ($element->docblock->return)
|
|
|
966 |
{
|
|
|
967 |
$a = $element->docblock->return->Convert($this);
|
|
|
968 |
$returntype = $element->docblock->return->converted_returnType;
|
|
|
969 |
}
|
|
|
970 |
|
|
|
971 |
$this->page_data->append("function_ids",$this->getId($element));
|
|
|
972 |
$this->page_summary->append("function_ids",$this->getId($element));
|
|
|
973 |
$this->page_summary->append('functions',array('id' => $this->getId($element),
|
|
|
974 |
'sdesc' => $docblock['sdesc'],
|
|
|
975 |
'desc' => $docblock['desc'],
|
|
|
976 |
'tags' => $docblock['tags'],
|
|
|
977 |
'function_name' => $element->getName(),
|
|
|
978 |
'line_number' => $element->getLineNumber(),
|
|
|
979 |
'function_return' => $returntype,
|
|
|
980 |
'function_call' => $element->getIntricateFunctionCall($this,$params),
|
|
|
981 |
'function_conflicts' => $this->getFormattedConflicts($element,'functions'),
|
|
|
982 |
'params' => $params));
|
|
|
983 |
$this->function_data[$i = count($this->function_data) - 1][0] = $this->newSmarty(true);
|
|
|
984 |
$this->function_data[$i][1] = $element->getName();
|
|
|
985 |
$this->function_data[$i][0]->assign('sdesc',$docblock['sdesc']);
|
|
|
986 |
$this->function_data[$i][0]->assign('desc',$docblock['desc']);
|
|
|
987 |
$this->function_data[$i][0]->assign('tags',$docblock['tags']);
|
|
|
988 |
$this->function_data[$i][0]->assign('function_name',$fname);
|
|
|
989 |
$this->function_data[$i][0]->assign('line_number',$element->getLineNumber());
|
|
|
990 |
$this->function_data[$i][0]->assign('function_return',$returntype);
|
|
|
991 |
$this->function_data[$i][0]->assign('function_call',$element->getIntricateFunctionCall($this,$params));
|
|
|
992 |
$this->function_data[$i][0]->assign('function_conflicts',$this->getFormattedConflicts($element,"functions"));
|
|
|
993 |
$this->function_data[$i][0]->assign('params',$params);
|
|
|
994 |
$this->function_data[$i][0]->assign('source_location',$this->returnSee($this->getLink(basename($this->curpage->getFile())),$this->sourceloc));
|
|
|
995 |
$this->function_data[$i][0]->assign('id',$this->getId($element));
|
|
|
996 |
}
|
|
|
997 |
|
|
|
998 |
/**
|
|
|
999 |
* Converts include elements for template output
|
|
|
1000 |
* @see prepareDocBlock()
|
|
|
1001 |
* @param parserInclude
|
|
|
1002 |
*/
|
|
|
1003 |
function convertInclude(&$element)
|
|
|
1004 |
{
|
|
|
1005 |
parent::convertInclude($element, array('include_file' => '-'.strtr($element->getValue(),array('"' => '', "'" => '','.' => '-'))));
|
|
|
1006 |
$this->page_summary->append('includes',array('sdesc' => $docblock['sdesc'],
|
|
|
1007 |
'desc' => $docblock['desc'],
|
|
|
1008 |
'tags' => $docblock['tags'],
|
|
|
1009 |
'utags' => $docblock['utags'],
|
|
|
1010 |
'include_name' => $element->getName(),
|
|
|
1011 |
'include_value' => $per,
|
|
|
1012 |
'line_number' => $element->getLineNumber(),
|
|
|
1013 |
'include_file' => '-'.strtr($element->getValue(),array('"' => '', "'" => '','.' => '-'))));
|
|
|
1014 |
}
|
|
|
1015 |
|
|
|
1016 |
/**
|
|
|
1017 |
* Converts defines for template output
|
|
|
1018 |
* @see prepareDocBlock(), getFormattedConflicts()
|
|
|
1019 |
* @param parserDefine
|
|
|
1020 |
*/
|
|
|
1021 |
function convertDefine(&$element)
|
|
|
1022 |
{
|
|
|
1023 |
$docblock = $this->prepareDocBlock($element);
|
|
|
1024 |
parent::convertDefine($element, array('link' => urlencode($element->getName())));
|
|
|
1025 |
$this->page_summary->append('defines',array('sdesc' => $docblock['sdesc'],
|
|
|
1026 |
'desc' => $docblock['desc'],
|
|
|
1027 |
'tags' => $docblock['tags'],
|
|
|
1028 |
'name' => $element->getName(),
|
|
|
1029 |
'value' => $element->getValue(),
|
|
|
1030 |
'conflicts' => $this->getFormattedConflicts($element,"defines"),
|
|
|
1031 |
'line_number' => $element->getLineNumber(),
|
|
|
1032 |
'id' => $this->getId($element)));
|
|
|
1033 |
}
|
|
|
1034 |
|
|
|
1035 |
/**
|
|
|
1036 |
* Converts global variables for template output
|
|
|
1037 |
* @param parserGlobal
|
|
|
1038 |
* @see prepareDocBlock(), getFormattedConflicts()
|
|
|
1039 |
*/
|
|
|
1040 |
function convertGlobal(&$element)
|
|
|
1041 |
{
|
|
|
1042 |
parent::convertGlobal($element, array('id' => $this->getId($element)));
|
|
|
1043 |
$docblock = $this->prepareDocBlock($element);
|
|
|
1044 |
$value = $this->getGlobalValue($element->getValue());
|
|
|
1045 |
$this->page_summary->append('globals',array('sdesc' => $docblock['sdesc'],
|
|
|
1046 |
'desc' => $docblock['desc'],
|
|
|
1047 |
'tags' => $docblock['tags'],
|
|
|
1048 |
'name' => $element->getName(),
|
|
|
1049 |
'link' => urlencode($element->getName()),
|
|
|
1050 |
'value' => $value,
|
|
|
1051 |
'type' => $element->getDataType($this),
|
|
|
1052 |
'line_number' => $element->getLineNumber(),
|
|
|
1053 |
'conflicts' => $this->getFormattedConflicts($element,"global variables"),
|
|
|
1054 |
'id' => $this->getId($element)));
|
|
|
1055 |
}
|
|
|
1056 |
|
|
|
1057 |
/**
|
|
|
1058 |
* converts procedural pages for template output
|
|
|
1059 |
* @see prepareDocBlock(), getClassesOnPage()
|
|
|
1060 |
* @param parserData
|
|
|
1061 |
*/
|
|
|
1062 |
function convertPage(&$element)
|
|
|
1063 |
{
|
|
|
1064 |
parent::convertPage($element);
|
|
|
1065 |
$this->juststarted = true;
|
|
|
1066 |
$this->page_dir = $element->parent->package;
|
|
|
1067 |
if (!empty($element->parent->subpackage)) $this->page_dir .= PATH_DELIMITER . $element->parent->subpackage;
|
|
|
1068 |
// registering stuff on the template
|
|
|
1069 |
$this->page_data->assign("source_location",$element->parent->getSourceLocation($this,$this->template_options['usepear']));
|
|
|
1070 |
$this->page_data->assign("function_ids",array());
|
|
|
1071 |
if ($t = $element->getTutorial())
|
|
|
1072 |
{
|
|
|
1073 |
$this->page_data->append("function_ids",$this->getId($t));
|
|
|
1074 |
}
|
|
|
1075 |
|
|
|
1076 |
$this->sourceloc = $element->parent->getSourceLocation($this,$this->template_options['usepear']);
|
|
|
1077 |
$this->page_data->assign("id", $this->getId($element));
|
|
|
1078 |
if (isset($this->template_options['separatepage']) && $this->template_options['separatepage'])
|
|
|
1079 |
{
|
|
|
1080 |
$this->page_summary = new Smarty;
|
|
|
1081 |
$this->page_summary->template_dir = $this->smarty_dir . PATH_DELIMITER . 'templates';
|
|
|
1082 |
$this->page_summary->compile_dir = $this->smarty_dir . PATH_DELIMITER . 'templates_c';
|
|
|
1083 |
$this->page_summary->config_dir = $this->smarty_dir . PATH_DELIMITER . 'configs';
|
|
|
1084 |
// registering stuff on the template
|
|
|
1085 |
$this->page_summary->assign("source_location",$element->parent->getSourceLocation($this,$this->template_options['usepear']));
|
|
|
1086 |
$this->page_summary->assign("date",date("r",time()));
|
|
|
1087 |
$this->page_summary->assign("functions",array());
|
|
|
1088 |
$this->page_summary->assign("includes",array());
|
|
|
1089 |
$this->page_summary->assign("defines",array());
|
|
|
1090 |
$this->page_summary->assign("globals",array());
|
|
|
1091 |
$this->page_summary->assign("classes",$this->getClassesOnPage($element));
|
|
|
1092 |
$this->page_summary->assign("name",$element->parent->getFile());
|
|
|
1093 |
$this->page_summary->assign("function_ids",array());
|
|
|
1094 |
if ($element->docblock)
|
|
|
1095 |
{
|
|
|
1096 |
$docblock = $this->prepareDocBlock($element, false);
|
|
|
1097 |
$this->page_summary->assign("sdesc",$docblock['sdesc']);
|
|
|
1098 |
$this->page_summary->assign("desc",$docblock['desc']);
|
|
|
1099 |
$this->page_summary->assign("tags",$docblock['tags']);
|
|
|
1100 |
$this->page_summary->assign("utags",$docblock['utags']);
|
|
|
1101 |
}
|
|
|
1102 |
$this->sourceloc = $element->parent->getSourceLocation($this,$this->template_options['usepear']);
|
|
|
1103 |
$this->page_summary->assign("name", $element->parent->getFile());
|
|
|
1104 |
$this->page_summary->assign("id", $this->getId($element).'.'.$this->getPageName($element->parent).'-summary');
|
|
|
1105 |
$this->page_data->append("function_ids",$this->getId($element).'.'.strtolower($this->getPageName($element->parent)).'-summary');
|
|
|
1106 |
}
|
|
|
1107 |
}
|
|
|
1108 |
|
|
|
1109 |
function getPageName(&$element)
|
|
|
1110 |
{
|
|
|
1111 |
return str_replace(array('/','_','.'),array('-','-','---'),$element->getSourceLocation($this,$this->template_options['usepear']));
|
|
|
1112 |
}
|
|
|
1113 |
|
|
|
1114 |
/**
|
|
|
1115 |
* returns an array containing the class inheritance tree from the root object to the class
|
|
|
1116 |
*
|
|
|
1117 |
* @param parserClass class variable
|
|
|
1118 |
* @return array Format: array(root,child,child,child,...,$class)
|
|
|
1119 |
* @uses parserClass::getParentClassTree()
|
|
|
1120 |
*/
|
|
|
1121 |
|
|
|
1122 |
function generateFormattedClassTree($class)
|
|
|
1123 |
{
|
|
|
1124 |
$tree = $class->getParentClassTree($this);
|
|
|
1125 |
$out = '';
|
|
|
1126 |
if (count($tree) - 1)
|
|
|
1127 |
{
|
|
|
1128 |
$result = array($class->getName());
|
|
|
1129 |
$parent = $tree[$class->getName()];
|
|
|
1130 |
while ($parent)
|
|
|
1131 |
{
|
|
|
1132 |
$subpackage = $parent->docblock->subpackage;
|
|
|
1133 |
$package = $parent->docblock->package;
|
|
|
1134 |
$x = $parent;
|
|
|
1135 |
if (is_object($parent))
|
|
|
1136 |
$x = $parent->getLink($this);
|
|
|
1137 |
if (!$x) $x = $parent->getName();
|
|
|
1138 |
$result[] =
|
|
|
1139 |
$x;
|
|
|
1140 |
if (is_object($parent))
|
|
|
1141 |
$parent = $tree[$parent->getName()];
|
|
|
1142 |
elseif (isset($tree[$parent]))
|
|
|
1143 |
$parent = $tree[$parent];
|
|
|
1144 |
}
|
|
|
1145 |
return array_reverse($result);
|
|
|
1146 |
} else
|
|
|
1147 |
{
|
|
|
1148 |
return array($class->getName());
|
|
|
1149 |
}
|
|
|
1150 |
}
|
|
|
1151 |
|
|
|
1152 |
/** @access private */
|
|
|
1153 |
function sortVar($a, $b)
|
|
|
1154 |
{
|
|
|
1155 |
return strnatcasecmp($a->getName(),$b->getName());
|
|
|
1156 |
}
|
|
|
1157 |
|
|
|
1158 |
/** @access private */
|
|
|
1159 |
function sortMethod($a, $b)
|
|
|
1160 |
{
|
|
|
1161 |
if ($a->isConstructor) return -1;
|
|
|
1162 |
if ($b->isConstructor) return 1;
|
|
|
1163 |
return strnatcasecmp($a->getName(),$b->getName());
|
|
|
1164 |
}
|
|
|
1165 |
|
|
|
1166 |
/**
|
|
|
1167 |
* returns a template-enabled array of class trees
|
|
|
1168 |
*
|
|
|
1169 |
* @param string $package package to generate a class tree for
|
|
|
1170 |
* @see $roots, HTMLConverter::getRootTree()
|
|
|
1171 |
*/
|
|
|
1172 |
function generateFormattedClassTrees($package)
|
|
|
1173 |
{
|
|
|
1174 |
if (!isset($this->roots[$package])) return array();
|
|
|
1175 |
$roots = $trees = array();
|
|
|
1176 |
$roots = $this->roots[$package];
|
|
|
1177 |
for($i=0;$i<count($roots);$i++)
|
|
|
1178 |
{
|
|
|
1179 |
$trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n".$this->getRootTree($this->getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n");
|
|
|
1180 |
}
|
|
|
1181 |
return $trees;
|
|
|
1182 |
}
|
|
|
1183 |
|
|
|
1184 |
/**
|
|
|
1185 |
* return formatted class tree for the Class Trees page
|
|
|
1186 |
*
|
|
|
1187 |
* @param array $tree output from {@link getSortedClassTreeFromClass()}
|
|
|
1188 |
* @see Classes::$definitechild, generateFormattedClassTrees()
|
|
|
1189 |
* @return string
|
|
|
1190 |
*/
|
|
|
1191 |
function getRootTree($tree,$package)
|
|
|
1192 |
{
|
|
|
1193 |
if (!$tree) return '';
|
|
|
1194 |
$my_tree = '';
|
|
|
1195 |
$cur = '#root';
|
|
|
1196 |
$lastcur = array(false);
|
|
|
1197 |
$kids = array();
|
|
|
1198 |
$dopar = false;
|
|
|
1199 |
if ($tree[$cur]['parent'])
|
|
|
1200 |
{
|
|
|
1201 |
$dopar = true;
|
|
|
1202 |
if (!is_object($tree[$cur]['parent']))
|
|
|
1203 |
{
|
|
|
1204 |
// debug("parent ".$tree[$cur]['parent']." not found");
|
|
|
1205 |
$my_tree .= '<listitem>' . $tree[$cur]['parent'] .'<itemizedlist>';
|
|
|
1206 |
}
|
|
|
1207 |
else
|
|
|
1208 |
{
|
|
|
1209 |
// debug("parent ".$this->returnSee($tree[$cur]['parent'], false, false)." in other package");
|
|
|
1210 |
$my_tree .= '<listitem>' . $this->returnSee($tree[$cur]['parent'], false, false);
|
|
|
1211 |
if ($tree[$cur]['parent']->package != $package) $my_tree .= ' <emphasis>(Different package)</emphasis><itemizedlist>';
|
|
|
1212 |
}
|
|
|
1213 |
}
|
|
|
1214 |
do
|
|
|
1215 |
{
|
|
|
1216 |
// fancy_debug($cur,$lastcur,$kids);
|
|
|
1217 |
if (count($tree[$cur]['children']))
|
|
|
1218 |
{
|
|
|
1219 |
// debug("$cur has children");
|
|
|
1220 |
if (!isset($kids[$cur]))
|
|
|
1221 |
{
|
|
|
1222 |
// debug("set $cur kids");
|
|
|
1223 |
$kids[$cur] = 1;
|
|
|
1224 |
$my_tree .= '<listitem>'.$this->returnSee($tree[$cur]['link'], false, false);
|
|
|
1225 |
$my_tree .= '<itemizedlist>'."\n";
|
|
|
1226 |
}
|
|
|
1227 |
array_push($lastcur,$cur);
|
|
|
1228 |
list(,$cur) = each($tree[$cur]['children']);
|
|
|
1229 |
// var_dump('listed',$cur);
|
|
|
1230 |
if ($cur)
|
|
|
1231 |
{
|
|
|
1232 |
$cur = $cur['package'] . '#' . $cur['class'];
|
|
|
1233 |
// debug("set cur to child $cur");
|
|
|
1234 |
// $my_tree .= '<li>'.$this->returnSee($tree[$cur]['link'], false, false);
|
|
|
1235 |
continue;
|
|
|
1236 |
} else
|
|
|
1237 |
{
|
|
|
1238 |
// debug("end of children for $cur");
|
|
|
1239 |
$cur = array_pop($lastcur);
|
|
|
1240 |
$cur = array_pop($lastcur);
|
|
|
1241 |
$my_tree .= '</itemizedlist></listitem>'."\n";
|
|
|
1242 |
if ($dopar && ($cur == '#root' || !$cur)) $my_tree .= '</itemizedlist></listitem>';
|
|
|
1243 |
}
|
|
|
1244 |
} else
|
|
|
1245 |
{
|
|
|
1246 |
// debug("$cur has no children");
|
|
|
1247 |
$my_tree .= '<listitem>'.$this->returnSee($tree[$cur]['link'], false, false)."</listitem>";
|
|
|
1248 |
if ($dopar && $cur == '#root') $my_tree .= '</itemizedlist></listitem>';
|
|
|
1249 |
$cur = array_pop($lastcur);
|
|
|
1250 |
}
|
|
|
1251 |
} while ($cur);
|
|
|
1252 |
return $my_tree;
|
|
|
1253 |
}
|
|
|
1254 |
/**
|
|
|
1255 |
* Generate alphabetical index of all elements
|
|
|
1256 |
*
|
|
|
1257 |
* @see $elements, walk()
|
|
|
1258 |
*/
|
|
|
1259 |
function generateElementIndex()
|
|
|
1260 |
{
|
|
|
1261 |
$elementindex = array();
|
|
|
1262 |
$letters = array();
|
|
|
1263 |
$i = 0;
|
|
|
1264 |
foreach($this->elements as $letter => $nutoh)
|
|
|
1265 |
{
|
|
|
1266 |
$letters[]['letter'] = $letter;
|
|
|
1267 |
$elindex['letter'] = $letter;
|
|
|
1268 |
foreach($this->elements[$letter] as $i => $yuh)
|
|
|
1269 |
{
|
|
|
1270 |
switch($this->elements[$letter][$i]->type)
|
|
|
1271 |
{
|
|
|
1272 |
case 'class':
|
|
|
1273 |
$aa = '';
|
|
|
1274 |
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
|
|
|
1275 |
$oo['name'] = $this->elements[$letter][$i]->getName();
|
|
|
1276 |
$oo['listing'] =
|
|
|
1277 |
'in file '.$this->elements[$letter][$i]->file.', class '.$this->getClassLink($this->elements[$letter][$i]->getName(),
|
|
|
1278 |
$this->elements[$letter][$i]->docblock->package,
|
|
|
1279 |
$this->elements[$letter][$i]->getPath(),
|
|
|
1280 |
$this->elements[$letter][$i]->getName()
|
|
|
1281 |
, false
|
|
|
1282 |
, true);
|
|
|
1283 |
$oo['sdesc'] = "$aa";
|
|
|
1284 |
$elindex['index'][] = $oo;
|
|
|
1285 |
break;
|
|
|
1286 |
case 'define':
|
|
|
1287 |
$aa = '';
|
|
|
1288 |
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
|
|
|
1289 |
$oo['name'] = $this->elements[$letter][$i]->getName();
|
|
|
1290 |
$oo['listing'] =
|
|
|
1291 |
'in file '.$this->elements[$letter][$i]->file.', constant '.$this->getDefineLink($this->elements[$letter][$i]->getName(),
|
|
|
1292 |
$this->elements[$letter][$i]->docblock->package,
|
|
|
1293 |
$this->elements[$letter][$i]->getPath(),
|
|
|
1294 |
$this->elements[$letter][$i]->getName()
|
|
|
1295 |
, false);
|
|
|
1296 |
$oo['sdesc'] = "$aa";
|
|
|
1297 |
$elindex['index'][] = $oo;
|
|
|
1298 |
break;
|
|
|
1299 |
case 'global':
|
|
|
1300 |
$aa = '';
|
|
|
1301 |
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
|
|
|
1302 |
$oo['name'] = $this->elements[$letter][$i]->getName();
|
|
|
1303 |
$oo['listing'] =
|
|
|
1304 |
'in file '.$this->elements[$letter][$i]->file.', global variable '.$this->getGlobalLink($this->elements[$letter][$i]->getName(),
|
|
|
1305 |
$this->elements[$letter][$i]->docblock->package,
|
|
|
1306 |
$this->elements[$letter][$i]->getPath(),
|
|
|
1307 |
$this->elements[$letter][$i]->getName()
|
|
|
1308 |
, false);
|
|
|
1309 |
$oo['sdesc'] = "$aa";
|
|
|
1310 |
$elindex['index'][] = $oo;
|
|
|
1311 |
break;
|
|
|
1312 |
case 'function':
|
|
|
1313 |
$aa = '';
|
|
|
1314 |
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
|
|
|
1315 |
$oo['name'] = $this->elements[$letter][$i]->getName();
|
|
|
1316 |
$oo['listing'] =
|
|
|
1317 |
'in file '.$this->elements[$letter][$i]->file.', function '.$this->getFunctionLink($this->elements[$letter][$i]->getName(),
|
|
|
1318 |
$this->elements[$letter][$i]->docblock->package,
|
|
|
1319 |
$this->elements[$letter][$i]->getPath(),
|
|
|
1320 |
$this->elements[$letter][$i]->getName().'()'
|
|
|
1321 |
, false);
|
|
|
1322 |
$oo['sdesc'] = "$aa";
|
|
|
1323 |
$elindex['index'][] = $oo;
|
|
|
1324 |
break;
|
|
|
1325 |
case 'method':
|
|
|
1326 |
$aa = '';
|
|
|
1327 |
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
|
|
|
1328 |
$oo['name'] = $this->elements[$letter][$i]->getName();
|
|
|
1329 |
$oo['listing'] =
|
|
|
1330 |
'in file '.$this->elements[$letter][$i]->file.', method '.$this->getMethodLink($this->elements[$letter][$i]->getName(),
|
|
|
1331 |
$this->elements[$letter][$i]->class,
|
|
|
1332 |
$this->elements[$letter][$i]->docblock->package,
|
|
|
1333 |
$this->elements[$letter][$i]->getPath(),
|
|
|
1334 |
$this->elements[$letter][$i]->class.'::'.$this->elements[$letter][$i]->getName().'()'
|
|
|
1335 |
, false);
|
|
|
1336 |
$oo['sdesc'] = "$aa";
|
|
|
1337 |
$elindex['index'][] = $oo;
|
|
|
1338 |
break;
|
|
|
1339 |
case 'var':
|
|
|
1340 |
$aa = '';
|
|
|
1341 |
$aa = $this->elements[$letter][$i]->docblock->getSDesc($this);
|
|
|
1342 |
$oo['name'] = $this->elements[$letter][$i]->getName();
|
|
|
1343 |
$oo['listing'] =
|
|
|
1344 |
'in file '.$this->elements[$letter][$i]->file.', variable '.$this->getVarLink($this->elements[$letter][$i]->getName(),
|
|
|
1345 |
$this->elements[$letter][$i]->class,
|
|
|
1346 |
$this->elements[$letter][$i]->docblock->package,
|
|
|
1347 |
$this->elements[$letter][$i]->getPath(),
|
|
|
1348 |
$this->elements[$letter][$i]->class.'::'.$this->elements[$letter][$i]->getName()
|
|
|
1349 |
, false);
|
|
|
1350 |
$oo['sdesc'] = "$aa";
|
|
|
1351 |
$elindex['index'][] = $oo;
|
|
|
1352 |
break;
|
|
|
1353 |
case 'page':
|
|
|
1354 |
$oo['name'] = $this->elements[$letter][$i]->getFile();
|
|
|
1355 |
$oo['listing'] =
|
|
|
1356 |
'procedural page '.$this->getPageLink($this->elements[$letter][$i]->getFile(),
|
|
|
1357 |
$this->elements[$letter][$i]->package,
|
|
|
1358 |
$this->elements[$letter][$i]->getPath(),
|
|
|
1359 |
$this->elements[$letter][$i]->getFile()
|
|
|
1360 |
, false);
|
|
|
1361 |
$elindex['index'][] = $oo;
|
|
|
1362 |
break;
|
|
|
1363 |
}
|
|
|
1364 |
}
|
|
|
1365 |
if (isset($elindex['index']))
|
|
|
1366 |
{
|
|
|
1367 |
$elementindex[] = $elindex;
|
|
|
1368 |
} else
|
|
|
1369 |
{
|
|
|
1370 |
unset($letters[count($letters) - 1]);
|
|
|
1371 |
}
|
|
|
1372 |
$elindex = array();
|
|
|
1373 |
}
|
|
|
1374 |
return array($elementindex,$letters);
|
|
|
1375 |
}
|
|
|
1376 |
|
|
|
1377 |
function setTemplateDir($dir)
|
|
|
1378 |
{
|
|
|
1379 |
Converter::setTemplateDir($dir);
|
|
|
1380 |
$this->smarty_dir = $this->templateDir;
|
|
|
1381 |
}
|
|
|
1382 |
|
|
|
1383 |
/**
|
|
|
1384 |
* calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
|
|
|
1385 |
* @see Converter::setTargetDir()
|
|
|
1386 |
*/
|
|
|
1387 |
function setTargetDir($dir)
|
|
|
1388 |
{
|
|
|
1389 |
Converter::setTargetDir($dir);
|
|
|
1390 |
static $wrote = false;
|
|
|
1391 |
if ($wrote) return;
|
|
|
1392 |
$wrote = true;
|
|
|
1393 |
$template_images = array();
|
|
|
1394 |
$stylesheets = array();
|
|
|
1395 |
$dir = $this->templateDir;
|
|
|
1396 |
$this->templateDir = $this->templateDir.'templates/';
|
|
|
1397 |
$d = dir($this->templateDir);
|
|
|
1398 |
$template_images = array();
|
|
|
1399 |
while($entry = $d->read())
|
|
|
1400 |
{
|
|
|
1401 |
$sp = explode(".", $entry);
|
|
|
1402 |
if ( preg_match("/\.(gif|jpg|png)$/i", $entry) )
|
|
|
1403 |
{
|
|
|
1404 |
$template_images[] = $entry;
|
|
|
1405 |
}
|
|
|
1406 |
}
|
|
|
1407 |
$d = dir($this->templateDir);
|
|
|
1408 |
while($entry = $d->read())
|
|
|
1409 |
{
|
|
|
1410 |
$sp = explode(".", $entry);
|
|
|
1411 |
if ( preg_match("/\.css$/i", $entry) )
|
|
|
1412 |
{
|
|
|
1413 |
$stylesheets[] = $entry;
|
|
|
1414 |
}
|
|
|
1415 |
}
|
|
|
1416 |
phpDocumentor_out("Copying Any Stylesheets\n");
|
|
|
1417 |
flush();
|
|
|
1418 |
foreach($stylesheets as $image)
|
|
|
1419 |
{
|
|
|
1420 |
if (file_exists($this->templateDir.$image))
|
|
|
1421 |
{
|
|
|
1422 |
phpDocumentor_out("Writing $image\n");
|
|
|
1423 |
flush();
|
|
|
1424 |
$this->copyFile($image);
|
|
|
1425 |
}
|
|
|
1426 |
}
|
|
|
1427 |
phpDocumentor_out("Copying Any Template Images\n");
|
|
|
1428 |
flush();
|
|
|
1429 |
foreach($template_images as $image)
|
|
|
1430 |
{
|
|
|
1431 |
if (file_exists($this->templateDir.$image))
|
|
|
1432 |
{
|
|
|
1433 |
phpDocumentor_out("Writing $image\n");
|
|
|
1434 |
flush();
|
|
|
1435 |
$this->copyFile($image);
|
|
|
1436 |
}
|
|
|
1437 |
}
|
|
|
1438 |
$this->templateDir = $dir;
|
|
|
1439 |
}
|
|
|
1440 |
|
|
|
1441 |
/**
|
|
|
1442 |
* Generate alphabetical index of all elements by package and subpackage
|
|
|
1443 |
*
|
|
|
1444 |
* @param string $package name of a package
|
|
|
1445 |
* @see $pkg_elements, walk(), generatePkgElementIndexes()
|
|
|
1446 |
*/
|
|
|
1447 |
function generatePkgElementIndex($package)
|
|
|
1448 |
{
|
|
|
1449 |
$elementindex = array();
|
|
|
1450 |
$letters = array();
|
|
|
1451 |
$letterind = array();
|
|
|
1452 |
$used = array();
|
|
|
1453 |
$subp = '';
|
|
|
1454 |
foreach($this->pkg_elements[$package] as $subpackage => $els)
|
|
|
1455 |
{
|
|
|
1456 |
if (empty($els)) continue;
|
|
|
1457 |
foreach($els as $letter => $yuh)
|
|
|
1458 |
{
|
|
|
1459 |
if (!isset($used[$letter]))
|
|
|
1460 |
{
|
|
|
1461 |
$letters[]['letter'] = $letter;
|
|
|
1462 |
$letterind[$letter] = count($letters) - 1;
|
|
|
1463 |
$used[$letter] = 1;
|
|
|
1464 |
}
|
|
|
1465 |
$elindex[$letter]['letter'] = $letter;
|
|
|
1466 |
foreach($els[$letter] as $i => $yuh)
|
|
|
1467 |
{
|
|
|
1468 |
switch($els[$letter][$i]->type)
|
|
|
1469 |
{
|
|
|
1470 |
case 'class':
|
|
|
1471 |
$aa = '';
|
|
|
1472 |
$aa = $els[$letter][$i]->docblock->getSDesc($this);
|
|
|
1473 |
$oo['name'] = $els[$letter][$i]->getName();
|
|
|
1474 |
$oo['listing'] =
|
|
|
1475 |
'in file '.$els[$letter][$i]->file.', class '.$this->getClassLink($els[$letter][$i]->getName(),
|
|
|
1476 |
$els[$letter][$i]->docblock->package,
|
|
|
1477 |
$els[$letter][$i]->getPath(),
|
|
|
1478 |
$els[$letter][$i]->getName()
|
|
|
1479 |
, false
|
|
|
1480 |
, true);
|
|
|
1481 |
$oo['subpackage'] = $subpackage;
|
|
|
1482 |
$oo['sdesc'] = $aa;
|
|
|
1483 |
$elindex[$letter]['index'][] = $oo;
|
|
|
1484 |
break;
|
|
|
1485 |
case 'define':
|
|
|
1486 |
$aa = $els[$letter][$i]->docblock->getSDesc($this);
|
|
|
1487 |
$oo['name'] = $els[$letter][$i]->getName();
|
|
|
1488 |
$oo['listing'] =
|
|
|
1489 |
'in file '.$els[$letter][$i]->file.', constant '.$this->getDefineLink($els[$letter][$i]->getName(),
|
|
|
1490 |
$els[$letter][$i]->docblock->package,
|
|
|
1491 |
$els[$letter][$i]->getPath(),
|
|
|
1492 |
$els[$letter][$i]->getName()
|
|
|
1493 |
, false);
|
|
|
1494 |
$oo['subpackage'] = $subpackage;
|
|
|
1495 |
$oo['sdesc'] = $aa;
|
|
|
1496 |
$elindex[$letter]['index'][] = $oo;
|
|
|
1497 |
break;
|
|
|
1498 |
case 'global':
|
|
|
1499 |
$aa = $els[$letter][$i]->docblock->getSDesc($this);
|
|
|
1500 |
$oo['name'] = $els[$letter][$i]->getName();
|
|
|
1501 |
$oo['listing'] =
|
|
|
1502 |
'in file '.$els[$letter][$i]->file.', global variable '.$this->getGlobalLink($els[$letter][$i]->getName(),
|
|
|
1503 |
$els[$letter][$i]->docblock->package,
|
|
|
1504 |
$els[$letter][$i]->getPath(),
|
|
|
1505 |
$els[$letter][$i]->getName()
|
|
|
1506 |
,false);
|
|
|
1507 |
$oo['subpackage'] = $subpackage;
|
|
|
1508 |
$oo['sdesc'] = $aa;
|
|
|
1509 |
$elindex[$letter]['index'][] = $oo;
|
|
|
1510 |
break;
|
|
|
1511 |
case 'function':
|
|
|
1512 |
$aa = $els[$letter][$i]->docblock->getSDesc($this);
|
|
|
1513 |
$oo['name'] = $els[$letter][$i]->getName();
|
|
|
1514 |
$oo['listing'] =
|
|
|
1515 |
'in file '.$els[$letter][$i]->file.', function '.$this->getFunctionLink($els[$letter][$i]->getName(),
|
|
|
1516 |
$els[$letter][$i]->docblock->package,
|
|
|
1517 |
$els[$letter][$i]->getPath(),
|
|
|
1518 |
$els[$letter][$i]->getName().'()'
|
|
|
1519 |
, false);
|
|
|
1520 |
$oo['subpackage'] = $subpackage;
|
|
|
1521 |
$oo['sdesc'] = $aa;
|
|
|
1522 |
$elindex[$letter]['index'][] = $oo;
|
|
|
1523 |
break;
|
|
|
1524 |
case 'method':
|
|
|
1525 |
$aa = $els[$letter][$i]->docblock->getSDesc($this);
|
|
|
1526 |
$oo['name'] = $els[$letter][$i]->getName();
|
|
|
1527 |
$oo['listing'] =
|
|
|
1528 |
'in file '.$els[$letter][$i]->file.', method '.$this->getMethodLink($els[$letter][$i]->getName(),
|
|
|
1529 |
$els[$letter][$i]->class,
|
|
|
1530 |
$els[$letter][$i]->docblock->package,
|
|
|
1531 |
$els[$letter][$i]->getPath(),
|
|
|
1532 |
$els[$letter][$i]->class.'::'.$els[$letter][$i]->getName().'()'
|
|
|
1533 |
, false);
|
|
|
1534 |
$oo['subpackage'] = $subpackage;
|
|
|
1535 |
$oo['sdesc'] = $aa;
|
|
|
1536 |
$elindex[$letter]['index'][] = $oo;
|
|
|
1537 |
break;
|
|
|
1538 |
case 'var':
|
|
|
1539 |
$aa = $els[$letter][$i]->docblock->getSDesc($this);
|
|
|
1540 |
$oo['name'] = $els[$letter][$i]->getName();
|
|
|
1541 |
$oo['listing'] =
|
|
|
1542 |
'in file '.$els[$letter][$i]->file.', variable '.$this->getVarLink($els[$letter][$i]->getName(),
|
|
|
1543 |
$els[$letter][$i]->class,
|
|
|
1544 |
$els[$letter][$i]->docblock->package,
|
|
|
1545 |
$els[$letter][$i]->getPath(),
|
|
|
1546 |
$els[$letter][$i]->class.'::'.$els[$letter][$i]->getName()
|
|
|
1547 |
, false);
|
|
|
1548 |
$oo['subpackage'] = $subpackage;
|
|
|
1549 |
$oo['sdesc'] = $aa;
|
|
|
1550 |
$elindex[$letter]['index'][] = $oo;
|
|
|
1551 |
break;
|
|
|
1552 |
case 'page':
|
|
|
1553 |
$oo['name'] = $els[$letter][$i]->getFile();
|
|
|
1554 |
$oo['listing'] =
|
|
|
1555 |
'procedural page '.$this->getPageLink($els[$letter][$i]->getFile(),
|
|
|
1556 |
$els[$letter][$i]->package,
|
|
|
1557 |
$els[$letter][$i]->getPath(),
|
|
|
1558 |
$els[$letter][$i]->getFile()
|
|
|
1559 |
, false);
|
|
|
1560 |
$oo['subpackage'] = $subpackage;
|
|
|
1561 |
$elindex[$letter]['index'][] = $oo;
|
|
|
1562 |
break;
|
|
|
1563 |
}
|
|
|
1564 |
}
|
|
|
1565 |
}
|
|
|
1566 |
}
|
|
|
1567 |
ksort($elindex);
|
|
|
1568 |
usort($letters,'XMLDocBook_lettersort');
|
|
|
1569 |
if (isset($elindex))
|
|
|
1570 |
{
|
|
|
1571 |
while(list($letter,$tempel) = each($elindex))
|
|
|
1572 |
{
|
|
|
1573 |
if (!isset($tempel))
|
|
|
1574 |
{
|
|
|
1575 |
unset($letters[$letterind[$tempel['letter']]]);
|
|
|
1576 |
} else
|
|
|
1577 |
$elementindex[] = $tempel;
|
|
|
1578 |
}
|
|
|
1579 |
} else $letters = array();
|
|
|
1580 |
return array($elementindex,$letters);
|
|
|
1581 |
}
|
|
|
1582 |
|
|
|
1583 |
/**
|
|
|
1584 |
*
|
|
|
1585 |
* @see generatePkgElementIndex()
|
|
|
1586 |
*/
|
|
|
1587 |
function generatePkgElementIndexes()
|
|
|
1588 |
{
|
|
|
1589 |
$packages = array();
|
|
|
1590 |
$package_names = array();
|
|
|
1591 |
$pkg = array();
|
|
|
1592 |
$letters = array();
|
|
|
1593 |
foreach($this->pkg_elements as $package => $trash)
|
|
|
1594 |
{
|
|
|
1595 |
$pkgs['package'] = $package;
|
|
|
1596 |
$pkg['package'] = $package;
|
|
|
1597 |
list($pkg['pindex'],$letters[$package]) = $this->generatePkgElementIndex($package);
|
|
|
1598 |
if (count($pkg['pindex']))
|
|
|
1599 |
{
|
|
|
1600 |
$packages[] = $pkg;
|
|
|
1601 |
$package_names[] = $pkgs;
|
|
|
1602 |
}
|
|
|
1603 |
unset($pkgs);
|
|
|
1604 |
unset($pkg);
|
|
|
1605 |
}
|
|
|
1606 |
foreach($packages as $i => $package)
|
|
|
1607 |
{
|
|
|
1608 |
$pnames = array();
|
|
|
1609 |
for($j=0;$j<count($package_names);$j++)
|
|
|
1610 |
{
|
|
|
1611 |
if ($package_names[$j]['package'] != $package['package']) $pnames[] = $package_names[$j];
|
|
|
1612 |
}
|
|
|
1613 |
$packages[$i]['packageindexes'] = $pnames;
|
|
|
1614 |
}
|
|
|
1615 |
return array($packages,$package_names,$letters);
|
|
|
1616 |
}
|
|
|
1617 |
|
|
|
1618 |
/**
|
|
|
1619 |
* @param string name of class
|
|
|
1620 |
* @param string package name
|
|
|
1621 |
* @param string full path to look in (used in index generation)
|
|
|
1622 |
* @param boolean deprecated
|
|
|
1623 |
* @param boolean return just the URL, or enclose it in an html a tag
|
|
|
1624 |
* @return mixed false if not found, or an html a link to the class's documentation
|
|
|
1625 |
* @see parent::getClassLink()
|
|
|
1626 |
*/
|
|
|
1627 |
function getClassLink($expr,$package, $file = false,$text = false, $local = true, $with_a = true)
|
|
|
1628 |
{
|
|
|
1629 |
$a = Converter::getClassLink($expr,$package,$file);
|
|
|
1630 |
if (!$a) return false;
|
|
|
1631 |
return $this->returnSee($a, $text, $local, $with_a);
|
|
|
1632 |
}
|
|
|
1633 |
|
|
|
1634 |
/**
|
|
|
1635 |
* @param string name of function
|
|
|
1636 |
* @param string package name
|
|
|
1637 |
* @param string full path to look in (used in index generation)
|
|
|
1638 |
* @param boolean deprecated
|
|
|
1639 |
* @param boolean return just the URL, or enclose it in an html a tag
|
|
|
1640 |
* @return mixed false if not found, or an html a link to the function's documentation
|
|
|
1641 |
* @see parent::getFunctionLink()
|
|
|
1642 |
*/
|
|
|
1643 |
function getFunctionLink($expr,$package, $file = false,$text = false, $local = true)
|
|
|
1644 |
{
|
|
|
1645 |
$a = Converter::getFunctionLink($expr,$package,$file);
|
|
|
1646 |
if (!$a) return false;
|
|
|
1647 |
return $this->returnSee($a, $text, $local);
|
|
|
1648 |
}
|
|
|
1649 |
|
|
|
1650 |
/**
|
|
|
1651 |
* @param string name of define
|
|
|
1652 |
* @param string package name
|
|
|
1653 |
* @param string full path to look in (used in index generation)
|
|
|
1654 |
* @param boolean deprecated
|
|
|
1655 |
* @param boolean return just the URL, or enclose it in an html a tag
|
|
|
1656 |
* @return mixed false if not found, or an html a link to the define's documentation
|
|
|
1657 |
* @see parent::getDefineLink()
|
|
|
1658 |
*/
|
|
|
1659 |
function getDefineLink($expr,$package, $file = false,$text = false, $local = true)
|
|
|
1660 |
{
|
|
|
1661 |
$a = Converter::getDefineLink($expr,$package,$file);
|
|
|
1662 |
if (!$a) return false;
|
|
|
1663 |
return $this->returnSee($a, $text, $local);
|
|
|
1664 |
}
|
|
|
1665 |
|
|
|
1666 |
/**
|
|
|
1667 |
* @param string name of global variable
|
|
|
1668 |
* @param string package name
|
|
|
1669 |
* @param string full path to look in (used in index generation)
|
|
|
1670 |
* @param boolean deprecated
|
|
|
1671 |
* @param boolean return just the URL, or enclose it in an html a tag
|
|
|
1672 |
* @return mixed false if not found, or an html a link to the global variable's documentation
|
|
|
1673 |
* @see parent::getGlobalLink()
|
|
|
1674 |
*/
|
|
|
1675 |
function getGlobalLink($expr,$package, $file = false,$text = false, $local = true)
|
|
|
1676 |
{
|
|
|
1677 |
$a = Converter::getGlobalLink($expr,$package,$file);
|
|
|
1678 |
if (!$a) return false;
|
|
|
1679 |
return $this->returnSee($a, $text, $local);
|
|
|
1680 |
}
|
|
|
1681 |
|
|
|
1682 |
/**
|
|
|
1683 |
* @param string name of procedural page
|
|
|
1684 |
* @param string package name
|
|
|
1685 |
* @param string full path to look in (used in index generation)
|
|
|
1686 |
* @param boolean deprecated
|
|
|
1687 |
* @param boolean return just the URL, or enclose it in an html a tag
|
|
|
1688 |
* @return mixed false if not found, or an html a link to the procedural page's documentation
|
|
|
1689 |
* @see parent::getPageLink()
|
|
|
1690 |
*/
|
|
|
1691 |
function getPageLink($expr,$package, $path = false,$text = false, $local = true)
|
|
|
1692 |
{
|
|
|
1693 |
$a = Converter::getPageLink($expr,$package,$path);
|
|
|
1694 |
if (!$a) return false;
|
|
|
1695 |
return $this->returnSee($a, $text, $local);
|
|
|
1696 |
}
|
|
|
1697 |
|
|
|
1698 |
/**
|
|
|
1699 |
* @param string name of method
|
|
|
1700 |
* @param string class containing method
|
|
|
1701 |
* @param string package name
|
|
|
1702 |
* @param string full path to look in (used in index generation)
|
|
|
1703 |
* @param boolean deprecated
|
|
|
1704 |
* @param boolean return just the URL, or enclose it in an html a tag
|
|
|
1705 |
* @return mixed false if not found, or an html a link to the method's documentation
|
|
|
1706 |
* @see parent::getMethodLink()
|
|
|
1707 |
*/
|
|
|
1708 |
function getMethodLink($expr,$class,$package, $file = false,$text = false, $local = true)
|
|
|
1709 |
{
|
|
|
1710 |
$a = Converter::getMethodLink($expr,$class,$package,$file);
|
|
|
1711 |
if (!$a) return false;
|
|
|
1712 |
return $this->returnSee($a, $text, $local);
|
|
|
1713 |
}
|
|
|
1714 |
|
|
|
1715 |
/**
|
|
|
1716 |
* @param string name of var
|
|
|
1717 |
* @param string class containing var
|
|
|
1718 |
* @param string package name
|
|
|
1719 |
* @param string full path to look in (used in index generation)
|
|
|
1720 |
* @param boolean deprecated
|
|
|
1721 |
* @param boolean return just the URL, or enclose it in an html a tag
|
|
|
1722 |
* @return mixed false if not found, or an html a link to the var's documentation
|
|
|
1723 |
* @see parent::getVarLink()
|
|
|
1724 |
*/
|
|
|
1725 |
function getVarLink($expr,$class,$package, $file = false,$text = false, $local = true)
|
|
|
1726 |
{
|
|
|
1727 |
$a = Converter::getVarLink($expr,$class,$package,$file);
|
|
|
1728 |
if (!$a) return false;
|
|
|
1729 |
return $this->returnSee($a, $text, $local);
|
|
|
1730 |
}
|
|
|
1731 |
|
|
|
1732 |
/**
|
|
|
1733 |
* does a nat case sort on the specified second level value of the array
|
|
|
1734 |
*
|
|
|
1735 |
* @param mixed $a
|
|
|
1736 |
* @param mixed $b
|
|
|
1737 |
* @return int
|
|
|
1738 |
*/
|
|
|
1739 |
function rcNatCmp ($a, $b)
|
|
|
1740 |
{
|
|
|
1741 |
$aa = strtoupper($a[$this->rcnatcmpkey]);
|
|
|
1742 |
$bb = strtoupper($b[$this->rcnatcmpkey]);
|
|
|
1743 |
|
|
|
1744 |
return strnatcasecmp($aa, $bb);
|
|
|
1745 |
}
|
|
|
1746 |
|
|
|
1747 |
/**
|
|
|
1748 |
* does a nat case sort on the specified second level value of the array.
|
|
|
1749 |
* this one puts constructors first
|
|
|
1750 |
*
|
|
|
1751 |
* @param mixed $a
|
|
|
1752 |
* @param mixed $b
|
|
|
1753 |
* @return int
|
|
|
1754 |
*/
|
|
|
1755 |
function rcNatCmp1 ($a, $b)
|
|
|
1756 |
{
|
|
|
1757 |
$aa = strtoupper($a[$this->rcnatcmpkey]);
|
|
|
1758 |
$bb = strtoupper($b[$this->rcnatcmpkey]);
|
|
|
1759 |
|
|
|
1760 |
if (strpos($aa,'CONSTRUCTOR') === 0)
|
|
|
1761 |
{
|
|
|
1762 |
return -1;
|
|
|
1763 |
}
|
|
|
1764 |
if (strpos($bb,'CONSTRUCTOR') === 0)
|
|
|
1765 |
{
|
|
|
1766 |
return 1;
|
|
|
1767 |
}
|
|
|
1768 |
if (strpos($aa,strtoupper($this->class)) === 0)
|
|
|
1769 |
{
|
|
|
1770 |
return -1;
|
|
|
1771 |
}
|
|
|
1772 |
if (strpos($bb,strtoupper($this->class)) === 0)
|
|
|
1773 |
{
|
|
|
1774 |
return -1;
|
|
|
1775 |
}
|
|
|
1776 |
return strnatcasecmp($aa, $bb);
|
|
|
1777 |
}
|
|
|
1778 |
|
|
|
1779 |
/**
|
|
|
1780 |
* This function is not used by HTMLdefaultConverter, but is required by Converter
|
|
|
1781 |
*/
|
|
|
1782 |
function Output()
|
|
|
1783 |
{
|
|
|
1784 |
}
|
|
|
1785 |
}
|
|
|
1786 |
|
|
|
1787 |
/** @access private */
|
|
|
1788 |
function XMLDocBook_lettersort($a, $b)
|
|
|
1789 |
{
|
|
|
1790 |
return strnatcasecmp($a['letter'],$b['letter']);
|
|
|
1791 |
}
|
|
|
1792 |
?>
|