update porting to new machine
[wikipedia-parser-hphp.git] / gen / php / LinkHolderArray.cpp
blobc812dbb8113a1c5bca41e3d8e8ed126b52bc8bb3
2 #include <php/LinkHolderArray.h>
3 #include <cpp/ext/ext.h>
5 namespace HPHP {
6 ///////////////////////////////////////////////////////////////////////////////
8 const StaticString k_DB_SLAVE = "DB_SLAVE";
9 const StaticString k_NS_CATEGORY = "NS_CATEGORY";
11 /* preface starts */
12 inline Variant df_lambda_1(CVarRef aa, Variant &p0, Variant &p1) {
13 Variant a0; if (aa.is(KindOfArray)) a0 = aa;
14 p0 = a0.rvalAt(0);
15 p1 = a0.rvalAt(1);
16 return aa;
19 inline Variant df_lambda_2(CVarRef aa, Variant &p0, Variant &p1) {
20 Variant a0; if (aa.is(KindOfArray)) a0 = aa;
21 p0 = a0.rvalAt(0);
22 p1 = a0.rvalAt(1);
23 return aa;
26 inline Variant df_lambda_3(CVarRef aa, Variant &p0, Variant &p1) {
27 Variant a0; if (aa.is(KindOfArray)) a0 = aa;
28 p0 = a0.rvalAt(0);
29 p1 = a0.rvalAt(1);
30 return aa;
33 /* preface finishes */
34 /* SRC: LinkHolderArray.php line 3 */
35 Variant c_linkholderarray::os_get(const char *s, int64 hash) {
36 return c_ObjectData::os_get(s, hash);
38 Variant &c_linkholderarray::os_lval(const char *s, int64 hash) {
39 return c_ObjectData::os_lval(s, hash);
41 void c_linkholderarray::o_get(ArrayElementVec &props) const {
42 props.push_back(NEW(ArrayElement)("internals", m_internals.isReferenced() ? ref(m_internals) : m_internals));
43 props.push_back(NEW(ArrayElement)("interwikis", m_interwikis.isReferenced() ? ref(m_interwikis) : m_interwikis));
44 props.push_back(NEW(ArrayElement)("size", m_size.isReferenced() ? ref(m_size) : m_size));
45 props.push_back(NEW(ArrayElement)("parent", m_parent.isReferenced() ? ref(m_parent) : m_parent));
46 c_ObjectData::o_get(props);
48 bool c_linkholderarray::o_exists(CStrRef s, int64 hash) const {
49 if (hash < 0) hash = hash_string(s.data(), s.length());
50 switch (hash & 7) {
51 case 3:
52 HASH_EXISTS_STRING(0x69A9269F8FE824A3LL, internals, 9);
53 break;
54 case 4:
55 HASH_EXISTS_STRING(0x16E2F26FFB10FD8CLL, parent, 6);
56 break;
57 case 5:
58 HASH_EXISTS_STRING(0x7FD8492E01593115LL, interwikis, 10);
59 break;
60 case 7:
61 HASH_EXISTS_STRING(0x3FE8023BDF261C0FLL, size, 4);
62 break;
63 default:
64 break;
66 return c_ObjectData::o_exists(s, hash);
68 Variant c_linkholderarray::o_get(CStrRef s, int64 hash) {
69 if (hash < 0) hash = hash_string(s.data(), s.length());
70 switch (hash & 7) {
71 case 3:
72 HASH_RETURN_STRING(0x69A9269F8FE824A3LL, m_internals,
73 internals, 9);
74 break;
75 case 4:
76 HASH_RETURN_STRING(0x16E2F26FFB10FD8CLL, m_parent,
77 parent, 6);
78 break;
79 case 5:
80 HASH_RETURN_STRING(0x7FD8492E01593115LL, m_interwikis,
81 interwikis, 10);
82 break;
83 case 7:
84 HASH_RETURN_STRING(0x3FE8023BDF261C0FLL, m_size,
85 size, 4);
86 break;
87 default:
88 break;
90 return c_ObjectData::o_get(s, hash);
92 Variant c_linkholderarray::o_set(CStrRef s, int64 hash, CVarRef v,bool forInit /* = false */) {
93 if (hash < 0) hash = hash_string(s.data(), s.length());
94 switch (hash & 7) {
95 case 3:
96 HASH_SET_STRING(0x69A9269F8FE824A3LL, m_internals,
97 internals, 9);
98 break;
99 case 4:
100 HASH_SET_STRING(0x16E2F26FFB10FD8CLL, m_parent,
101 parent, 6);
102 break;
103 case 5:
104 HASH_SET_STRING(0x7FD8492E01593115LL, m_interwikis,
105 interwikis, 10);
106 break;
107 case 7:
108 HASH_SET_STRING(0x3FE8023BDF261C0FLL, m_size,
109 size, 4);
110 break;
111 default:
112 break;
114 return c_ObjectData::o_set(s, hash, v, forInit);
116 Variant &c_linkholderarray::o_lval(CStrRef s, int64 hash) {
117 if (hash < 0) hash = hash_string(s.data(), s.length());
118 switch (hash & 7) {
119 case 3:
120 HASH_RETURN_STRING(0x69A9269F8FE824A3LL, m_internals,
121 internals, 9);
122 break;
123 case 4:
124 HASH_RETURN_STRING(0x16E2F26FFB10FD8CLL, m_parent,
125 parent, 6);
126 break;
127 case 5:
128 HASH_RETURN_STRING(0x7FD8492E01593115LL, m_interwikis,
129 interwikis, 10);
130 break;
131 case 7:
132 HASH_RETURN_STRING(0x3FE8023BDF261C0FLL, m_size,
133 size, 4);
134 break;
135 default:
136 break;
138 return c_ObjectData::o_lval(s, hash);
140 Variant c_linkholderarray::os_constant(const char *s) {
141 return c_ObjectData::os_constant(s);
143 IMPLEMENT_CLASS(linkholderarray)
144 ObjectData *c_linkholderarray::create(Variant v_parent) {
145 init();
146 t___construct(v_parent);
147 return this;
149 ObjectData *c_linkholderarray::dynCreate(CArrRef params, bool init /* = true */) {
150 if (init) {
151 return (create(params.rvalAt(0)));
152 } else return this;
154 void c_linkholderarray::dynConstruct(CArrRef params) {
155 (t___construct(params.rvalAt(0)));
157 void c_linkholderarray::destruct() {
158 if (!inCtorDtor()) {
159 incRefCount();
160 try {
161 t___destruct();
162 } catch (...) { handle_destructor_exception();}
165 ObjectData *c_linkholderarray::cloneImpl() {
166 c_linkholderarray *obj = NEW(c_linkholderarray)();
167 cloneSet(obj);
168 return obj;
170 void c_linkholderarray::cloneSet(c_linkholderarray *clone) {
171 clone->m_internals = m_internals.isReferenced() ? ref(m_internals) : m_internals;
172 clone->m_interwikis = m_interwikis.isReferenced() ? ref(m_interwikis) : m_interwikis;
173 clone->m_size = m_size.isReferenced() ? ref(m_size) : m_size;
174 clone->m_parent = m_parent.isReferenced() ? ref(m_parent) : m_parent;
175 ObjectData::cloneSet(clone);
177 Variant c_linkholderarray::o_invoke(const char *s, CArrRef params, int64 hash, bool fatal) {
178 if (hash < 0) hash = hash_string_i(s);
179 switch (hash & 15) {
180 case 3:
181 HASH_GUARD(0x7F974836AACC1EF3LL, __destruct) {
182 return (t___destruct());
184 break;
185 case 5:
186 HASH_GUARD(0x0B6C33D73053B0C5LL, makeholder) {
187 int count = params.size();
188 if (count <= 1) return (t_makeholder(params.rvalAt(0)));
189 if (count == 2) return (t_makeholder(params.rvalAt(0), params.rvalAt(1)));
190 if (count == 3) return (t_makeholder(params.rvalAt(0), params.rvalAt(1), params.rvalAt(2)));
191 if (count == 4) return (t_makeholder(params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3)));
192 return (t_makeholder(params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4)));
194 break;
195 case 6:
196 HASH_GUARD(0x316E7B92ECA74146LL, replacetext) {
197 return (t_replacetext(params.rvalAt(0)));
199 HASH_GUARD(0x42FAC655280A6146LL, replace) {
200 return (t_replace(ref(const_cast<Array&>(params).lvalAt(0))));
202 break;
203 case 11:
204 HASH_GUARD(0x1C2E89C2A927FF7BLL, merge) {
205 return (t_merge(params.rvalAt(0)), null);
207 break;
208 case 14:
209 HASH_GUARD(0x1D72607A7BDD782ELL, replacetextcallback) {
210 return (t_replacetextcallback(params.rvalAt(0)));
212 break;
213 case 15:
214 HASH_GUARD(0x0D31D0AC229C615FLL, __construct) {
215 return (t___construct(params.rvalAt(0)), null);
217 break;
218 default:
219 break;
221 return c_ObjectData::o_invoke(s, params, hash, fatal);
223 Variant c_linkholderarray::o_invoke_few_args(const char *s, int64 hash, int count, CVarRef a0, CVarRef a1, CVarRef a2, CVarRef a3, CVarRef a4, CVarRef a5) {
224 if (hash < 0) hash = hash_string_i(s);
225 switch (hash & 15) {
226 case 3:
227 HASH_GUARD(0x7F974836AACC1EF3LL, __destruct) {
228 return (t___destruct());
230 break;
231 case 5:
232 HASH_GUARD(0x0B6C33D73053B0C5LL, makeholder) {
233 if (count <= 1) return (t_makeholder(a0));
234 if (count == 2) return (t_makeholder(a0, a1));
235 if (count == 3) return (t_makeholder(a0, a1, a2));
236 if (count == 4) return (t_makeholder(a0, a1, a2, a3));
237 return (t_makeholder(a0, a1, a2, a3, a4));
239 break;
240 case 6:
241 HASH_GUARD(0x316E7B92ECA74146LL, replacetext) {
242 return (t_replacetext(a0));
244 HASH_GUARD(0x42FAC655280A6146LL, replace) {
245 return (t_replace(ref(a0)));
247 break;
248 case 11:
249 HASH_GUARD(0x1C2E89C2A927FF7BLL, merge) {
250 return (t_merge(a0), null);
252 break;
253 case 14:
254 HASH_GUARD(0x1D72607A7BDD782ELL, replacetextcallback) {
255 return (t_replacetextcallback(a0));
257 break;
258 case 15:
259 HASH_GUARD(0x0D31D0AC229C615FLL, __construct) {
260 return (t___construct(a0), null);
262 break;
263 default:
264 break;
266 return c_ObjectData::o_invoke_few_args(s, hash, count, a0, a1, a2, a3, a4, a5);
268 Variant c_linkholderarray::os_invoke(const char *c, const char *s, CArrRef params, int64 hash, bool fatal) {
269 return c_ObjectData::os_invoke(c, s, params, hash, fatal);
271 Variant cw_linkholderarray$os_get(const char *s) {
272 return c_linkholderarray::os_get(s, -1);
274 Variant &cw_linkholderarray$os_lval(const char *s) {
275 return c_linkholderarray::os_lval(s, -1);
277 Variant cw_linkholderarray$os_constant(const char *s) {
278 return c_linkholderarray::os_constant(s);
280 Variant cw_linkholderarray$os_invoke(const char *c, const char *s, CArrRef params, bool fatal /* = true */) {
281 return c_linkholderarray::os_invoke(c, s, params, -1, fatal);
283 void c_linkholderarray::init() {
284 m_internals = ScalarArrays::sa_[0];
285 m_interwikis = ScalarArrays::sa_[0];
286 m_size = 0LL;
287 m_parent = null;
289 /* SRC: LinkHolderArray.php line 8 */
290 void c_linkholderarray::t___construct(Variant v_parent) {
291 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::__construct);
292 bool oldInCtor = gasInCtor(true);
293 (m_parent = v_parent);
294 gasInCtor(oldInCtor);
295 } /* function */
296 /* SRC: LinkHolderArray.php line 15 */
297 Variant c_linkholderarray::t___destruct() {
298 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::__destruct);
299 setInDtor();
300 DECLARE_GLOBAL_VARIABLES(g);
301 Primitive v_name = 0;
302 Variant v_value;
305 LOOP_COUNTER(1);
306 Variant map2 = ((Object)(this));
307 for (ArrayIterPtr iter3 = map2.begin("linkholderarray"); !iter3->end(); iter3->next()) {
308 LOOP_COUNTER_CHECK(1);
309 v_value = iter3->second();
310 v_name = iter3->first();
312 t___unset(toString(v_name));
316 return null;
317 } /* function */
318 /* SRC: LinkHolderArray.php line 24 */
319 void c_linkholderarray::t_merge(CVarRef v_other) {
320 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::merge);
321 Primitive v_ns = 0;
322 Variant v_entries;
325 LOOP_COUNTER(4);
326 Variant map5 = toObject(v_other).o_get("internals", 0x69A9269F8FE824A3LL);
327 for (ArrayIterPtr iter6 = map5.begin("linkholderarray"); !iter6->end(); iter6->next()) {
328 LOOP_COUNTER_CHECK(4);
329 v_entries = iter6->second();
330 v_ns = iter6->first();
332 m_size += LINE(26,x_count(v_entries));
333 if (!(isset(m_internals, v_ns))) {
334 m_internals.set(v_ns, (v_entries));
336 else {
337 lval(m_internals.lvalAt(v_ns)) += v_entries;
342 m_interwikis += toObject(v_other).o_get("interwikis", 0x7FD8492E01593115LL);
343 } /* function */
344 /* SRC: LinkHolderArray.php line 39 */
345 bool c_linkholderarray::t_isbig() {
346 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::isBig);
347 DECLARE_GLOBAL_VARIABLES(g);
348 Variant &gv_wgLinkHolderBatchSize __attribute__((__unused__)) = g->GV(wgLinkHolderBatchSize);
349 return more(m_size, gv_wgLinkHolderBatchSize);
350 } /* function */
351 /* SRC: LinkHolderArray.php line 48 */
352 void c_linkholderarray::t_clear() {
353 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::clear);
354 (m_internals = ScalarArrays::sa_[0]);
355 (m_interwikis = ScalarArrays::sa_[0]);
356 (m_size = 0LL);
357 } /* function */
358 /* SRC: LinkHolderArray.php line 61 */
359 String c_linkholderarray::t_makeholder(CVarRef v_nt, CVarRef v_text // = ""
360 , CVarRef v_query // = ""
361 , Variant v_trail // = ""
362 , CVarRef v_prefix // = ""
364 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::makeHolder);
365 Variant eo_0;
366 Variant eo_1;
367 Variant eo_2;
368 String v_retVal;
369 Variant v_inside;
370 Variant v_entry;
371 Variant v_key;
372 Variant v_ns;
374 LINE(62,invoke_failed("wfprofilein", Array(ArrayInit(1).set(0, "LinkHolderArray::makeHolder").create()), 0x0000000075359BAFLL));
375 if (!(LINE(63,x_is_object(v_nt)))) {
376 (v_retVal = LINE(65,concat4("<!-- ERROR -->", toString(v_prefix), toString(v_text), toString(v_trail))));
378 else {
379 df_lambda_1(LINE(68,throw_fatal("unknown class linker", ((void*)NULL))), v_inside, v_trail);
380 (v_entry = (assignCallTemp(eo_0, v_nt),assignCallTemp(eo_1, LINE(72,concat3(toString(v_prefix), toString(v_text), toString(v_inside)))),assignCallTemp(eo_2, LINE(73,toObject(v_nt)->o_invoke_few_args("getPrefixedDBkey", 0x3E327BDC66DECDABLL, 0))),Array(ArrayInit(3).set(0, "title", eo_0, 0x66AD900A2301E2FELL).set(1, "text", eo_1, 0x2A28A0084DD3A743LL).set(2, "pdbk", eo_2, 0x18B80C52A2E3FCC5LL).create())));
381 if (!same(v_query, "")) {
382 v_entry.set("query", (v_query), 0x10A98E9AE3F54806LL);
384 if (toBoolean(LINE(79,toObject(v_nt)->o_invoke_few_args("isExternal", 0x16F7C0178CF6E138LL, 0)))) {
385 (v_key = LINE(81,m_parent.o_invoke_few_args("nextLinkID", 0x6EFD1FF8956DBC27LL, 0)));
386 m_interwikis.set(v_key, (v_entry));
387 (v_retVal = LINE(83,concat4("<!--IWLINK ", toString(v_key), "-->", toString(v_trail))));
389 else {
390 (v_key = LINE(85,m_parent.o_invoke_few_args("nextLinkID", 0x6EFD1FF8956DBC27LL, 0)));
391 (v_ns = LINE(86,toObject(v_nt)->o_invoke_few_args("getNamespace", 0x6DC05480D007D522LL, 0)));
392 lval(m_internals.lvalAt(v_ns)).set(v_key, (v_entry));
393 (v_retVal = LINE(88,concat6("<!--LINK ", toString(v_ns), ":", toString(v_key), "-->", toString(v_trail))));
395 m_size++;
397 LINE(92,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::makeHolder").create()), 0x00000000B599F276LL));
398 return v_retVal;
399 } /* function */
400 /* SRC: LinkHolderArray.php line 99 */
401 Variant c_linkholderarray::t_getstubthreshold() {
402 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::getStubThreshold);
403 DECLARE_GLOBAL_VARIABLES(g);
404 Variant &gv_wgUser __attribute__((__unused__)) = g->GV(wgUser);
405 if (!(t___isset("stubThreshold"))) {
406 (o_lval("stubThreshold", 0x1995F66FB30F7BC5LL) = LINE(102,gv_wgUser.o_invoke_few_args("getOption", 0x402DD1A85CAEA6C0LL, 1, "stubthreshold")));
408 return o_get("stubThreshold", 0x1995F66FB30F7BC5LL);
409 } /* function */
410 /* SRC: LinkHolderArray.php line 113 */
411 Variant c_linkholderarray::t_replace(Variant v_text) {
412 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::replace);
413 Variant v_colours;
415 LINE(114,invoke_failed("wfprofilein", Array(ArrayInit(1).set(0, "LinkHolderArray::replace").create()), 0x0000000075359BAFLL));
416 (v_colours = (LINE(116,t_replaceinternal(ref(v_text))), null));
417 LINE(117,t_replaceinterwiki(ref(v_text)));
418 LINE(119,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::replace").create()), 0x00000000B599F276LL));
419 return v_colours;
420 } /* function */
421 /* SRC: LinkHolderArray.php line 126 */
422 void c_linkholderarray::t_replaceinternal(Variant v_text) {
423 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::replaceInternal);
424 Variant eo_0;
425 Variant eo_1;
426 Variant eo_2;
427 Variant eo_3;
428 Variant eo_4;
429 Variant eo_5;
430 DECLARE_GLOBAL_VARIABLES(g);
431 Variant &gv_wgContLang __attribute__((__unused__)) = g->GV(wgContLang);
432 Variant v_wgContLang;
433 Variant v_colours;
434 Variant v_sk;
435 Variant v_linkCache;
436 Variant v_output;
437 Variant v_dbr;
438 Variant v_page;
439 Variant v_threshold;
440 Variant v_query;
441 Variant v_current;
442 Primitive v_ns = 0;
443 Variant v_entries;
444 Primitive v_index = 0;
445 Variant v_entry;
446 String v_key;
447 Variant v_title;
448 Variant v_pdbk;
449 Variant v_id;
450 Variant v_res;
451 Variant v_linkcolour_ids;
452 Variant v_s;
453 Variant v_replacePairs;
454 String v_searchkey;
455 Object v_replacer;
457 if (!(toBoolean(m_internals))) {
458 return;
460 LINE(131,invoke_failed("wfprofilein", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInternal").create()), 0x0000000075359BAFLL));
461 v_wgContLang = ref(g->GV(wgContLang));
462 (v_colours = ScalarArrays::sa_[0]);
463 (v_sk = (assignCallTemp(eo_0, toObject(LINE(135,m_parent.o_invoke_few_args("getOptions", 0x2040B36587CE56F9LL, 0)))),eo_0.o_invoke_few_args("getSkin", 0x6C79601E06BA735FLL, 0)));
464 (v_linkCache = LINE(136,throw_fatal("unknown class linkcache", ((void*)NULL))));
465 (v_output = LINE(137,m_parent.o_invoke_few_args("getOutput", 0x7519C1FAF33D7857LL, 0)));
466 LINE(139,invoke_failed("wfprofilein", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInternal-check").create()), 0x0000000075359BAFLL));
467 (v_dbr = LINE(140,invoke_failed("wfgetdb", Array(ArrayInit(1).set(0, k_DB_SLAVE).create()), 0x000000002DA3FF23LL)));
468 (v_page = LINE(141,v_dbr.o_invoke_few_args("tableName", 0x15769EF1E0936722LL, 1, "page")));
469 (v_threshold = LINE(142,t_getstubthreshold()));
470 LINE(145,x_ksort(ref(lval(m_internals))));
471 (v_query = false);
472 setNull(v_current);
474 LOOP_COUNTER(7);
475 Variant map8 = m_internals;
476 for (ArrayIterPtr iter9 = map8.begin("linkholderarray"); !iter9->end(); iter9->next()) {
477 LOOP_COUNTER_CHECK(7);
478 v_entries = iter9->second();
479 v_ns = iter9->first();
482 LOOP_COUNTER(10);
483 for (ArrayIterPtr iter12 = v_entries.begin("linkholderarray"); !iter12->end(); iter12->next()) {
484 LOOP_COUNTER_CHECK(10);
485 v_entry = iter12->second();
486 v_index = iter12->first();
488 (v_key = LINE(152,concat3(toString(v_ns), ":", toString(v_index))));
489 (v_title = v_entry.rvalAt("title", 0x66AD900A2301E2FELL));
490 (v_pdbk = v_entry.rvalAt("pdbk", 0x18B80C52A2E3FCC5LL));
491 if (LINE(158,x_is_null(v_title))) {
492 continue;
494 if (toBoolean(LINE(163,v_title.o_invoke_few_args("isAlwaysKnown", 0x32DB35272B7DDB90LL, 0)))) {
495 v_colours.set(v_pdbk, (""));
497 else if (!equal(((v_id = LINE(165,v_linkCache.o_invoke_few_args("getGoodLinkID", 0x318581EFAFF78639LL, 1, v_pdbk)))), 0LL)) {
498 v_colours.set(v_pdbk, (LINE(166,v_sk.o_invoke_few_args("getLinkColour", 0x0EBA9C609550DE93LL, 2, v_title, v_threshold))));
499 LINE(167,v_output.o_invoke_few_args("addLink", 0x5D10AC6ADCA895ACLL, 2, v_title, v_id));
501 else if (toBoolean(LINE(168,v_linkCache.o_invoke_few_args("isBadLink", 0x45DC57467F969616LL, 1, v_pdbk)))) {
502 v_colours.set(v_pdbk, ("new"));
504 else {
505 if (!(isset(v_current))) {
506 (v_current = v_ns);
507 (v_query = concat("SELECT page_id, page_namespace, page_title, page_is_redirect, page_len", LINE(175,concat5(" FROM ", toString(v_page), " WHERE (page_namespace=", toString(v_ns), " AND page_title IN("))));
509 else if (!equal(v_current, v_ns)) {
510 (v_current = v_ns);
511 concat_assign(v_query, LINE(178,concat3(")) OR (page_namespace=", toString(v_ns), " AND page_title IN(")));
513 else {
514 concat_assign(v_query, ", ");
516 concat_assign(v_query, toString(LINE(183,v_dbr.o_invoke_few_args("addQuotes", 0x3D76A2E50E13EE4CLL, 1, v_title.o_invoke_few_args("getDBkey", 0x7A72F137192AEF00LL, 0)))));
524 if (toBoolean(v_query)) {
525 concat_assign(v_query, "))");
526 (v_res = LINE(190,v_dbr.o_invoke_few_args("query", 0x356758D4414DA377LL, 2, v_query, "LinkHolderArray::replaceInternal")));
527 (v_linkcolour_ids = ScalarArrays::sa_[0]);
528 LOOP_COUNTER(13);
530 while (toBoolean((v_s = LINE(195,v_dbr.o_invoke_few_args("fetchObject", 0x0E1814AA3327229DLL, 1, v_res))))) {
531 LOOP_COUNTER_CHECK(13);
533 (v_title = LINE(196,throw_fatal("unknown class title", ((void*)NULL))));
534 (v_pdbk = LINE(197,v_title.o_invoke_few_args("getPrefixedDBkey", 0x3E327BDC66DECDABLL, 0)));
535 LINE(198,v_linkCache.o_invoke_few_args("addGoodLinkObj", 0x70697DC360D0776ALL, 4, v_s.o_lval("page_id", 0x1B27A324993FB16CLL), v_title, v_s.o_lval("page_len", 0x2295E5F4A5F7AD5DLL), v_s.o_lval("page_is_redirect", 0x0F78ED8A1BDCEA05LL)));
536 LINE(199,v_output.o_invoke_few_args("addLink", 0x5D10AC6ADCA895ACLL, 2, v_title, v_s.o_lval("page_id", 0x1B27A324993FB16CLL)));
537 v_colours.set(v_pdbk, (LINE(203,v_sk.o_invoke_few_args("getLinkColour", 0x0EBA9C609550DE93LL, 2, v_title, v_threshold))));
538 v_linkcolour_ids.set(v_s.o_get("page_id", 0x1B27A324993FB16CLL), (v_pdbk));
542 unset(v_res);
543 LINE(209,invoke_failed("wfrunhooks", Array(ArrayInit(2).set(0, "GetLinkColours").set(1, Array(ArrayInit(2).set(0, v_linkcolour_ids).setRef(1, ref(v_colours)).create())).create()), 0x00000000787A96B2LL));
545 LINE(211,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInternal-check").create()), 0x00000000B599F276LL));
546 if (toBoolean(LINE(214,v_wgContLang.o_invoke_few_args("hasVariants", 0x5A1FD2E20BD8DBBBLL, 0)))) {
547 LINE(215,t_dovariants(ref(v_colours)));
549 LINE(219,invoke_failed("wfprofilein", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInternal-construct").create()), 0x0000000075359BAFLL));
550 (v_replacePairs = ScalarArrays::sa_[0]);
552 LOOP_COUNTER(14);
553 Variant map15 = m_internals;
554 for (ArrayIterPtr iter16 = map15.begin("linkholderarray"); !iter16->end(); iter16->next()) {
555 LOOP_COUNTER_CHECK(14);
556 v_entries = iter16->second();
557 v_ns = iter16->first();
560 LOOP_COUNTER(17);
561 for (ArrayIterPtr iter19 = v_entries.begin("linkholderarray"); !iter19->end(); iter19->next()) {
562 LOOP_COUNTER_CHECK(17);
563 v_entry = iter19->second();
564 v_index = iter19->first();
566 (v_pdbk = v_entry.rvalAt("pdbk", 0x18B80C52A2E3FCC5LL));
567 (v_title = v_entry.rvalAt("title", 0x66AD900A2301E2FELL));
568 (v_query = isset(v_entry, "query", 0x10A98E9AE3F54806LL) ? ((Variant)(v_entry.rvalAt("query", 0x10A98E9AE3F54806LL))) : ((Variant)("")));
569 (v_key = LINE(226,concat3(toString(v_ns), ":", toString(v_index))));
570 (v_searchkey = LINE(227,concat3("<!--LINK ", v_key, "-->")));
571 if (!(isset(v_colours, v_pdbk)) || equal(v_colours.rvalAt(v_pdbk), "new")) {
572 LINE(229,v_linkCache.o_invoke_few_args("addBadLinkObj", 0x6D7C22FD99A36EDBLL, 1, v_title));
573 v_colours.set(v_pdbk, ("new"));
574 LINE(231,v_output.o_invoke_few_args("addLink", 0x5D10AC6ADCA895ACLL, 2, v_title, 0LL));
575 v_replacePairs.set(v_searchkey, ((assignCallTemp(eo_1, toObject(v_sk)),LINE(235,eo_1.o_invoke_few_args("makeBrokenLinkObj", 0x2A9E5694CCAA3096LL, 3, v_title, v_entry.refvalAt("text", 0x2A28A0084DD3A743LL), v_query)))));
577 else {
578 v_replacePairs.set(v_searchkey, ((assignCallTemp(eo_2, toObject(v_sk)),LINE(240,eo_2.o_invoke_few_args("makeColouredLinkObj", 0x7BAFB7ABE2AF59F0LL, 4, v_title, v_colours.refvalAt(v_pdbk), v_entry.refvalAt("text", 0x2A28A0084DD3A743LL), v_query)))));
586 (v_replacer = LINE(244,create_object("hashtablereplacer", Array(ArrayInit(2).set(0, v_replacePairs).set(1, 1LL).create()))));
587 LINE(245,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInternal-construct").create()), 0x00000000B599F276LL));
588 LINE(248,invoke_failed("wfprofilein", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInternal-replace").create()), 0x0000000075359BAFLL));
589 (v_text = LINE(252,(assignCallTemp(eo_4, LINE(251,v_replacer->o_invoke_few_args("cb", 0x02412237A7302F0ALL, 0))),assignCallTemp(eo_5, v_text),x_preg_replace_callback("/(<!--LINK .*\?-->)/", eo_4, eo_5))));
590 LINE(254,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInternal-replace").create()), 0x00000000B599F276LL));
591 LINE(255,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInternal").create()), 0x00000000B599F276LL));
592 } /* function */
593 /* SRC: LinkHolderArray.php line 261 */
594 void c_linkholderarray::t_replaceinterwiki(Variant v_text) {
595 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::replaceInterwiki);
596 Variant eo_0;
597 Variant eo_1;
598 Variant eo_2;
599 Variant eo_3;
600 Variant v_sk;
601 Variant v_replacePairs;
602 Primitive v_key = 0;
603 Variant v_link;
604 Object v_replacer;
606 if (empty(m_interwikis)) {
607 return;
609 LINE(266,invoke_failed("wfprofilein", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInterwiki").create()), 0x0000000075359BAFLL));
610 (v_sk = (assignCallTemp(eo_0, toObject(LINE(268,m_parent.o_invoke_few_args("getOptions", 0x2040B36587CE56F9LL, 0)))),eo_0.o_invoke_few_args("getSkin", 0x6C79601E06BA735FLL, 0)));
611 (v_replacePairs = ScalarArrays::sa_[0]);
613 LOOP_COUNTER(20);
614 Variant map21 = m_interwikis;
615 for (ArrayIterPtr iter22 = map21.begin("linkholderarray"); !iter22->end(); iter22->next()) {
616 LOOP_COUNTER_CHECK(20);
617 v_link = iter22->second();
618 v_key = iter22->first();
620 v_replacePairs.set(v_key, (LINE(271,v_sk.o_invoke_few_args("link", 0x230FE1D6EC599525LL, 2, v_link.refvalAt("title", 0x66AD900A2301E2FELL), v_link.refvalAt("text", 0x2A28A0084DD3A743LL)))));
624 (v_replacer = LINE(273,create_object("hashtablereplacer", Array(ArrayInit(2).set(0, v_replacePairs).set(1, 1LL).create()))));
625 (v_text = LINE(278,(assignCallTemp(eo_2, LINE(277,v_replacer->o_invoke_few_args("cb", 0x02412237A7302F0ALL, 0))),assignCallTemp(eo_3, v_text),x_preg_replace_callback("/<!--IWLINK (.*\?)-->/", eo_2, eo_3))));
626 LINE(279,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceInterwiki").create()), 0x00000000B599F276LL));
627 } /* function */
628 /* SRC: LinkHolderArray.php line 285 */
629 void c_linkholderarray::t_dovariants(Variant v_colours) {
630 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::doVariants);
631 Variant eo_0;
632 DECLARE_GLOBAL_VARIABLES(g);
633 Variant &gv_wgContLang __attribute__((__unused__)) = g->GV(wgContLang);
634 Object v_linkBatch;
635 Variant v_variantMap;
636 Variant v_output;
637 Variant v_linkCache;
638 Variant v_sk;
639 Variant v_threshold;
640 Variant v_ns;
641 Variant v_entries;
642 Variant v_index;
643 Variant v_entry;
644 Variant v_key;
645 Variant v_pdbk;
646 Variant v_title;
647 Variant v_titleText;
648 Variant v_allTextVariants;
649 Variant v_textVariant;
650 Variant v_variantTitle;
651 Variant v_categoryMap;
652 Variant v_varCategories;
653 Variant v_category;
654 Variant v_variants;
655 Variant v_variant;
656 Variant v_dbr;
657 Variant v_page;
658 Variant v_titleClause;
659 Variant v_variantQuery;
660 Variant v_varRes;
661 Variant v_linkcolour_ids;
662 Variant v_s;
663 Variant v_varPdbk;
664 Variant v_vardbk;
665 Variant v_holderKeys;
666 Variant v_oldkey;
667 Variant v_newCats;
668 Variant v_originalCats;
669 Primitive v_cat = 0;
670 Variant v_sortkey;
672 (v_linkBatch = LINE(287,create_object("linkbatch", Array())));
673 (v_variantMap = ScalarArrays::sa_[0]);
674 (v_output = LINE(289,m_parent.o_invoke_few_args("getOutput", 0x7519C1FAF33D7857LL, 0)));
675 (v_linkCache = LINE(290,throw_fatal("unknown class linkcache", ((void*)NULL))));
676 (v_sk = (assignCallTemp(eo_0, toObject(LINE(291,m_parent.o_invoke_few_args("getOptions", 0x2040B36587CE56F9LL, 0)))),eo_0.o_invoke_few_args("getSkin", 0x6C79601E06BA735FLL, 0)));
677 (v_threshold = LINE(292,t_getstubthreshold()));
679 LOOP_COUNTER(23);
680 Variant map24 = m_internals;
681 for (ArrayIterPtr iter25 = map24.begin("linkholderarray"); !iter25->end(); iter25->next()) {
682 LOOP_COUNTER_CHECK(23);
683 v_entries = iter25->second();
684 v_ns = iter25->first();
687 LOOP_COUNTER(26);
688 for (ArrayIterPtr iter28 = v_entries.begin("linkholderarray"); !iter28->end(); iter28->next()) {
689 LOOP_COUNTER_CHECK(26);
690 v_entry = iter28->second();
691 v_index = iter28->first();
693 (v_key = LINE(297,concat3(toString(v_ns), ":", toString(v_index))));
694 (v_pdbk = v_entry.rvalAt("pdbk", 0x18B80C52A2E3FCC5LL));
695 (v_title = v_entry.rvalAt("title", 0x66AD900A2301E2FELL));
696 (v_titleText = LINE(300,v_title.o_invoke_few_args("getText", 0x434CEBEC8FDBB880LL, 0)));
697 (v_allTextVariants = LINE(303,gv_wgContLang.o_invoke_few_args("convertLinkToAllVariants", 0x276E1379FA1C5660LL, 1, v_titleText)));
698 if (!(isset(v_colours, v_pdbk))) {
700 LOOP_COUNTER(29);
701 for (ArrayIterPtr iter31 = v_allTextVariants.begin("linkholderarray"); !iter31->end(); iter31->next()) {
702 LOOP_COUNTER_CHECK(29);
703 v_textVariant = iter31->second();
705 if (!equal(v_textVariant, v_titleText)) {
706 (v_variantTitle = LINE(309,throw_fatal("unknown class title", ((void*)NULL))));
707 if (LINE(310,x_is_null(v_variantTitle))) continue;
708 LINE(311,v_linkBatch->o_invoke_few_args("addObj", 0x7083015404130661LL, 1, v_variantTitle));
709 lval(v_variantMap.lvalAt(LINE(312,v_variantTitle.o_invoke_few_args("getPrefixedDBkey", 0x3E327BDC66DECDABLL, 0)))).append((v_key));
721 (v_categoryMap = ScalarArrays::sa_[0]);
722 (v_varCategories = ScalarArrays::sa_[0]);
724 LOOP_COUNTER(32);
725 Variant map33 = LINE(322,v_output.o_invoke_few_args("getCategoryLinks", 0x3374D72DB895979FLL, 0));
726 for (ArrayIterPtr iter34 = map33.begin("linkholderarray"); !iter34->end(); iter34->next()) {
727 LOOP_COUNTER_CHECK(32);
728 v_category = iter34->second();
730 (v_variants = LINE(323,gv_wgContLang.o_invoke_few_args("convertLinkToAllVariants", 0x276E1379FA1C5660LL, 1, v_category)));
732 LOOP_COUNTER(35);
733 for (ArrayIterPtr iter37 = v_variants.begin("linkholderarray"); !iter37->end(); iter37->next()) {
734 LOOP_COUNTER_CHECK(35);
735 v_variant = iter37->second();
737 if (!equal(v_variant, v_category)) {
738 (v_variantTitle = LINE(326,throw_fatal("unknown class title", (throw_fatal("unknown class title", ((void*)NULL)), (void*)NULL))));
739 if (LINE(327,x_is_null(v_variantTitle))) continue;
740 LINE(328,v_linkBatch->o_invoke_few_args("addObj", 0x7083015404130661LL, 1, v_variantTitle));
741 v_categoryMap.set(v_variant, (v_category));
749 if (!(toBoolean(LINE(335,v_linkBatch->o_invoke_few_args("isEmpty", 0x6359F42D5FC265E8LL, 0))))) {
750 (v_dbr = LINE(337,invoke_failed("wfgetdb", Array(ArrayInit(1).set(0, k_DB_SLAVE).create()), 0x000000002DA3FF23LL)));
751 (v_page = LINE(338,v_dbr.o_invoke_few_args("tableName", 0x15769EF1E0936722LL, 1, "page")));
752 (v_titleClause = LINE(339,v_linkBatch->o_invoke_few_args("constructSet", 0x3E448E4FAA1093BALL, 2, "page", v_dbr)));
753 (v_variantQuery = concat("SELECT page_id, page_namespace, page_title, page_is_redirect, page_len", LINE(341,concat4(" FROM ", toString(v_page), " WHERE ", toString(v_titleClause)))));
754 (v_varRes = LINE(342,v_dbr.o_invoke_few_args("query", 0x356758D4414DA377LL, 2, v_variantQuery, "LinkHolderArray::doVariants")));
755 (v_linkcolour_ids = ScalarArrays::sa_[0]);
756 LOOP_COUNTER(38);
758 while (toBoolean((v_s = LINE(346,v_dbr.o_invoke_few_args("fetchObject", 0x0E1814AA3327229DLL, 1, v_varRes))))) {
759 LOOP_COUNTER_CHECK(38);
761 (v_variantTitle = LINE(348,throw_fatal("unknown class title", ((void*)NULL))));
762 (v_varPdbk = LINE(349,v_variantTitle.o_invoke_few_args("getPrefixedDBkey", 0x3E327BDC66DECDABLL, 0)));
763 (v_vardbk = LINE(350,v_variantTitle.o_invoke_few_args("getDBkey", 0x7A72F137192AEF00LL, 0)));
764 (v_holderKeys = ScalarArrays::sa_[0]);
765 if (isset(v_variantMap, v_varPdbk)) {
766 (v_holderKeys = v_variantMap.rvalAt(v_varPdbk));
767 LINE(355,v_linkCache.o_invoke_few_args("addGoodLinkObj", 0x70697DC360D0776ALL, 4, v_s.o_lval("page_id", 0x1B27A324993FB16CLL), v_variantTitle, v_s.o_lval("page_len", 0x2295E5F4A5F7AD5DLL), v_s.o_lval("page_is_redirect", 0x0F78ED8A1BDCEA05LL)));
768 LINE(356,v_output.o_invoke_few_args("addLink", 0x5D10AC6ADCA895ACLL, 2, v_variantTitle, v_s.o_lval("page_id", 0x1B27A324993FB16CLL)));
771 LOOP_COUNTER(39);
772 for (ArrayIterPtr iter41 = v_holderKeys.begin("linkholderarray"); !iter41->end(); iter41->next()) {
773 LOOP_COUNTER_CHECK(39);
774 v_key = iter41->second();
776 df_lambda_2(LINE(361,x_explode(":", toString(v_key), toInt32(2LL))), v_ns, v_index);
777 (v_entry = ref(lval(lval(m_internals.lvalAt(v_ns)).lvalAt(v_index))));
778 (v_pdbk = v_entry.rvalAt("pdbk", 0x18B80C52A2E3FCC5LL));
779 if (!(isset(v_colours, v_pdbk))) {
780 v_entry.set("title", (v_variantTitle), 0x66AD900A2301E2FELL);
781 v_entry.set("pdbk", (v_varPdbk), 0x18B80C52A2E3FCC5LL);
782 v_colours.set(v_varPdbk, (LINE(374,v_sk.o_invoke_few_args("getLinkColour", 0x0EBA9C609550DE93LL, 2, v_variantTitle, v_threshold))));
783 v_linkcolour_ids.set(v_s.o_get("page_id", 0x1B27A324993FB16CLL), (v_pdbk));
788 if (isset(v_categoryMap, v_vardbk)) {
789 (v_oldkey = v_categoryMap.rvalAt(v_vardbk));
790 if (!equal(v_oldkey, v_vardbk)) v_varCategories.set(v_oldkey, (v_vardbk));
795 LINE(386,invoke_failed("wfrunhooks", Array(ArrayInit(2).set(0, "GetLinkColours").set(1, Array(ArrayInit(2).set(0, v_linkcolour_ids).setRef(1, ref(v_colours)).create())).create()), 0x00000000787A96B2LL));
796 if (more(LINE(389,x_count(v_varCategories)), 0LL)) {
797 (v_newCats = ScalarArrays::sa_[0]);
798 (v_originalCats = LINE(391,v_output.o_invoke_few_args("getCategories", 0x72C61C208667527ELL, 0)));
800 LOOP_COUNTER(42);
801 for (ArrayIterPtr iter44 = v_originalCats.begin("linkholderarray"); !iter44->end(); iter44->next()) {
802 LOOP_COUNTER_CHECK(42);
803 v_sortkey = iter44->second();
804 v_cat = iter44->first();
806 if (LINE(394,x_array_key_exists(v_cat, v_varCategories))) v_newCats.set(v_varCategories.rvalAt(v_cat), (v_sortkey));
807 else v_newCats.set(v_cat, (v_sortkey));
811 LINE(398,v_output.o_invoke_few_args("setCategoryLinks", 0x2295340384610322LL, 1, v_newCats));
814 } /* function */
815 /* SRC: LinkHolderArray.php line 409 */
816 Variant c_linkholderarray::t_replacetext(Variant v_text) {
817 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::replaceText);
818 LINE(410,invoke_failed("wfprofilein", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceText").create()), 0x0000000075359BAFLL));
819 (v_text = LINE(415,x_preg_replace_callback("/<!--(LINK|IWLINK) (.*\?)-->/", Array(ArrayInit(2).setRef(0, ref(this)).set(1, "replaceTextCallback").create()), v_text)));
820 LINE(417,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::replaceText").create()), 0x00000000B599F276LL));
821 return v_text;
822 } /* function */
823 /* SRC: LinkHolderArray.php line 426 */
824 Variant c_linkholderarray::t_replacetextcallback(CVarRef v_matches) {
825 INSTANCE_METHOD_INJECTION(LinkHolderArray, LinkHolderArray::replaceTextCallback);
826 Variant v_type;
827 Variant v_key;
828 Variant v_ns;
829 Variant v_index;
831 (v_type = v_matches.rvalAt(1LL, 0x5BCA7C69B794F8CELL));
832 (v_key = v_matches.rvalAt(2LL, 0x486AFCC090D5F98CLL));
833 if (equal(v_type, "LINK")) {
834 df_lambda_3(LINE(430,x_explode(":", toString(v_key), toInt32(2LL))), v_ns, v_index);
835 if (isset(m_internals.rvalAt(v_ns).rvalAt(v_index), "text", 0x2A28A0084DD3A743LL)) {
836 return m_internals.rvalAt(v_ns).rvalAt(v_index).rvalAt("text", 0x2A28A0084DD3A743LL);
839 else if (equal(v_type, "IWLINK")) {
840 if (isset(m_interwikis.rvalAt(v_key), "text", 0x2A28A0084DD3A743LL)) {
841 return m_interwikis.rvalAt(v_key).rvalAt("text", 0x2A28A0084DD3A743LL);
844 return v_matches.rvalAt(0LL, 0x77CFA1EEF01BCA90LL);
845 } /* function */
846 Object co_linkholderarray(CArrRef params, bool init /* = true */) {
847 return Object(p_linkholderarray(NEW(c_linkholderarray)())->dynCreate(params, init));
849 Variant pm_php$LinkHolderArray_php(bool incOnce /* = false */, LVariableTable* variables /* = NULL */) {
850 FUNCTION_INJECTION(run_init::LinkHolderArray.php);
852 DECLARE_GLOBAL_VARIABLES(g);
853 bool &alreadyRun = g->run_pm_php$LinkHolderArray_php;
854 if (alreadyRun) { if (incOnce) return true;}
855 else alreadyRun = true;
856 if (!variables) variables = g;
858 DECLARE_GLOBAL_VARIABLES(g);
859 LVariableTable *gVariables __attribute__((__unused__)) = get_variable_table();
860 return true;
861 } /* function */
863 ///////////////////////////////////////////////////////////////////////////////