blogger
Revision | 6373f6775c5f768e25580eb64ac6d8d533b450c0 (tree) |
---|---|
Time | 2016-11-04 21:15:06 |
Author | Akito Hachiya <s.beec1e@gmai...> |
Commiter | umorigu |
BugTrack/2394 Use construct() instead of old style constructor
@@ -27,7 +27,7 @@ class Config | ||
27 | 27 | var $name, $page; // Page name |
28 | 28 | var $objs = array(); |
29 | 29 | |
30 | - function Config($name) | |
30 | + function __construct($name) | |
31 | 31 | { |
32 | 32 | $this->name = $name; |
33 | 33 | $this->page = PKWK_CONFIG_PREFIX . $name; |
@@ -135,7 +135,7 @@ class ConfigTable | ||
135 | 135 | var $after = array(); // Page contents (except table ones) |
136 | 136 | var $values = array(); // Table contents |
137 | 137 | |
138 | - function ConfigTable($title, $obj = NULL) | |
138 | + function __construct($title, $obj = NULL) | |
139 | 139 | { |
140 | 140 | if ($obj !== NULL) { |
141 | 141 | $this->title = $obj->title; |
@@ -32,7 +32,7 @@ class Element | ||
32 | 32 | var $elements; // References of childs |
33 | 33 | var $last; // Insert new one at the back of the $last |
34 | 34 | |
35 | - function Element() | |
35 | + function __construct() | |
36 | 36 | { |
37 | 37 | $this->elements = array(); |
38 | 38 | $this->last = & $this; |
@@ -165,9 +165,9 @@ function & Factory_Div(& $root, $text) | ||
165 | 165 | // Inline elements |
166 | 166 | class Inline extends Element |
167 | 167 | { |
168 | - function Inline($text) | |
168 | + function __construct($text) | |
169 | 169 | { |
170 | - parent::Element(); | |
170 | + parent::__construct(); | |
171 | 171 | $this->elements[] = trim((substr($text, 0, 1) == "\n") ? |
172 | 172 | $text : make_link($text)); |
173 | 173 | } |
@@ -202,9 +202,9 @@ class Paragraph extends Element | ||
202 | 202 | { |
203 | 203 | var $param; |
204 | 204 | |
205 | - function Paragraph($text, $param = '') | |
205 | + function __construct($text, $param = '') | |
206 | 206 | { |
207 | - parent::Element(); | |
207 | + parent::__construct(); | |
208 | 208 | $this->param = $param; |
209 | 209 | if ($text == '') return; |
210 | 210 |
@@ -234,9 +234,9 @@ class Heading extends Element | ||
234 | 234 | var $id; |
235 | 235 | var $msg_top; |
236 | 236 | |
237 | - function Heading(& $root, $text) | |
237 | + function __construct(& $root, $text) | |
238 | 238 | { |
239 | - parent::Element(); | |
239 | + parent::__construct(); | |
240 | 240 | |
241 | 241 | $this->level = min(3, strspn($text, '*')); |
242 | 242 | list($text, $this->msg_top, $this->id) = $root->getAnchor($text, $this->level); |
@@ -266,9 +266,9 @@ class Heading extends Element | ||
266 | 266 | // Horizontal Rule |
267 | 267 | class HRule extends Element |
268 | 268 | { |
269 | - function HRule(& $root, $text) | |
269 | + function __construct(& $root, $text) | |
270 | 270 | { |
271 | - parent::Element(); | |
271 | + parent::__construct(); | |
272 | 272 | } |
273 | 273 | |
274 | 274 | function canContain(& $obj) |
@@ -293,9 +293,9 @@ class ListContainer extends Element | ||
293 | 293 | var $margin; |
294 | 294 | var $left_margin; |
295 | 295 | |
296 | - function ListContainer($tag, $tag2, $head, $text) | |
296 | + function __construct($tag, $tag2, $head, $text) | |
297 | 297 | { |
298 | - parent::Element(); | |
298 | + parent::__construct(); | |
299 | 299 | |
300 | 300 | $var_margin = '_' . $tag . '_margin'; |
301 | 301 | $var_left_margin = '_' . $tag . '_left_margin'; |
@@ -361,9 +361,9 @@ class ListContainer extends Element | ||
361 | 361 | |
362 | 362 | class ListElement extends Element |
363 | 363 | { |
364 | - function ListElement($level, $head) | |
364 | + function __construct($level, $head) | |
365 | 365 | { |
366 | - parent::Element(); | |
366 | + parent::__construct(); | |
367 | 367 | $this->level = $level; |
368 | 368 | $this->head = $head; |
369 | 369 | } |
@@ -384,9 +384,9 @@ class ListElement extends Element | ||
384 | 384 | // - Three |
385 | 385 | class UList extends ListContainer |
386 | 386 | { |
387 | - function UList(& $root, $text) | |
387 | + function __construct(& $root, $text) | |
388 | 388 | { |
389 | - parent::ListContainer('ul', 'li', '-', $text); | |
389 | + parent::__construct('ul', 'li', '-', $text); | |
390 | 390 | } |
391 | 391 | } |
392 | 392 |
@@ -395,9 +395,9 @@ class UList extends ListContainer | ||
395 | 395 | // + Three |
396 | 396 | class OList extends ListContainer |
397 | 397 | { |
398 | - function OList(& $root, $text) | |
398 | + function __construct(& $root, $text) | |
399 | 399 | { |
400 | - parent::ListContainer('ol', 'li', '+', $text); | |
400 | + parent::__construct('ol', 'li', '+', $text); | |
401 | 401 | } |
402 | 402 | } |
403 | 403 |
@@ -406,9 +406,9 @@ class OList extends ListContainer | ||
406 | 406 | // : definition3 | description3 |
407 | 407 | class DList extends ListContainer |
408 | 408 | { |
409 | - function DList($out) | |
409 | + function __construct($out) | |
410 | 410 | { |
411 | - parent::ListContainer('dl', 'dt', ':', $out[0]); | |
411 | + parent::__construct('dl', 'dt', ':', $out[0]); | |
412 | 412 | $this->last = & Element::insert(new ListElement($this->level, 'dd')); |
413 | 413 | if ($out[1] != '') |
414 | 414 | $this->last = & $this->last->insert(Factory_Inline($out[1])); |
@@ -421,9 +421,9 @@ class BQuote extends Element | ||
421 | 421 | { |
422 | 422 | var $level; |
423 | 423 | |
424 | - function BQuote(& $root, $text) | |
424 | + function __construct(& $root, $text) | |
425 | 425 | { |
426 | - parent::Element(); | |
426 | + parent::__construct(); | |
427 | 427 | |
428 | 428 | $head = substr($text, 0, 1); |
429 | 429 | $this->level = min(3, strspn($text, $head)); |
@@ -484,9 +484,9 @@ class TableCell extends Element | ||
484 | 484 | var $rowspan = 1; |
485 | 485 | var $style; // is array('width'=>, 'align'=>...); |
486 | 486 | |
487 | - function TableCell($text, $is_template = FALSE) | |
487 | + function __construct($text, $is_template = FALSE) | |
488 | 488 | { |
489 | - parent::Element(); | |
489 | + parent::__construct(); | |
490 | 490 | $this->style = $matches = array(); |
491 | 491 | |
492 | 492 | while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)):(.*)$/', |
@@ -561,9 +561,9 @@ class Table extends Element | ||
561 | 561 | var $types; |
562 | 562 | var $col; // number of column |
563 | 563 | |
564 | - function Table($out) | |
564 | + function __construct($out) | |
565 | 565 | { |
566 | - parent::Element(); | |
566 | + parent::__construct(); | |
567 | 567 | |
568 | 568 | $cells = explode('|', $out[1]); |
569 | 569 | $this->col = count($cells); |
@@ -665,9 +665,9 @@ class YTable extends Element | ||
665 | 665 | // TODO: Seems unable to show literal '==' without tricks. |
666 | 666 | // But it will be imcompatible. |
667 | 667 | // TODO: Why toString() or toXHTML() here |
668 | - function YTable($row = array('cell1 ', ' cell2 ', ' cell3')) | |
668 | + function __construct($row = array('cell1 ', ' cell2 ', ' cell3')) | |
669 | 669 | { |
670 | - parent::Element(); | |
670 | + parent::__construct(); | |
671 | 671 | |
672 | 672 | $str = array(); |
673 | 673 | $col = count($row); |
@@ -738,10 +738,10 @@ class YTable extends Element | ||
738 | 738 | // ' 'Space-beginning sentence |
739 | 739 | class Pre extends Element |
740 | 740 | { |
741 | - function Pre(& $root, $text) | |
741 | + function __construct(& $root, $text) | |
742 | 742 | { |
743 | 743 | global $preformat_ltrim; |
744 | - parent::Element(); | |
744 | + parent::__construct(); | |
745 | 745 | $this->elements[] = htmlsc( |
746 | 746 | (! $preformat_ltrim || $text == '' || $text{0} != ' ') ? $text : substr($text, 1)); |
747 | 747 | } |
@@ -769,9 +769,9 @@ class Div extends Element | ||
769 | 769 | var $name; |
770 | 770 | var $param; |
771 | 771 | |
772 | - function Div($out) | |
772 | + function __construct($out) | |
773 | 773 | { |
774 | - parent::Element(); | |
774 | + parent::__construct(); | |
775 | 775 | list(, $this->name, $this->param) = array_pad($out, 3, ''); |
776 | 776 | } |
777 | 777 |
@@ -792,9 +792,9 @@ class Align extends Element | ||
792 | 792 | { |
793 | 793 | var $align; |
794 | 794 | |
795 | - function Align($align) | |
795 | + function __construct($align) | |
796 | 796 | { |
797 | - parent::Element(); | |
797 | + parent::__construct(); | |
798 | 798 | $this->align = $align; |
799 | 799 | } |
800 | 800 |
@@ -827,12 +827,12 @@ class Body extends Element | ||
827 | 827 | ',' => 'YTable', |
828 | 828 | '#' => 'Div'); |
829 | 829 | |
830 | - function Body($id) | |
830 | + function __construct($id) | |
831 | 831 | { |
832 | 832 | $this->id = $id; |
833 | 833 | $this->contents = new Element(); |
834 | 834 | $this->contents_last = & $this->contents; |
835 | - parent::Element(); | |
835 | + parent::__construct(); | |
836 | 836 | } |
837 | 837 | |
838 | 838 | function parse(& $lines) |
@@ -979,13 +979,13 @@ class Body extends Element | ||
979 | 979 | |
980 | 980 | class Contents_UList extends ListContainer |
981 | 981 | { |
982 | - function Contents_UList($text, $level, $id) | |
982 | + function __construct($text, $level, $id) | |
983 | 983 | { |
984 | 984 | // Reformatting $text |
985 | 985 | // A line started with "\n" means "preformatted" ... X( |
986 | 986 | make_heading($text); |
987 | 987 | $text = "\n" . '<a href="#' . $id . '">' . $text . '</a>' . "\n"; |
988 | - parent::ListContainer('ul', 'li', '-', str_repeat('-', $level)); | |
988 | + parent::__construct('ul', 'li', '-', str_repeat('-', $level)); | |
989 | 989 | $this->insert(Factory_Inline($text)); |
990 | 990 | } |
991 | 991 |
@@ -1004,4 +1004,3 @@ class Contents_UList extends ListContainer | ||
1004 | 1004 | $this->style = sprintf($_list_pad_str, $this->level, $margin, $margin); |
1005 | 1005 | } |
1006 | 1006 | } |
1007 | - |
@@ -99,7 +99,7 @@ class line_diff | ||
99 | 99 | { |
100 | 100 | var $arr1, $arr2, $m, $n, $pos, $key, $plus, $minus, $equal, $reverse; |
101 | 101 | |
102 | - function line_diff($plus = '+', $minus = '-', $equal = ' ') | |
102 | + function __construct($plus = '+', $minus = '-', $equal = ' ') | |
103 | 103 | { |
104 | 104 | $this->plus = $plus; |
105 | 105 | $this->minus = $minus; |
@@ -254,7 +254,7 @@ class DiffLine | ||
254 | 254 | var $text; |
255 | 255 | var $status; |
256 | 256 | |
257 | - function DiffLine($text) | |
257 | + function __construct($text) | |
258 | 258 | { |
259 | 259 | $this->text = $text . "\n"; |
260 | 260 | $this->status = array(); |
@@ -50,7 +50,7 @@ class InlineConverter | ||
50 | 50 | $this->converters = $converters; |
51 | 51 | } |
52 | 52 | |
53 | - function InlineConverter($converters = NULL, $excludes = NULL) | |
53 | + function __construct($converters = NULL, $excludes = NULL) | |
54 | 54 | { |
55 | 55 | if ($converters === NULL) { |
56 | 56 | $converters = array( |
@@ -151,7 +151,7 @@ class Link | ||
151 | 151 | var $alias; |
152 | 152 | |
153 | 153 | // Constructor |
154 | - function Link($start) | |
154 | + function __construct($start) | |
155 | 155 | { |
156 | 156 | $this->start = $start; |
157 | 157 | } |
@@ -209,9 +209,9 @@ class Link_plugin extends Link | ||
209 | 209 | var $pattern; |
210 | 210 | var $plain,$param; |
211 | 211 | |
212 | - function Link_plugin($start) | |
212 | + function __construct($start) | |
213 | 213 | { |
214 | - parent::Link($start); | |
214 | + parent::__construct($start); | |
215 | 215 | } |
216 | 216 | |
217 | 217 | function get_pattern() |
@@ -278,9 +278,9 @@ EOD; | ||
278 | 278 | // Footnotes |
279 | 279 | class Link_note extends Link |
280 | 280 | { |
281 | - function Link_note($start) | |
281 | + function __construct($start) | |
282 | 282 | { |
283 | - parent::Link($start); | |
283 | + parent::__construct($start); | |
284 | 284 | } |
285 | 285 | |
286 | 286 | function get_pattern() |
@@ -346,9 +346,9 @@ EOD; | ||
346 | 346 | // URLs |
347 | 347 | class Link_url extends Link |
348 | 348 | { |
349 | - function Link_url($start) | |
349 | + function __construct($start) | |
350 | 350 | { |
351 | - parent::Link($start); | |
351 | + parent::__construct($start); | |
352 | 352 | } |
353 | 353 | |
354 | 354 | function get_pattern() |
@@ -393,9 +393,9 @@ EOD; | ||
393 | 393 | // URLs (InterWiki definition on "InterWikiName") |
394 | 394 | class Link_url_interwiki extends Link |
395 | 395 | { |
396 | - function Link_url_interwiki($start) | |
396 | + function __construct($start) | |
397 | 397 | { |
398 | - parent::Link($start); | |
398 | + parent::__construct($start); | |
399 | 399 | } |
400 | 400 | |
401 | 401 | function get_pattern() |
@@ -433,9 +433,9 @@ class Link_mailto extends Link | ||
433 | 433 | { |
434 | 434 | var $is_image, $image; |
435 | 435 | |
436 | - function Link_mailto($start) | |
436 | + function __construct($start) | |
437 | 437 | { |
438 | - parent::Link($start); | |
438 | + parent::__construct($start); | |
439 | 439 | } |
440 | 440 | |
441 | 441 | function get_pattern() |
@@ -475,9 +475,9 @@ class Link_interwikiname extends Link | ||
475 | 475 | var $param = ''; |
476 | 476 | var $anchor = ''; |
477 | 477 | |
478 | - function Link_interwikiname($start) | |
478 | + function __construct($start) | |
479 | 479 | { |
480 | - parent::Link($start); | |
480 | + parent::__construct($start); | |
481 | 481 | } |
482 | 482 | |
483 | 483 | function get_pattern() |
@@ -544,9 +544,9 @@ class Link_bracketname extends Link | ||
544 | 544 | { |
545 | 545 | var $anchor, $refer; |
546 | 546 | |
547 | - function Link_bracketname($start) | |
547 | + function __construct($start) | |
548 | 548 | { |
549 | - parent::Link($start); | |
549 | + parent::__construct($start); | |
550 | 550 | } |
551 | 551 | |
552 | 552 | function get_pattern() |
@@ -606,9 +606,9 @@ EOD; | ||
606 | 606 | // WikiNames |
607 | 607 | class Link_wikiname extends Link |
608 | 608 | { |
609 | - function Link_wikiname($start) | |
609 | + function __construct($start) | |
610 | 610 | { |
611 | - parent::Link($start); | |
611 | + parent::__construct($start); | |
612 | 612 | } |
613 | 613 | |
614 | 614 | function get_pattern() |
@@ -647,11 +647,11 @@ class Link_autolink extends Link | ||
647 | 647 | var $auto; |
648 | 648 | var $auto_a; // alphabet only |
649 | 649 | |
650 | - function Link_autolink($start) | |
650 | + function __construct($start) | |
651 | 651 | { |
652 | 652 | global $autolink; |
653 | 653 | |
654 | - parent::Link($start); | |
654 | + parent::__construct($start); | |
655 | 655 | |
656 | 656 | if (! $autolink || ! file_exists(CACHE_DIR . 'autolink.dat')) |
657 | 657 | return; |
@@ -693,9 +693,9 @@ class Link_autolink extends Link | ||
693 | 693 | |
694 | 694 | class Link_autolink_a extends Link_autolink |
695 | 695 | { |
696 | - function Link_autolink_a($start) | |
696 | + function __construct($start) | |
697 | 697 | { |
698 | - parent::Link_autolink($start); | |
698 | + parent::__construct($start); | |
699 | 699 | } |
700 | 700 | |
701 | 701 | function get_pattern() |
@@ -432,7 +432,7 @@ class AttachFile | ||
432 | 432 | var $size_str = ''; |
433 | 433 | var $status = array('count'=>array(0), 'age'=>'', 'pass'=>'', 'freeze'=>FALSE); |
434 | 434 | |
435 | - function AttachFile($page, $file, $age = 0) | |
435 | + function __construct($page, $file, $age = 0) | |
436 | 436 | { |
437 | 437 | $this->page = $page; |
438 | 438 | $this->file = preg_replace('#^.*/#','',$file); |
@@ -754,7 +754,7 @@ class AttachFiles | ||
754 | 754 | var $page; |
755 | 755 | var $files = array(); |
756 | 756 | |
757 | - function AttachFiles($page) | |
757 | + function __construct($page) | |
758 | 758 | { |
759 | 759 | $this->page = $page; |
760 | 760 | } |
@@ -823,7 +823,7 @@ class AttachPages | ||
823 | 823 | { |
824 | 824 | var $pages = array(); |
825 | 825 | |
826 | - function AttachPages($page = '', $age = NULL) | |
826 | + function __construct($page = '', $age = NULL) | |
827 | 827 | { |
828 | 828 | |
829 | 829 | $dir = opendir(UPLOAD_DIR) or |
@@ -331,7 +331,7 @@ class tarlib | ||
331 | 331 | var $dummydata; |
332 | 332 | |
333 | 333 | // コンストラクタ |
334 | - function tarlib() { | |
334 | + function __construct() { | |
335 | 335 | $this->filename = ''; |
336 | 336 | $this->fp = FALSE; |
337 | 337 | $this->status = TARLIB_STATUS_INIT; |
@@ -712,6 +712,5 @@ class tarlib | ||
712 | 712 | |
713 | 713 | $this->status = TARLIB_STATUS_INIT; |
714 | 714 | } |
715 | - | |
716 | 715 | } |
717 | 716 | ?> |
@@ -104,7 +104,7 @@ class MapNode | ||
104 | 104 | var $done; |
105 | 105 | var $hide_pattern; |
106 | 106 | |
107 | - function MapNode($page, $reverse = FALSE) | |
107 | + function __construct($page, $reverse = FALSE) | |
108 | 108 | { |
109 | 109 | global $script, $non_list; |
110 | 110 |
@@ -77,7 +77,7 @@ class ShowRSS_html | ||
77 | 77 | var $items = array(); |
78 | 78 | var $class = ''; |
79 | 79 | |
80 | - function ShowRSS_html($rss) | |
80 | + function __construct($rss) | |
81 | 81 | { |
82 | 82 | foreach ($rss as $date=>$items) { |
83 | 83 | foreach ($items as $item) { |
@@ -267,7 +267,7 @@ class Tracker_field | ||
267 | 267 | var $sort_type = SORT_REGULAR; |
268 | 268 | var $id = 0; |
269 | 269 | |
270 | - function Tracker_field($field,$page,$refer,&$config) | |
270 | + function __construct($field,$page,$refer,&$config) | |
271 | 271 | { |
272 | 272 | global $post; |
273 | 273 | static $id = 0; |
@@ -373,9 +373,9 @@ class Tracker_field_format extends Tracker_field | ||
373 | 373 | var $styles = array(); |
374 | 374 | var $formats = array(); |
375 | 375 | |
376 | - function Tracker_field_format($field,$page,$refer,&$config) | |
376 | + function __construct($field,$page,$refer,&$config) | |
377 | 377 | { |
378 | - parent::Tracker_field($field,$page,$refer,$config); | |
378 | + parent::__construct($field,$page,$refer,$config); | |
379 | 379 | |
380 | 380 | foreach ($this->config->get($this->name) as $option) |
381 | 381 | { |
@@ -663,7 +663,7 @@ class Tracker_list | ||
663 | 663 | var $order; |
664 | 664 | var $sort_keys; |
665 | 665 | |
666 | - function Tracker_list($page,$refer,&$config,$list) | |
666 | + function __construct($page,$refer,&$config,$list) | |
667 | 667 | { |
668 | 668 | $this->page = $page; |
669 | 669 | $this->config = &$config; |