2 #include <php/LinkHolderArray.h>
3 #include <cpp/ext/ext.h>
6 ///////////////////////////////////////////////////////////////////////////////
8 const StaticString k_DB_SLAVE
= "DB_SLAVE";
9 const StaticString k_NS_CATEGORY
= "NS_CATEGORY";
12 inline Variant
df_lambda_1(CVarRef aa
, Variant
&p0
, Variant
&p1
) {
13 Variant a0
; if (aa
.is(KindOfArray
)) a0
= aa
;
19 inline Variant
df_lambda_2(CVarRef aa
, Variant
&p0
, Variant
&p1
) {
20 Variant a0
; if (aa
.is(KindOfArray
)) a0
= aa
;
26 inline Variant
df_lambda_3(CVarRef aa
, Variant
&p0
, Variant
&p1
) {
27 Variant a0
; if (aa
.is(KindOfArray
)) a0
= 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());
52 HASH_EXISTS_STRING(0x69A9269F8FE824A3LL
, internals
, 9);
55 HASH_EXISTS_STRING(0x16E2F26FFB10FD8CLL
, parent
, 6);
58 HASH_EXISTS_STRING(0x7FD8492E01593115LL
, interwikis
, 10);
61 HASH_EXISTS_STRING(0x3FE8023BDF261C0FLL
, size
, 4);
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());
72 HASH_RETURN_STRING(0x69A9269F8FE824A3LL
, m_internals
,
76 HASH_RETURN_STRING(0x16E2F26FFB10FD8CLL
, m_parent
,
80 HASH_RETURN_STRING(0x7FD8492E01593115LL
, m_interwikis
,
84 HASH_RETURN_STRING(0x3FE8023BDF261C0FLL
, m_size
,
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());
96 HASH_SET_STRING(0x69A9269F8FE824A3LL
, m_internals
,
100 HASH_SET_STRING(0x16E2F26FFB10FD8CLL
, m_parent
,
104 HASH_SET_STRING(0x7FD8492E01593115LL
, m_interwikis
,
108 HASH_SET_STRING(0x3FE8023BDF261C0FLL
, m_size
,
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());
120 HASH_RETURN_STRING(0x69A9269F8FE824A3LL
, m_internals
,
124 HASH_RETURN_STRING(0x16E2F26FFB10FD8CLL
, m_parent
,
128 HASH_RETURN_STRING(0x7FD8492E01593115LL
, m_interwikis
,
132 HASH_RETURN_STRING(0x3FE8023BDF261C0FLL
, m_size
,
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
) {
146 t___construct(v_parent
);
149 ObjectData
*c_linkholderarray::dynCreate(CArrRef params
, bool init
/* = true */) {
151 return (create(params
.rvalAt(0)));
154 void c_linkholderarray::dynConstruct(CArrRef params
) {
155 (t___construct(params
.rvalAt(0)));
157 void c_linkholderarray::destruct() {
162 } catch (...) { handle_destructor_exception();}
165 ObjectData
*c_linkholderarray::cloneImpl() {
166 c_linkholderarray
*obj
= NEW(c_linkholderarray
)();
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
);
181 HASH_GUARD(0x7F974836AACC1EF3LL
, __destruct
) {
182 return (t___destruct());
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)));
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))));
204 HASH_GUARD(0x1C2E89C2A927FF7BLL
, merge
) {
205 return (t_merge(params
.rvalAt(0)), null
);
209 HASH_GUARD(0x1D72607A7BDD782ELL
, replacetextcallback
) {
210 return (t_replacetextcallback(params
.rvalAt(0)));
214 HASH_GUARD(0x0D31D0AC229C615FLL
, __construct
) {
215 return (t___construct(params
.rvalAt(0)), null
);
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
);
227 HASH_GUARD(0x7F974836AACC1EF3LL
, __destruct
) {
228 return (t___destruct());
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
));
241 HASH_GUARD(0x316E7B92ECA74146LL
, replacetext
) {
242 return (t_replacetext(a0
));
244 HASH_GUARD(0x42FAC655280A6146LL
, replace
) {
245 return (t_replace(ref(a0
)));
249 HASH_GUARD(0x1C2E89C2A927FF7BLL
, merge
) {
250 return (t_merge(a0
), null
);
254 HASH_GUARD(0x1D72607A7BDD782ELL
, replacetextcallback
) {
255 return (t_replacetextcallback(a0
));
259 HASH_GUARD(0x0D31D0AC229C615FLL
, __construct
) {
260 return (t___construct(a0
), null
);
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];
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
);
296 /* SRC: LinkHolderArray.php line 15 */
297 Variant
c_linkholderarray::t___destruct() {
298 INSTANCE_METHOD_INJECTION(LinkHolderArray
, LinkHolderArray::__destruct
);
300 DECLARE_GLOBAL_VARIABLES(g
);
301 Primitive v_name
= 0;
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
));
318 /* SRC: LinkHolderArray.php line 24 */
319 void c_linkholderarray::t_merge(CVarRef v_other
) {
320 INSTANCE_METHOD_INJECTION(LinkHolderArray
, LinkHolderArray::merge
);
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
));
337 lval(m_internals
.lvalAt(v_ns
)) += v_entries
;
342 m_interwikis
+= toObject(v_other
).o_get("interwikis", 0x7FD8492E01593115LL
);
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
);
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]);
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
);
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
))));
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
))));
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
))));
397 LINE(92,invoke_failed("wfprofileout", Array(ArrayInit(1).set(0, "LinkHolderArray::makeHolder").create()), 0x00000000B599F276LL
));
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
);
410 /* SRC: LinkHolderArray.php line 113 */
411 Variant
c_linkholderarray::t_replace(Variant v_text
) {
412 INSTANCE_METHOD_INJECTION(LinkHolderArray
, LinkHolderArray::replace
);
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
));
421 /* SRC: LinkHolderArray.php line 126 */
422 void c_linkholderarray::t_replaceinternal(Variant v_text
) {
423 INSTANCE_METHOD_INJECTION(LinkHolderArray
, LinkHolderArray::replaceInternal
);
430 DECLARE_GLOBAL_VARIABLES(g
);
431 Variant
&gv_wgContLang
__attribute__((__unused__
)) = g
->GV(wgContLang
);
432 Variant v_wgContLang
;
444 Primitive v_index
= 0;
451 Variant v_linkcolour_ids
;
453 Variant v_replacePairs
;
457 if (!(toBoolean(m_internals
))) {
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
))));
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();
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
))) {
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"));
505 if (!(isset(v_current
))) {
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
)) {
511 concat_assign(v_query
, LINE(178,concat3(")) OR (page_namespace=", toString(v_ns
), " AND page_title IN(")));
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]);
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
));
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]);
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();
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
)))));
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
));
593 /* SRC: LinkHolderArray.php line 261 */
594 void c_linkholderarray::t_replaceinterwiki(Variant v_text
) {
595 INSTANCE_METHOD_INJECTION(LinkHolderArray
, LinkHolderArray::replaceInterwiki
);
601 Variant v_replacePairs
;
606 if (empty(m_interwikis
)) {
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]);
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
));
628 /* SRC: LinkHolderArray.php line 285 */
629 void c_linkholderarray::t_dovariants(Variant v_colours
) {
630 INSTANCE_METHOD_INJECTION(LinkHolderArray
, LinkHolderArray::doVariants
);
632 DECLARE_GLOBAL_VARIABLES(g
);
633 Variant
&gv_wgContLang
__attribute__((__unused__
)) = g
->GV(wgContLang
);
635 Variant v_variantMap
;
648 Variant v_allTextVariants
;
649 Variant v_textVariant
;
650 Variant v_variantTitle
;
651 Variant v_categoryMap
;
652 Variant v_varCategories
;
658 Variant v_titleClause
;
659 Variant v_variantQuery
;
661 Variant v_linkcolour_ids
;
665 Variant v_holderKeys
;
668 Variant v_originalCats
;
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()));
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();
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
))) {
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]);
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
)));
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]);
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
)));
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)));
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
));
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
));
823 /* SRC: LinkHolderArray.php line 426 */
824 Variant
c_linkholderarray::t_replacetextcallback(CVarRef v_matches
) {
825 INSTANCE_METHOD_INJECTION(LinkHolderArray
, LinkHolderArray::replaceTextCallback
);
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
);
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();
863 ///////////////////////////////////////////////////////////////////////////////