This repository was archived by the owner on Mar 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiff.d
14718 lines (13723 loc) · 875 KB
/
diff.d
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
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -NaurB -x .svn includes/AjaxDispatcher.php /srv/web/fp014/source/includes/AjaxDispatcher.php
--- includes/AjaxDispatcher.php 2007-02-02 01:47:14.000000000 +0000
+++ /srv/web/fp014/source/includes/AjaxDispatcher.php 2007-02-01 01:03:18.000000000 +0000
@@ -14,7 +14,7 @@
var $func_name;
var $args;
- function AjaxDispatcher() {
+ function __construct() {
wfProfileIn( __METHOD__ );
$this->mode = "";
@@ -28,14 +28,14 @@
}
if ($this->mode == "get") {
- $this->func_name = $_GET["rs"];
+ $this->func_name = isset( $_GET["rs"] ) ? $_GET["rs"] : '';
if (! empty($_GET["rsargs"])) {
$this->args = $_GET["rsargs"];
} else {
$this->args = array();
}
} else {
- $this->func_name = $_POST["rs"];
+ $this->func_name = isset( $_POST["rs"] ) ? $_POST["rs"] : '';
if (! empty($_POST["rsargs"])) {
$this->args = $_POST["rsargs"];
} else {
@@ -47,7 +47,7 @@
function performAction() {
global $wgAjaxExportList, $wgOut;
-
+
if ( empty( $this->mode ) ) {
return;
}
@@ -59,7 +59,7 @@
} else {
try {
$result = call_user_func_array($this->func_name, $this->args);
-
+
if ( $result === false || $result === NULL ) {
header( 'Status: 500 Internal Error', true, 500 );
echo "{$this->func_name} returned no data";
@@ -68,7 +68,7 @@
if ( is_string( $result ) ) {
$result= new AjaxResponse( $result );
}
-
+
$result->sendHeaders();
$result->printText();
}
@@ -82,7 +82,7 @@
}
}
}
-
+
wfProfileOut( __METHOD__ );
$wgOut = null;
}
diff -NaurB -x .svn includes/AjaxFunctions.php /srv/web/fp014/source/includes/AjaxFunctions.php
--- includes/AjaxFunctions.php 2007-02-02 01:47:14.000000000 +0000
+++ /srv/web/fp014/source/includes/AjaxFunctions.php 2007-02-01 01:03:18.000000000 +0000
@@ -45,7 +45,7 @@
if ($iconv_to != "UTF-8") {
$decodedStr = iconv("UTF-8", $iconv_to, $decodedStr);
}
-
+
return $decodedStr;
}
@@ -71,7 +71,7 @@
function wfSajaxSearch( $term ) {
global $wgContLang, $wgOut;
$limit = 16;
-
+
$l = new Linker;
$term = str_replace( ' ', '_', $wgContLang->ucfirst(
@@ -81,7 +81,7 @@
if ( strlen( str_replace( '_', '', $term ) )<3 )
return;
- $db =& wfGetDB( DB_SLAVE );
+ $db = wfGetDB( DB_SLAVE );
$res = $db->select( 'page', 'page_title',
array( 'page_namespace' => 0,
"page_title LIKE '". $db->strencode( $term) ."%'" ),
@@ -108,8 +108,8 @@
$subtitlemsg = ( Title::newFromText($term) ? 'searchsubtitle' : 'searchsubtitleinvalid' );
$subtitle = $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) ); #FIXME: parser is missing mTitle !
- $term = htmlspecialchars( $term );
- $html = '<div style="float:right; border:solid 1px black;background:gainsboro;padding:2px;"><a onclick="Searching_Hide_Results();">'
+ $term = urlencode( $term );
+ $html = '<div style="float:right; border:solid 1px black;background:gainsboro;padding:2px;"><a onclick="Searching_Hide_Results();">'
. wfMsg( 'hideresults' ) . '</a></div>'
. '<h1 class="firstHeading">'.wfMsg('search')
. '</h1><div id="contentSub">'. $subtitle . '</div><ul><li>'
@@ -121,11 +121,11 @@
"search=$term&go=Go" )
. "</li></ul><h2>" . wfMsg( 'articletitles', $term ) . "</h2>"
. '<ul>' .$r .'</ul>'.$more;
-
+
$response = new AjaxResponse( $html );
-
+
$response->setCacheDuration( 30*60 );
-
+
return $response;
}
@@ -152,14 +152,14 @@
if($watch) {
if(!$watching) {
- $dbw =& wfGetDB(DB_MASTER);
+ $dbw = wfGetDB(DB_MASTER);
$dbw->begin();
$article->doWatch();
$dbw->commit();
}
} else {
if($watching) {
- $dbw =& wfGetDB(DB_MASTER);
+ $dbw = wfGetDB(DB_MASTER);
$dbw->begin();
$article->doUnwatch();
$dbw->commit();
diff -NaurB -x .svn includes/AjaxResponse.php /srv/web/fp014/source/includes/AjaxResponse.php
--- includes/AjaxResponse.php 2007-02-02 01:47:14.000000000 +0000
+++ /srv/web/fp014/source/includes/AjaxResponse.php 2007-02-01 01:03:18.000000000 +0000
@@ -1,28 +1,29 @@
<?php
+if( !defined( 'MEDIAWIKI' ) ) {
+ die( 1 );
+}
-if( !defined( 'MEDIAWIKI' ) )
- die( 1 );
-
+/** @todo document */
class AjaxResponse {
var $mCacheDuration;
var $mVary;
-
+
var $mDisabled;
var $mText;
var $mResponseCode;
var $mLastModified;
var $mContentType;
- function AjaxResponse( $text = NULL ) {
+ function __construct( $text = NULL ) {
$this->mCacheDuration = NULL;
$this->mVary = NULL;
-
+
$this->mDisabled = false;
$this->mText = '';
$this->mResponseCode = '200 OK';
$this->mLastModified = false;
$this->mContentType= 'text/html; charset=utf-8';
-
+
if ( $text ) {
$this->addText( $text );
}
@@ -39,15 +40,15 @@
function setResponseCode( $code ) {
$this->mResponseCode = $code;
}
-
+
function setContentType( $type ) {
$this->mContentType = $type;
}
-
+
function disable() {
$this->mDisabled = true;
}
-
+
function addText( $text ) {
if ( ! $this->mDisabled && $text ) {
$this->mText .= $text;
@@ -59,62 +60,62 @@
print $this->mText;
}
}
-
+
function sendHeaders() {
global $wgUseSquid, $wgUseESI;
-
+
if ( $this->mResponseCode ) {
$n = preg_replace( '/^ *(\d+)/', '\1', $this->mResponseCode );
header( "Status: " . $this->mResponseCode, true, (int)$n );
}
-
+
header ("Content-Type: " . $this->mContentType );
-
+
if ( $this->mLastModified ) {
header ("Last-Modified: " . $this->mLastModified );
}
else {
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
}
-
+
if ( $this->mCacheDuration ) {
-
+
# If squid caches are configured, tell them to cache the response,
# and tell the client to always check with the squid. Otherwise,
# tell the client to use a cached copy, without a way to purge it.
-
+
if( $wgUseSquid ) {
-
+
# Expect explicite purge of the proxy cache, but require end user agents
# to revalidate against the proxy on each visit.
# Surrogate-Control controls our Squid, Cache-Control downstream caches
-
+
if ( $wgUseESI ) {
header( 'Surrogate-Control: max-age='.$this->mCacheDuration.', content="ESI/1.0"');
header( 'Cache-Control: s-maxage=0, must-revalidate, max-age=0' );
} else {
header( 'Cache-Control: s-maxage='.$this->mCacheDuration.', must-revalidate, max-age=0' );
}
-
+
} else {
-
+
# Let the client do the caching. Cache is not purged.
header ("Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->mCacheDuration ) . " GMT");
header ("Cache-Control: s-max-age={$this->mCacheDuration},public,max-age={$this->mCacheDuration}");
}
-
+
} else {
# always expired, always modified
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
}
-
+
if ( $this->mVary ) {
header ( "Vary: " . $this->mVary );
}
}
-
+
/**
* checkLastModified tells the client to use the client-cached response if
* possible. If sucessful, the AjaxResponse is disabled so that
@@ -154,9 +155,9 @@
$this->setResponseCode( "304 Not Modified" );
$this->disable();
$this->mLastModified = $lastmod;
-
+
wfDebug( "$fname: CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
-
+
return true;
} else {
wfDebug( "$fname: READY client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
@@ -167,11 +168,11 @@
$this->mLastModified = $lastmod;
}
}
-
+
function loadFromMemcached( $mckey, $touched ) {
global $wgMemc;
if ( !$touched ) return false;
-
+
$mcvalue = $wgMemc->get( $mckey );
if ( $mcvalue ) {
# Check to see if the value has been invalidated
@@ -183,20 +184,20 @@
wfDebug( "$mckey has expired\n" );
}
}
-
+
return false;
}
-
+
function storeInMemcached( $mckey, $expiry = 86400 ) {
global $wgMemc;
-
- $wgMemc->set( $mckey,
+
+ $wgMemc->set( $mckey,
array(
'timestamp' => wfTimestampNow(),
'value' => $this->mText
), $expiry
);
-
+
return true;
}
}
diff -NaurB -x .svn includes/api/ApiFormatBase.php /srv/web/fp014/source/includes/api/ApiFormatBase.php
--- includes/api/ApiFormatBase.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiFormatBase.php 2007-02-01 01:03:18.000000000 +0000
@@ -170,7 +170,7 @@
}
public static function getBaseVersion() {
- return __CLASS__ . ': $Id: ApiFormatBase.php 19434 2007-01-18 02:04:11Z brion $';
+ return __CLASS__ . ': $Id: ApiFormatBase.php 19427 2007-01-18 00:01:20Z brion $';
}
}
@@ -226,7 +226,7 @@
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiFormatBase.php 19434 2007-01-18 02:04:11Z brion $';
+ return __CLASS__ . ': $Id: ApiFormatBase.php 19427 2007-01-18 00:01:20Z brion $';
}
}
?>
diff -NaurB -x .svn includes/api/ApiFormatJson_json.php /srv/web/fp014/source/includes/api/ApiFormatJson_json.php
--- includes/api/ApiFormatJson_json.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiFormatJson_json.php 2007-02-01 01:03:18.000000000 +0000
@@ -46,7 +46,7 @@
* DAMAGE.
*
* @category
-* @package Services_JSON
+* @addtogroup Services_JSON
* @author Michal Migurski <[email protected]>
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
diff -NaurB -x .svn includes/api/ApiFormatYaml_spyc.php /srv/web/fp014/source/includes/api/ApiFormatYaml_spyc.php
--- includes/api/ApiFormatYaml_spyc.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiFormatYaml_spyc.php 2007-02-01 01:03:18.000000000 +0000
@@ -6,12 +6,12 @@
* @link http://spyc.sourceforge.net/
* @copyright Copyright 2005-2006 Chris Wanstrath
* @license http://www.opensource.org/licenses/mit-license.php MIT License
- * @package Spyc
+ * @addtogroup Spyc
*/
/**
* A node, used by Spyc for parsing YAML.
- * @package Spyc
+ * @addtogroup Spyc
*/
class YAMLNode {
/**#@+
@@ -59,7 +59,7 @@
* $parser = new Spyc;
* $array = $parser->load($file);
* </code>
- * @package Spyc
+ * @addtogroup Spyc
*/
class Spyc {
diff -NaurB -x .svn includes/api/ApiPageSet.php /srv/web/fp014/source/includes/api/ApiPageSet.php
--- includes/api/ApiPageSet.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiPageSet.php 2007-02-01 01:03:18.000000000 +0000
@@ -308,7 +308,7 @@
if($linkBatch->isEmpty())
return;
- $db = & $this->getDB();
+ $db = $this->getDB();
$set = $linkBatch->constructSet('page', $db);
// Get pageIDs data from the `page` table
@@ -331,7 +331,7 @@
'page_id' => $pageids
);
- $db = & $this->getDB();
+ $db = $this->getDB();
// Get pageIDs data from the `page` table
$this->profileDBIn();
@@ -406,7 +406,7 @@
if(empty($revids))
return;
- $db = & $this->getDB();
+ $db = $this->getDB();
$pageids = array();
$remaining = array_flip($revids);
@@ -438,7 +438,7 @@
private function resolvePendingRedirects() {
if($this->mResolveRedirects) {
- $db = & $this->getDB();
+ $db = $this->getDB();
$pageFlds = $this->getPageTableFields();
// Repeat until all redirects have been resolved
@@ -470,7 +470,7 @@
private function getRedirectTargets() {
$linkBatch = new LinkBatch();
- $db = & $this->getDB();
+ $db = $this->getDB();
// find redirect targets for all redirect pages
$this->profileDBIn();
@@ -592,7 +592,7 @@
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiPageSet.php 17929 2006-11-25 17:11:58Z tstarling $';
+ return __CLASS__ . ': $Id: ApiPageSet.php 19598 2007-01-22 23:50:42Z nickj $';
}
}
?>
diff -NaurB -x .svn includes/api/ApiQueryAllpages.php /srv/web/fp014/source/includes/api/ApiQueryAllpages.php
--- includes/api/ApiQueryAllpages.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiQueryAllpages.php 2007-02-01 01:03:18.000000000 +0000
@@ -49,7 +49,7 @@
private function run($resultPageSet = null) {
wfProfileIn($this->getModuleProfileName() . '-getDB');
- $db = & $this->getDB();
+ $db = $this->getDB();
wfProfileOut($this->getModuleProfileName() . '-getDB');
wfProfileIn($this->getModuleProfileName() . '-parseParams');
@@ -167,7 +167,7 @@
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryAllpages.php 17880 2006-11-23 08:25:56Z nickj $';
+ return __CLASS__ . ': $Id: ApiQueryAllpages.php 19598 2007-01-22 23:50:42Z nickj $';
}
}
?>
diff -NaurB -x .svn includes/api/ApiQueryBacklinks.php /srv/web/fp014/source/includes/api/ApiQueryBacklinks.php
--- includes/api/ApiQueryBacklinks.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiQueryBacklinks.php 2007-02-01 01:03:18.000000000 +0000
@@ -122,7 +122,7 @@
if ($redirect)
$this->addWhereFld('page_is_redirect', 0);
- $db = & $this->getDB();
+ $db = $this->getDB();
if (!is_null($continue)) {
$plfrm = intval($this->contID);
if ($this->contLevel == 0) {
@@ -352,7 +352,7 @@
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryBacklinks.php 17880 2006-11-23 08:25:56Z nickj $';
+ return __CLASS__ . ': $Id: ApiQueryBacklinks.php 19598 2007-01-22 23:50:42Z nickj $';
}
}
?>
\ No newline at end of file
diff -NaurB -x .svn includes/api/ApiQueryLogEvents.php /srv/web/fp014/source/includes/api/ApiQueryLogEvents.php
--- includes/api/ApiQueryLogEvents.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiQueryLogEvents.php 2007-02-01 01:03:18.000000000 +0000
@@ -39,7 +39,7 @@
$limit = $type = $start = $end = $dir = $user = $title = null;
extract($this->extractRequestParams());
- $db = & $this->getDB();
+ $db = $this->getDB();
list($tbl_logging, $tbl_page, $tbl_user) = $db->tableNamesN('logging', 'page', 'user');
@@ -167,7 +167,7 @@
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryLogEvents.php 17952 2006-11-27 08:36:57Z nickj $';
+ return __CLASS__ . ': $Id: ApiQueryLogEvents.php 19598 2007-01-22 23:50:42Z nickj $';
}
}
?>
diff -NaurB -x .svn includes/api/ApiQuery.php /srv/web/fp014/source/includes/api/ApiQuery.php
--- includes/api/ApiQuery.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiQuery.php 2007-02-01 01:03:18.000000000 +0000
@@ -79,10 +79,10 @@
$this->mAllowedGenerators = array_merge($this->mListModuleNames, $this->mPropModuleNames);
}
- public function & getDB() {
+ public function getDB() {
if (!isset ($this->mSlaveDB)) {
$this->profileDBIn();
- $this->mSlaveDB = & wfGetDB(DB_SLAVE);
+ $this->mSlaveDB = wfGetDB(DB_SLAVE);
$this->profileDBOut();
}
return $this->mSlaveDB;
@@ -370,7 +370,7 @@
public function getVersion() {
$psModule = new ApiPageSet($this);
$vers = array ();
- $vers[] = __CLASS__ . ': $Id: ApiQuery.php 17374 2006-11-03 06:53:47Z yurik $';
+ $vers[] = __CLASS__ . ': $Id: ApiQuery.php 19598 2007-01-22 23:50:42Z nickj $';
$vers[] = $psModule->getVersion();
return $vers;
}
diff -NaurB -x .svn includes/api/ApiQueryRecentChanges.php /srv/web/fp014/source/includes/api/ApiQueryRecentChanges.php
--- includes/api/ApiQueryRecentChanges.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiQueryRecentChanges.php 2007-02-01 01:03:18.000000000 +0000
@@ -87,7 +87,7 @@
$data = array ();
$count = 0;
- $db = & $this->getDB();
+ $db = $this->getDB();
$res = $this->select(__METHOD__);
while ($row = $db->fetchObject($res)) {
if (++ $count > $limit) {
@@ -181,7 +181,7 @@
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryRecentChanges.php 17880 2006-11-23 08:25:56Z nickj $';
+ return __CLASS__ . ': $Id: ApiQueryRecentChanges.php 19598 2007-01-22 23:50:42Z nickj $';
}
}
?>
\ No newline at end of file
diff -NaurB -x .svn includes/api/ApiQueryRevisions.php /srv/web/fp014/source/includes/api/ApiQueryRevisions.php
--- includes/api/ApiQueryRevisions.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiQueryRevisions.php 2007-02-01 01:03:18.000000000 +0000
@@ -149,7 +149,7 @@
$count = 0;
$res = $this->select(__METHOD__);
- $db = & $this->getDB();
+ $db = $this->getDB();
while ($row = $db->fetchObject($res)) {
if (++ $count > $limit) {
@@ -262,7 +262,7 @@
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryRevisions.php 19434 2007-01-18 02:04:11Z brion $';
+ return __CLASS__ . ': $Id: ApiQueryRevisions.php 19598 2007-01-22 23:50:42Z nickj $';
}
}
?>
diff -NaurB -x .svn includes/api/ApiQueryUserContributions.php /srv/web/fp014/source/includes/api/ApiQueryUserContributions.php
--- includes/api/ApiQueryUserContributions.php 2007-02-02 01:47:09.000000000 +0000
+++ /srv/web/fp014/source/includes/api/ApiQueryUserContributions.php 2007-02-01 01:03:18.000000000 +0000
@@ -44,7 +44,7 @@
extract($this->extractRequestParams());
//Get a database instance
- $db = & $this->getDB();
+ $db = $this->getDB();
if (is_null($user))
$this->dieUsage("User parameter may not be empty", 'param_user');
@@ -169,7 +169,7 @@
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiQueryUserContributions.php 17952 2006-11-27 08:36:57Z nickj $';
+ return __CLASS__ . ': $Id: ApiQueryUserContributions.php 19598 2007-01-22 23:50:42Z nickj $';
}
}
?>
diff -NaurB -x .svn includes/Article.php /srv/web/fp014/source/includes/Article.php
--- includes/Article.php 2007-02-02 01:47:14.000000000 +0000
+++ /srv/web/fp014/source/includes/Article.php 2007-02-01 01:04:18.000000000 +0000
@@ -1,7 +1,6 @@
<?php
/**
* File for articles
- * @package MediaWiki
*/
/**
@@ -11,7 +10,6 @@
* Note: edit user interface and cache support functions have been
* moved to separate EditPage and HTMLFileCache classes.
*
- * @package MediaWiki
*/
class Article {
/**@{{
@@ -43,7 +41,7 @@
* @param $title Reference to a Title object.
* @param $oldId Integer revision ID, null to fetch from request, zero for current
*/
- function Article( &$title, $oldId = null ) {
+ function __construct( &$title, $oldId = null ) {
$this->mTitle =& $title;
$this->mOldId = $oldId;
$this->clear();
@@ -57,14 +55,14 @@
function setRedirectedFrom( $from ) {
$this->mRedirectedFrom = $from;
}
-
+
/**
* @return mixed false, Title of in-wiki target, or string with URL
*/
function followRedirect() {
$text = $this->getContent();
$rt = Title::newFromRedirect( $text );
-
+
# process if title object is valid and not special:userlogout
if( $rt ) {
if( $rt->getInterwiki() != '' ) {
@@ -73,7 +71,7 @@
//
// This can be hard to reverse and may produce loops,
// so they may be disabled in the site configuration.
-
+
$source = $this->mTitle->getFullURL( 'redirect=no' );
return $rt->getFullURL( 'rdfrom=' . urlencode( $source ) );
}
@@ -84,7 +82,7 @@
// the rest of the page we're on.
//
// This can be hard to reverse, so they may be disabled.
-
+
if( $rt->isSpecial( 'Userlogout' ) ) {
// rolleyes
} else {
@@ -94,7 +92,7 @@
return $rt;
}
}
-
+
// No or invalid redirect
return false;
}
@@ -151,11 +149,14 @@
$ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
} else {
$ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
+ wfRunHooks('ArticleAddContent', array(&$this, $action, &$ret) );
}
+ wfProfileOut( __METHOD__ );
return "<div class='noarticletext'>$ret</div>";
} else {
$this->loadContent();
+ wfRunHooks('ArticleAddContent', array(&$this, $action, &$this->mContent) );
wfProfileOut( __METHOD__ );
return $this->mContent;
}
@@ -247,7 +248,7 @@
* @param array $conditions
* @private
*/
- function pageData( &$dbr, $conditions ) {
+ function pageData( $dbr, $conditions ) {
$fields = array(
'page_id',
'page_namespace',
@@ -273,7 +274,7 @@
* @param Database $dbr
* @param Title $title
*/
- function pageDataFromTitle( &$dbr, $title ) {
+ function pageDataFromTitle( $dbr, $title ) {
return $this->pageData( $dbr, array(
'page_namespace' => $title->getNamespace(),
'page_title' => $title->getDBkey() ) );
@@ -283,7 +284,7 @@
* @param Database $dbr
* @param int $id
*/
- function pageDataFromId( &$dbr, $id ) {
+ function pageDataFromId( $dbr, $id ) {
return $this->pageData( $dbr, array( 'page_id' => $id ) );
}
@@ -296,17 +297,18 @@
*/
function loadPageData( $data = 'fromdb' ) {
if ( $data === 'fromdb' ) {
- $dbr =& $this->getDB();
+ $dbr = $this->getDB();
$data = $this->pageDataFromId( $dbr, $this->getId() );
}
-
+
$lc =& LinkCache::singleton();
if ( $data ) {
$lc->addGoodLinkObj( $data->page_id, $this->mTitle );
$this->mTitle->mArticleID = $data->page_id;
+
+ # Old-fashioned restrictions.
$this->mTitle->loadRestrictions( $data->page_restrictions );
- $this->mTitle->mRestrictionsLoaded = true;
$this->mCounter = $data->page_counter;
$this->mTouched = wfTimestamp( TS_MW, $data->page_touched );
@@ -333,7 +335,7 @@
return $this->mContent;
}
- $dbr =& $this->getDB();
+ $dbr = $this->getDB();
# Pre-fill content with error message so that if something
# fails we'll have something telling us what we intended.
@@ -405,9 +407,8 @@
*
* @return Database
*/
- function &getDB() {
- $ret =& wfGetDB( DB_MASTER );
- return $ret;
+ function getDB() {
+ return wfGetDB( DB_MASTER );
}
/**
@@ -455,7 +456,7 @@
if ( $id == 0 ) {
$this->mCounter = 0;
} else {
- $dbr =& wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_SLAVE );
$this->mCounter = $dbr->selectField( 'page', 'page_counter', array( 'page_id' => $id ),
'Article::getCount', $this->getSelectOptions() );
}
@@ -471,12 +472,12 @@
* @return bool
*/
function isCountable( $text ) {
- global $wgUseCommaCount, $wgContentNamespaces;
+ global $wgUseCommaCount;
$token = $wgUseCommaCount ? ',' : '[[';
return
- array_search( $this->mTitle->getNamespace(), $wgContentNamespaces ) !== false
- && ! $this->isRedirect( $text )
+ $this->mTitle->isContentPage()
+ && !$this->isRedirect( $text )
&& in_string( $token, $text );
}
@@ -573,7 +574,7 @@
# XXX: this is expensive; cache this info somewhere.
$contribs = array();
- $dbr =& wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_SLAVE );
$revTable = $dbr->tableName( 'revision' );
$userTable = $dbr->tableName( 'user' );
$user = $this->getUser();
@@ -613,7 +614,7 @@
$parserCache =& ParserCache::singleton();
$ns = $this->mTitle->getNamespace(); # shortcut
-
+
# Get variables from query string
$oldid = $this->getOldID();
@@ -627,16 +628,21 @@
$diff = $wgRequest->getVal( 'diff' );
$rcid = $wgRequest->getVal( 'rcid' );
$rdfrom = $wgRequest->getVal( 'rdfrom' );
+ $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
$wgOut->setArticleFlag( true );
- if ( isset( $wgNamespaceRobotPolicies[$ns] ) ) {
+
+ # Discourage indexing of printable versions, but encourage following
+ if( $wgOut->isPrintable() ) {
+ $policy = 'noindex,follow';
+ } elseif( isset( $wgNamespaceRobotPolicies[$ns] ) ) {
+ # Honour customised robot policies for this namespace
$policy = $wgNamespaceRobotPolicies[$ns];
} else {
- # The default policy. Dev note: make sure you change the documentation
- # in DefaultSettings.php before changing it.
+ # Default to encourage indexing and following links
$policy = 'index,follow';
}
- $wgOut->setRobotpolicy( $policy );
+ $wgOut->setRobotPolicy( $policy );
# If we got diff and oldid in the query, we want to see a
# diff page instead of the article.
@@ -647,8 +653,8 @@
$de = new DifferenceEngine( $this->mTitle, $oldid, $diff, $rcid );
// DifferenceEngine directly fetched the revision:
$this->mRevIdFetched = $de->mNewid;
- $de->showDiffPage();
-
+ $de->showDiffPage( $diffOnly );
+
// Needed to get the page's current revision
$this->loadPageData();
if( $diff == 0 || $diff == $this->mLatest ) {
@@ -658,7 +664,7 @@
wfProfileOut( __METHOD__ );
return;
}
-
+
if ( empty( $oldid ) && $this->checkTouched() ) {
$wgOut->setETag($parserCache->getETag($this, $wgUser));
@@ -713,7 +719,7 @@
$wasRedirected = true;
}
}
-
+
$outputDone = false;
if ( $pcache ) {
if ( $wgOut->tryParserCache( $this, $wgUser ) ) {
@@ -772,7 +778,13 @@
$wgOut->setRevisionId( $this->getRevIdFetched() );
# wrap user css and user js in pre and don't parse
# XXX: use $this->mTitle->usCssJsSubpage() when php is fixed/ a workaround is found
- if (
+
+ /** Added by [email protected].
+ * This hook is used in extension SiteWideMessages.
+ */
+ if ( ! wfRunHooks('ArticleLoadNoCache', array( &$this, $text) ) ){
+ // do nothing
+ } else if (
$ns == NS_USER &&
preg_match('/\\/[\\w]+\\.(css|js)$/', $this->mTitle->getDBkey())
) {
@@ -795,7 +807,7 @@
$wgOut->addParserOutputNoText( $parseout );
} else if ( $pcache ) {
# Display content and save to parser cache
- $wgOut->addPrimaryWikiText( $text, $this );
+ $this->outputWikiText( $text );
} else {
# Display content, don't attempt to save to parser cache
# Don't show section-edit links on old revisions... this way lies madness.
@@ -803,7 +815,16 @@
$oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false );
}
# Display content and don't save to parser cache
- $wgOut->addPrimaryWikiText( $text, $this, false );
+ # With timing hack -- TS 2006-07-26
+ $time = -wfTime();
+ $this->outputWikiText( $text, false );
+ $time += wfTime();
+
+ # Timing hack
+ if ( $time > 3 ) {
+ wfDebugLog( 'slow-parse', sprintf( "%-5.2f %s", $time,
+ $this->mTitle->getPrefixedDBkey()));
+ }
if( !$this->isCurrent() ) {
$wgOut->parserOptions()->setEditSection( $oldEditSectionSetting );
@@ -827,8 +849,9 @@
if ( $wgUseRCPatrol && !is_null( $rcid ) && $rcid != 0 && $wgUser->isAllowed( 'patrol' ) ) {
$wgOut->addHTML(
"<div class='patrollink'>" .
- wfMsg ( 'markaspatrolledlink',
- $sk->makeKnownLinkObj( $this->mTitle, wfMsg('markaspatrolledtext'), "action=markpatrolled&rcid=$rcid" )
+ wfMsgHtml( 'markaspatrolledlink',
+ $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml('markaspatrolledtext'),
+ "action=markpatrolled&rcid=$rcid" )
) .
'</div>'
);
@@ -845,7 +868,7 @@
function addTrackbacks() {
global $wgOut, $wgUser;
- $dbr =& wfGetDB(DB_SLAVE);
+ $dbr = wfGetDB(DB_SLAVE);
$tbs = $dbr->select(
/* FROM */ 'trackbacks',
/* SELECT */ array('tb_id', 'tb_title', 'tb_url', 'tb_ex', 'tb_name'),
@@ -891,7 +914,7 @@
return;
}
- $db =& wfGetDB(DB_MASTER);
+ $db = wfGetDB(DB_MASTER);
$db->delete('trackbacks', array('tb_id' => $wgRequest->getInt('tbid')));
$wgTitle->invalidateCache();
$wgOut->addWikiText(wfMsg('trackbackdeleteok'));
@@ -910,7 +933,7 @@
function purge() {
global $wgUser, $wgRequest, $wgOut;
- if ( $wgUser->isLoggedIn() || $wgRequest->wasPosted() ) {
+ if ( $wgUser->isAllowed( 'purge' ) || $wgRequest->wasPosted() ) {
if( wfRunHooks( 'ArticlePurge', array( &$this ) ) ) {
$this->doPurge();
}
@@ -928,7 +951,7 @@
$wgOut->addHTML( $msg );
}
}
-
+
/**
* Perform the actions of a page purging
*/
@@ -957,11 +980,10 @@
* Best if all done inside a transaction.
*
* @param Database $dbw
- * @param string $restrictions
* @return int The newly created page_id key
* @private
*/
- function insertOn( &$dbw, $restrictions = '' ) {
+ function insertOn( $dbw ) {
wfProfileIn( __METHOD__ );
$page_id = $dbw->nextSequenceValue( 'page_page_id_seq' );
@@ -970,7 +992,7 @@
'page_namespace' => $this->mTitle->getNamespace(),
'page_title' => $this->mTitle->getDBkey(),
'page_counter' => 0,
- 'page_restrictions' => $restrictions,
+ 'page_restrictions' => '',
'page_is_redirect' => 0, # Will set this shortly...
'page_is_new' => 1,
'page_random' => wfRandom(),
@@ -996,7 +1018,7 @@
* when different from the currently set value.
* Giving 0 indicates the new page flag should
* be set on.
- * @param bool $lastRevIsRedirect If given, will optimize adding and
+ * @param bool $lastRevIsRedirect If given, will optimize adding and
* removing rows in redirect table.
* @return bool true on success, false on failure
* @private
@@ -1006,7 +1028,7 @@
$text = $revision->getText();
$rt = Title::newFromRedirect( $text );
-
+
$conditions = array( 'page_id' => $this->getId() );
if( !is_null( $lastRevision ) ) {
# An extra check against threads stepping on each other
@@ -1028,20 +1050,20 @@
if ($result) {
// FIXME: Should the result from updateRedirectOn() be returned instead?
- $this->updateRedirectOn( $dbw, $rt, $lastRevIsRedirect );
+ $this->updateRedirectOn( $dbw, $rt, $lastRevIsRedirect );
}
-
+
wfProfileOut( __METHOD__ );
return $result;
}
/**
- * Add row to the redirect table if this is a redirect, remove otherwise.
+ * Add row to the redirect table if this is a redirect, remove otherwise.
*
* @param Database $dbw
* @param $redirectTitle a title object pointing to the redirect target,