1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
|
<?php
/**
* Parser Data Structures
*
* phpDocumentor :: automatic documentation generator
*
* PHP versions 4 and 5
*
* Copyright (c) 2002-2008 Gregory Beaver
*
* LICENSE:
*
* This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation;
* either version 2.1 of the License, or (at your option) any
* later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @category ToolsAndUtilities
* @package phpDocumentor
* @subpackage ParserData
* @author Gregory Beaver <cellog@php.net>
* @copyright 2002-2008 Gregory Beaver
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @version CVS: $Id: ParserData.inc 253814 2008-02-26 12:15:56Z ashnazg $
* @link http://www.phpdoc.org
* @link http://pear.php.net/PhpDocumentor
* @since 1.0rc1
* @todo CS cleanup - change package to PhpDocumentor
*/
/**
* Contains information about a PHP file, used to group procedural elements
* together.
*
* @category ToolsAndUtilities
* @package phpDocumentor
* @subpackage ParserData
* @author Gregory Beaver <cellog@php.net>
* @copyright 2002-2008 Gregory Beaver
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @version Release: 1.4.3
* @filesource
* @link http://www.phpdoc.org
* @link http://pear.php.net/PhpDocumentor
* @since 1.0rc1
* @todo CS cleanup - change package to PhpDocumentor
* @todo CS cleanup - change classname to PhpDocumentor_*
*/
class parserPage
{
/**
* Type is used by many functions to skip the hassle of if
* <code>phpDocumentor_get_class($blah) == 'parserBlah'</code>
* @var string
*/
var $type = 'page';
/**
* not implemented in this version, will be used to link xml output pages
* @var string
*/
var $id = '';
/**
* filename.ext (no path)
* @var string
*/
var $file = '';
/**
* relative source location
* @var string
*/
var $sourceLocation = '';
/**
* phpdoc-safe name (only letters, numbers and _)
* @var string
*/
var $name = '';
/**
* original phpdoc-safe name (only letters, numbers and _)
*
* This fixes [ 1391432 ] Too many underscores in include links.
* @var string
*/
var $origName = '';
/**
* @var string
*/
var $category = 'default';
/**
* @var string
*/
var $package = 'default';
/**
* @var string
*/
var $subpackage = '';
/**
* @var string
*/
var $parserVersion = PHPDOCUMENTOR_VER;
/**
* not implemented yet
* file modification date, will be used for makefiles
* @var string
*/
var $modDate = '';
/**
* @var string full path this page represents
*/
var $path = '';
/**
* Tokenized source code of the file
* @var array
*/
var $source = array();
/**
* Used to limit output, contains contents of --packageoutput commandline.
* Does not increase parsing time. Use --ignore for that
* @see phpDocumentor_IntermediateParser::$packageoutput,
* Converter::$package_output
* @var mixed either false or an array of packages
*/
var $packageOutput = false;
/**
* sets package to default package
*
* @global string default package name
*/
function parserPage()
{
global $phpDocumentor_DefaultPackageName;
$this->package = $GLOBALS['phpDocumentor_DefaultPackageName'];
}
/**
* gets the tag type
*
* @return string always "page"
*/
function getType()
{
return 'page';
}
/**
* Sets the source code of the file for highlighting.
*
* PHP 4.3.0+ passes an array of tokenizer tokens by line number. PHP
* 4.2.3- passes a string to be passed to {@link highlight_string()}
*
* @param string|array $source the token array/string
*
* @return void
*/
function setSource($source)
{
$this->source = $source;
}
/**
* Sets the name to display in documentation (can be an alias set with @name)
*
* @param string $file the file name
*
* @return void
*/
function setFile($file)
{
$this->file = $file;
}
/**
* gets the file name
*
* @return string|bool filename.ext or @name alias,
* or FALSE if it's not set
*/
function getFile()
{
if (!isset($this->file)) {
return false;
}
return $this->file;
}
/**
* sets the path to the file
*
* @param string $path full path to file
*
* @return void
*/
function setPath($path)
{
// look for special windows case
if (SMART_PATH_DELIMITER === '\\') {
$this->path = strtr($path, '/', '\\');
} else {
$this->path = $path;
}
}
/**
* gets the path
*
* @return string fully delimited path (OS-dependent format),
* or FALSE if it's not set
*/
function getPath()
{
if (!isset($this->path)) {
return false;
}
return $this->path;
}
/**
* loads the package output array
*
* @param array $packages array of packages to display in documentation
* (package1,package2,...)
*
* @return void
* @see phpDocumentor_IntermediateParser::$packageoutput
*/
function setPackageOutput($packages)
{
$this->packageOutput = $packages;
}
/**
* gets the package output array
*
* @return array array of packages (package1,package2,...)
* @see phpDocumentor_IntermediateParser::$packageoutput
*/
function getPackageOutput()
{
return $this->packageOutput;
}
/**
* sets the name
*
* @param string $name phpdoc-safe name (only _, numbers and letters)
* set by Parser::parse()
*
* @return void
* @see Parser::parse()
*/
function setName($name)
{
$this->origName = $name;
$this->name = $name;
}
/**
* gets the name
*
* @return string phpdoc-safe name (only _, numbers and letters),
* or FALSE if it's not set
*/
function getName()
{
if (!isset($this->name)) {
return false;
}
return $this->name;
}
/**
* sets the source location
*
* @param string $source path of this file relative to program root
*
* @return void
*/
function setSourceLocation($source)
{
$this->sourceLocation = $source;
}
/**
* gets the source location
*
* @param Converter $c the output converter
* @param bool $pearize if this parameter is true,
* it will truncate the source location
* to the subdirectory of pear
*
* @return string path of this file relative to program root
* @todo determine if the str_replace in the 'pear/' ELSE branch should be
* removed (see Documentation/tests/bug1574043.php). It does NOT exist
* in the similar function parserClass->getSourceLocation() in
* ParserElements.inc.
*/
function getSourceLocation ($c, $pearize = false)
{
global $_phpDocumentor_options;
if (!isset($this->sourceLocation)) {
$sl = false;
} else {
$sl = $this->sourceLocation;
if ($pearize) {
if (strpos($sl, 'pear/')) {
$sl = substr($sl, strpos($sl, 'pear/') + 5);
} else {
$sl = str_replace($_phpDocumentor_options['Program_Root']
. PATH_DELIMITER, '', $sl);
}
}
}
return $sl;
}
/**
* Not implemented in this version
*
* @return bool tell the parser whether to parse the file,
* otherwise this function will retrieve the parsed data
* from external file
*/
function getParseData()
{
return true;
}
}
/**
* Contains an in-memory representation of all documentable elements
* ({@link parserPage}, {@link parserFunction}, {@link parserDefine},
* {@link parserInclude}, {@link parserClass}, {@link parserMethod},
* {@link parserVar}) and their DocBlocks ({@link parserDocBlock}).
*
* This class works in coordination with {@link phpDocumentor_IntermediateParser}
* to take output from {@link Parser::handleEvent()} and create indexes, links,
* and other assorted things (all documented in phpDocumentor_IntermediateParser
* and {@link Converter})
*
* @category ToolsAndUtilities
* @package phpDocumentor
* @subpackage ParserData
* @author Gregory Beaver <cellog@php.net>
* @copyright 2002-2008 Gregory Beaver
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @version Release: 1.4.3
* @filesource
* @link http://www.phpdoc.org
* @link http://pear.php.net/PhpDocumentor
* @since 1.0rc1
* @todo CS cleanup - change package to PhpDocumentor
*/
class parserData
{
/**
* {@link parserPage} element that is this parserData's parent, or false if
* not set.
* @var false|parserPage
*/
var $parent = false;
/**
* array of parsed elements
* @var array
*/
var $elements = array();
/**
* @var boolean
* @access private
*/
var $_hasclasses = false;
/**
* @var boolean
* @access private
*/
var $_hasinterfaces = false;
/**
* array of parsed elements with @access private
* @var array
*/
var $privateelements = array();
/**
* array of parsed class elements
* @var array
*/
var $classelements = array();
/**
* @var parserTutorial|false
*/
var $tutorial = false;
/**
* array of parsed class elements with @access private
* @var array
*/
var $privateclasselements = array();
/**
* array of links descended from {@link abstractLink}
* @var array
* @see pageLink, defineLink, classLink, functionLink, methodLink, varLink
*/
var $links = array();
/**
* used by {@link phpDocumentor_IntermediateParser::handleDocBlock()} to
* determine whether a docblock is a page-level docblock or not. $clean is
* true as long as only 0 or 1 docblock has been parsed, and no element
* other than parserPage has been parsed
* @var boolean
*/
var $clean = true;
/**
* DocBlock ({@link parserDocBlock}) for this page, or false if not set
* @var mixed
*/
var $docblock = false;
/**
* Flag used to determine whether a page-level docblock is present
* @var boolean
* @access private
*/
var $_explicitdocblock = false;
/**
* Type is used by many functions to skip the hassle of if
* <code>phpDocumentor_get_class($blah) == 'parserBlah'</code>
* always 'page', used in element indexing and conversion functions found in
* {@link Converter}
* @var string
*/
var $type = 'page';
/**
* add a new element to the tracking array
*
* @param parserElement &$element add a parsed element to the
* {@link $elements} array,
* also sets {@link $clean} to false
*
* @return void
*/
function addElement(&$element)
{
$element->setPath($this->parent->path);
if ($element->getType() == 'class'
|| $element->getType() == 'method'
|| $element->getType() == 'var'
|| $element->getType() == 'const'
) {
if ($element->getType() == 'class') {
if ($element->isInterface()) {
$this->_hasinterfaces = true;
} else {
$this->_hasclasses = true;
}
}
$this->classelements[] = $element;
} else {
$this->elements[] = $element;
}
$this->clean = false;
}
/**
* Does this package have interfaces?
*
* @return bool
*/
function hasInterfaces()
{
return $this->_hasinterfaces;
}
/**
* Does this package have classes?
*
* @return boolean
*/
function hasClasses()
{
return $this->_hasclasses;
}
/**
* adds a tutorial parser
*
* @param parserTutorial $t a tutorial parser
* @param Converter &$c the output converter
*
* @return void
*/
function addTutorial($t, &$c)
{
$this->tutorial = new tutorialLink;
$this->tutorial->addLink('', $t->path, $t->name, $t->package,
$t->subpackage, $t->getTitle($c));
}
/**
* If this file has a tutorial associated with it,
* returns a link to the tutorial.
*
* @return tutorialLink
*/
function getTutorial()
{
return $this->tutorial;
}
/**
* If the page-level DocBlock was present in the source, returns true
*
* @return bool
*/
function hasExplicitDocBlock()
{
return $this->_explicitdocblock;
}
/**
* Tells this page that its DocBlock was not implicit
*
* @return bool
*/
function explicitDocBlock()
{
$this->_explicitdocblock = true;
}
/**
* adds a link
*
* @param parserElement &$element element to add a new link (descended from
* {@link abstractLink}) to the
* {@link $links} array
* @param string $classorpackage classname for elements that are
* class-based (this may be deprecated in
* the future, as the classname should be
* contained within the element. if
* $element is a page, this parameter is a
* package name
* @param string $subpackage subpackage name for page elements
*
* @return string
*/
function addLink(&$element, $classorpackage = '', $subpackage = '')
{
switch($element->type)
{
case 'function':
$x = new functionLink;
$x->addLink($this->parent->path, $this->parent->name, $element->name,
$element->docblock->package, $element->docblock->subpackage);
return $x;
break;
case 'define':
$x = new defineLink;
$x->addLink($this->parent->path, $this->parent->name, $element->name,
$element->docblock->package, $element->docblock->subpackage);
return $x;
break;
case 'global':
$x = new globalLink;
$x->addLink($this->parent->path, $this->parent->name, $element->name,
$element->docblock->package, $element->docblock->subpackage);
return $x;
break;
case 'class':
$x = new classLink;
$x->addLink($this->parent->path, $this->parent->name, $element->name,
$element->docblock->package, $element->docblock->subpackage);
return $x;
break;
case 'method':
$x = new methodLink;
$x->addLink($classorpackage, $this->parent->path,
$this->parent->name, $element->name, $element->docblock->package,
$element->docblock->subpackage);
return $x;
break;
case 'var':
$x = new varLink;
$x->addLink($classorpackage, $this->parent->path,
$this->parent->name, $element->name, $element->docblock->package,
$element->docblock->subpackage);
return $x;
break;
case 'page':
if (empty($classorpackage)) {
$classorpackage = $GLOBALS['phpDocumentor_DefaultPackageName'];
}
$x = new pageLink;
$x->addLink($element->path, $element->name, $element->file,
$classorpackage, $subpackage);
return $x;
break;
}
}
/**
* returns a link
*
* @param Converter &$c the output converter
* @param bool $text a text flag
*
* @return string
*/
function &getLink(&$c, $text = false)
{
$a = $c->getPageLink($this->parent->file, $this->docblock->package,
$this->parent->path, $text);
return $a;
}
/**
* returns a list of all classes declared in a file
*
* @param Converter &$c output converter
*
* @return array Format: array(
* packagename => parserClass,
* packagename => parserClass,
* ...
* )
*/
function getClasses(&$c)
{
$r = $c->classes->getClassesInPath($this->parent->path);
$rr = array();
if ($r) {
foreach ($r as $class => $obj) {
$rr[$obj->docblock->package][] = $obj;
}
}
return $rr;
}
/**
* Get the output-safe filename (. changed to _)
*
* @return string
*/
function getName()
{
if (isset($this->parent) && $this->parent) {
return $this->parent->getName();
}
}
/**
* sets the parent
*
* @param parserPage &$parent parent element of this parsed data
*
* @return void
*/
function setParent(&$parent)
{
$this->parent = $parent;
}
/**
* checks if the element is "cleaned" already
*
* @return bool returns the value of {@link $clean}
*/
function isClean()
{
return $this->clean;
}
/**
* sets the docblock
*
* @param parserDocBlock &$docblock docblock element
*
* @return void
* @see parserDocBlock
*/
function setDocBlock(&$docblock)
{
$this->docblock = $docblock;
}
}
/**
* Base class for all elements
*
* @category ToolsAndUtilities
* @package phpDocumentor
* @subpackage ParserData
* @author Gregory Beaver <cellog@php.net>
* @copyright 2002-2008 Gregory Beaver
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @version Release: 1.4.3
* @filesource
* @link http://www.phpdoc.org
* @link http://pear.php.net/PhpDocumentor
* @since 1.0rc1
* @todo CS cleanup - change package to PhpDocumentor
* @abstract
*/
class parserBase
{
/**
* Type is used by many functions to skip the hassle of if
* phpDocumentor_get_class($blah) == 'parserBlah'... always base
* @var string
*/
var $type = 'base';
/**
* set to different things by its descendants
* @abstract
* @var mixed
*/
var $value = false;
/**
* gets the type
*
* @return string returns value of {@link $type}
*/
function getType()
{
return $this->type;
}
/**
* sets the given value
*
* @param mixed $value set the value of this element
*
* @return void
*/
function setValue($value)
{
$this->value = $value;
}
/**
* gets the value
*
* @return mixed get the value of this element (element-dependent)
*/
function getValue()
{
return $this->value;
}
}
/**
* Used to represent strings that contain inline tags,
* so that they can be properly parsed at link time
*
* @category ToolsAndUtilities
* @package phpDocumentor
* @subpackage ParserData
* @author Gregory Beaver <cellog@php.net>
* @copyright 2002-2008 Gregory Beaver
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @version Release: 1.4.3
* @filesource
* @link http://www.phpdoc.org
* @link http://pear.php.net/PhpDocumentor
* @since 1.0rc1
* @todo CS cleanup - change package to PhpDocumentor
*/
class parserStringWithInlineTags extends parserBase
{
/**
* Type is used by many functions to skip the hassle of
* if phpDocumentor_get_class($blah) == 'parserBlah'...
* always '_string'
* @var string
*/
var $type = '_string';
/**
* @access private
*/
var $cache = false;
/**
* array of strings and {@link parserInlineTag}s
* Format:
* array(string1,string2,parserInlineTag1,string3,parserInlineTag2,...)
* @var array
*/
var $value = array();
/**
* equivalent to the . operator ($a = $b . $c)
*
* @param mixed $stringOrInlineTag either a string or a {@link parserInlineTag}
*
* @return void
*/
function add($stringOrInlineTag)
{
if (is_string($stringOrInlineTag)) {
if (!count($this->value)) {
$this->value[] = $stringOrInlineTag;
return;
}
if (is_string($this->value[count($this->value) - 1])) {
$this->value[count($this->value) - 1] .= $stringOrInlineTag;
return;
} else {
$this->value[] = $stringOrInlineTag;
return;
}
} else {
if (is_a($stringOrInlineTag, 'parserinlinetag')
&& phpDocumentor_setup::checkIgnoreTag($stringOrInlineTag->
inlinetype, true)
) {
return;
}
$this->value[] = $stringOrInlineTag;
}
}
/**
* Determine whether the string contains any inline tags
*
* @return bool
* @tutorial inlinetags.pkg
*/
function hasInlineTag()
{
for ($i=0; $i<count($this->value); $i++) {
if (is_a($this->value[$i], 'parserinlinetag')) {
return true;
}
}
return false;
}
/**
* Pass source code to any {@}source} tags contained within the string
* for later conversion.
*
* @param string|array $source source code ready to be highlighted
*
* @return void
*/
function setSource($source)
{
for ($i=0; $i<count($this->value); $i++) {
if (phpDocumentor_get_class($this->value[$i]) == 'parsersourceinlinetag'
) {
$this->value[$i]->setSource($source);
}
}
}
/**
* equivalent to trim(strlen($string))
*
* @return integer length of the string this object represents
*/
function trimmedStrlen()
{
$a = 0;
for ($i=0; $i<count($this->value); $i++) {
if (is_string($this->value[$i])) {
if ($i == 0) {
$a += strlen(ltrim($this->value[$i]));
} elseif ($i == count($this->value[$i]) - 1) {
$a += strlen(chop($this->value[$i]));
}
} else {
$a += $this->value[$i]->Strlen();
}
}
return $a;
}
/**
* return the string unconverted (all inline tags are taken out - this
* should only be used in pre-parsing to see if any other text
* is in the string)
*
* @param bool $trim whether to trim the string
*
* @return string trimmed value
* @uses parserInlineTag::getString() removes inline tag length, as it is
* indeterminate until conversion.
*/
function getString($trim = true)
{
$a = '';
for ($i=0; $i<count($this->value); $i++) {
if (is_string($this->value[$i])) {
$a .= $this->value[$i];
} else {
$a .= $this->value[$i]->getString();
}
}
if ($trim) {
$a = trim($a);
}
return $a;
}
/**
* Use to convert the string to a real string
* with all inline tags parsed and linked
*
* @param Converter &$converter the output converter
* @param bool $postprocess true if one needs to postprocess
* @param bool $trim false if the output should not be trimmed
*
* @return string
* @see Converter::returnSee()
* @todo CS cleanup - rename to convert for camelCase rule
*/
function Convert(&$converter, $postprocess = true, $trim = true)
{
if ($this->cache) {
if ($converter->name == $this->cache['name']
&& $converter->outputformat == $this->cache['output']
&& $converter->checkState($this->cache['state'])
&& $this->cache['postprocess'] === $postprocess
) {
return $this->cache['contents'];
}
if ($converter->name != $this->cache['name']) {
$this->cache = false;
}
}
if (is_string($this->value)) {
return $this->value;
}
$a = '';
for ($i=0; $i<count($this->value); $i++) {
if (is_string($this->value[$i])) {
if ($postprocess && !method_exists($converter, 'postProcess')) {
var_dump('a', $converter);
}
if ($postprocess) {
$a .= $converter->postProcess($this->value[$i]);
} else {
$a .= $this->value[$i];
}
} else {
$a .= $this->value[$i]->Convert($converter, $postprocess);
}
}
if ($trim) {
$a = trim($a);
}
$this->cache = array(
'name' => $converter->name,
'output' => $converter->outputformat,
'contents' => $a,
'state' => $converter->getState(),
'postprocess' => $postprocess
);
return $a;
}
}
?>
|