update porting to new machine
[wikipedia-parser-hphp.git] / gen / php / CoreLinkFunctions.cpp
blobc53092ad21ea10fe632d187fff8edfe3a22d02cc
2 #include <php/CoreLinkFunctions.h>
3 #include <php/Parser_LinkHooks.h>
4 #include <cpp/ext/ext.h>
6 namespace HPHP {
7 ///////////////////////////////////////////////////////////////////////////////
9 /* preface starts */
10 /* preface finishes */
11 /* SRC: CoreLinkFunctions.php line 7 */
12 Variant c_corelinkfunctions::os_get(const char *s, int64 hash) {
13 return c_ObjectData::os_get(s, hash);
15 Variant &c_corelinkfunctions::os_lval(const char *s, int64 hash) {
16 return c_ObjectData::os_lval(s, hash);
18 void c_corelinkfunctions::o_get(ArrayElementVec &props) const {
19 c_ObjectData::o_get(props);
21 bool c_corelinkfunctions::o_exists(CStrRef s, int64 hash) const {
22 return c_ObjectData::o_exists(s, hash);
24 Variant c_corelinkfunctions::o_get(CStrRef s, int64 hash) {
25 return c_ObjectData::o_get(s, hash);
27 Variant c_corelinkfunctions::o_set(CStrRef s, int64 hash, CVarRef v,bool forInit /* = false */) {
28 return c_ObjectData::o_set(s, hash, v, forInit);
30 Variant &c_corelinkfunctions::o_lval(CStrRef s, int64 hash) {
31 return c_ObjectData::o_lval(s, hash);
33 Variant c_corelinkfunctions::os_constant(const char *s) {
34 return c_ObjectData::os_constant(s);
36 IMPLEMENT_CLASS(corelinkfunctions)
37 ObjectData *c_corelinkfunctions::cloneImpl() {
38 c_corelinkfunctions *obj = NEW(c_corelinkfunctions)();
39 cloneSet(obj);
40 return obj;
42 void c_corelinkfunctions::cloneSet(c_corelinkfunctions *clone) {
43 ObjectData::cloneSet(clone);
45 Variant c_corelinkfunctions::o_invoke(const char *s, CArrRef params, int64 hash, bool fatal) {
46 if (hash < 0) hash = hash_string_i(s);
47 switch (hash & 3) {
48 case 0:
49 HASH_GUARD(0x1D738EB8C393D900LL, defaultlinkhook) {
50 int count = params.size();
51 if (count <= 5) return (ti_defaultlinkhook(o_getClassName(), params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4)));
52 if (count == 6) return (ti_defaultlinkhook(o_getClassName(), params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4), ref(const_cast<Array&>(params).lvalAt(5))));
53 return (ti_defaultlinkhook(o_getClassName(), params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4), ref(const_cast<Array&>(params).lvalAt(5)), ref(const_cast<Array&>(params).lvalAt(6))));
55 break;
56 case 2:
57 HASH_GUARD(0x7C88307983EF6A96LL, categorylinkhook) {
58 int count = params.size();
59 if (count <= 5) return (ti_categorylinkhook(o_getClassName(), params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4)));
60 if (count == 6) return (ti_categorylinkhook(o_getClassName(), params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4), ref(const_cast<Array&>(params).lvalAt(5))));
61 return (ti_categorylinkhook(o_getClassName(), params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4), ref(const_cast<Array&>(params).lvalAt(5)), ref(const_cast<Array&>(params).lvalAt(6))));
63 break;
64 default:
65 break;
67 return c_ObjectData::o_invoke(s, params, hash, fatal);
69 Variant c_corelinkfunctions::o_invoke_few_args(const char *s, int64 hash, int count, CVarRef a0, CVarRef a1, CVarRef a2, CVarRef a3, CVarRef a4, CVarRef a5) {
70 if (hash < 0) hash = hash_string_i(s);
71 switch (hash & 3) {
72 case 0:
73 HASH_GUARD(0x1D738EB8C393D900LL, defaultlinkhook) {
74 if (count <= 5) return (ti_defaultlinkhook(o_getClassName(), a0, a1, a2, a3, a4));
75 return (ti_defaultlinkhook(o_getClassName(), a0, a1, a2, a3, a4, ref(a5)));
77 break;
78 case 2:
79 HASH_GUARD(0x7C88307983EF6A96LL, categorylinkhook) {
80 if (count <= 5) return (ti_categorylinkhook(o_getClassName(), a0, a1, a2, a3, a4));
81 return (ti_categorylinkhook(o_getClassName(), a0, a1, a2, a3, a4, ref(a5)));
83 break;
84 default:
85 break;
87 return c_ObjectData::o_invoke_few_args(s, hash, count, a0, a1, a2, a3, a4, a5);
89 Variant c_corelinkfunctions::os_invoke(const char *c, const char *s, CArrRef params, int64 hash, bool fatal) {
90 if (hash < 0) hash = hash_string_i(s);
91 switch (hash & 3) {
92 case 0:
93 HASH_GUARD(0x1D738EB8C393D900LL, defaultlinkhook) {
94 int count = params.size();
95 if (count <= 5) return (ti_defaultlinkhook(c, params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4)));
96 if (count == 6) return (ti_defaultlinkhook(c, params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4), ref(const_cast<Array&>(params).lvalAt(5))));
97 return (ti_defaultlinkhook(c, params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4), ref(const_cast<Array&>(params).lvalAt(5)), ref(const_cast<Array&>(params).lvalAt(6))));
99 break;
100 case 2:
101 HASH_GUARD(0x7C88307983EF6A96LL, categorylinkhook) {
102 int count = params.size();
103 if (count <= 5) return (ti_categorylinkhook(c, params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4)));
104 if (count == 6) return (ti_categorylinkhook(c, params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4), ref(const_cast<Array&>(params).lvalAt(5))));
105 return (ti_categorylinkhook(c, params.rvalAt(0), params.rvalAt(1), params.rvalAt(2), params.rvalAt(3), params.rvalAt(4), ref(const_cast<Array&>(params).lvalAt(5)), ref(const_cast<Array&>(params).lvalAt(6))));
107 break;
108 default:
109 break;
111 return c_ObjectData::os_invoke(c, s, params, hash, fatal);
113 Variant cw_corelinkfunctions$os_get(const char *s) {
114 return c_corelinkfunctions::os_get(s, -1);
116 Variant &cw_corelinkfunctions$os_lval(const char *s) {
117 return c_corelinkfunctions::os_lval(s, -1);
119 Variant cw_corelinkfunctions$os_constant(const char *s) {
120 return c_corelinkfunctions::os_constant(s);
122 Variant cw_corelinkfunctions$os_invoke(const char *c, const char *s, CArrRef params, bool fatal /* = true */) {
123 return c_corelinkfunctions::os_invoke(c, s, params, -1, fatal);
125 void c_corelinkfunctions::init() {
127 /* SRC: CoreLinkFunctions.php line 8 */
128 bool c_corelinkfunctions::ti_register(const char* cls, p_parser_linkhooks v_parser) {
129 STATIC_METHOD_INJECTION(CoreLinkFunctions, CoreLinkFunctions::register);
130 LINE(9,v_parser->t_setlinkhook(k_NS_CATEGORY, ScalarArrays::sa_[32]));
131 return true;
132 } /* function */
133 /* SRC: CoreLinkFunctions.php line 13 */
134 Variant c_corelinkfunctions::ti_defaultlinkhook(const char* cls, CVarRef v_parser, CVarRef v_holders, CVarRef v_markers, Variant v_title, CVarRef v_titleText, Variant v_displayText // = null
135 , Variant v_leadingColon // = false
137 STATIC_METHOD_INJECTION(CoreLinkFunctions, CoreLinkFunctions::defaultLinkHook);
138 if (isset(v_displayText) && toBoolean(LINE(15,toObject(v_markers)->o_invoke_few_args("findMarker", 0x21C2BB2267C07FDALL, 1, v_displayText)))) {
139 (v_displayText = LINE(19,toObject(v_markers)->o_invoke_few_args("expand", 0x39B7BB05F05A37CDLL, 1, v_displayText)));
140 return false;
142 return LINE(23,toObject(v_holders)->o_invoke_few_args("makeHolder", 0x0B6C33D73053B0C5LL, 5, v_title, isset(v_displayText) ? ((Variant)(v_displayText)) : ((Variant)(v_titleText)), "", "", ""));
143 } /* function */
144 /* SRC: CoreLinkFunctions.php line 26 */
145 Variant c_corelinkfunctions::ti_categorylinkhook(const char* cls, CVarRef v_parser, CVarRef v_holders, CVarRef v_markers, Object v_title, CVarRef v_titleText, Variant v_sortText // = null
146 , Variant v_leadingColon // = false
148 STATIC_METHOD_INJECTION(CoreLinkFunctions, CoreLinkFunctions::categoryLinkHook);
149 Variant eo_0;
150 Variant eo_1;
151 DECLARE_GLOBAL_VARIABLES(g);
152 Variant &gv_wgContLang __attribute__((__unused__)) = g->GV(wgContLang);
153 if (toBoolean(v_leadingColon)) return true;
154 if (isset(v_sortText) && toBoolean(LINE(31,toObject(v_markers)->o_invoke_few_args("findMarker", 0x21C2BB2267C07FDALL, 1, v_sortText)))) {
155 (v_sortText = LINE(35,toObject(v_markers)->o_invoke_few_args("expand", 0x39B7BB05F05A37CDLL, 1, v_sortText)));
156 return false;
158 if (!(isset(v_sortText))) (v_sortText = LINE(39,toObject(v_parser)->o_invoke_few_args("getDefaultSort", 0x39ADF3C1E6A55D3ALL, 0)));
159 (v_sortText = LINE(40,throw_fatal("unknown class sanitizer", ((void*)NULL))));
160 (v_sortText = LINE(41,x_str_replace("\n", "", v_sortText)));
161 (v_sortText = LINE(42,gv_wgContLang.o_invoke_few_args("convertCategoryKey", 0x11AD19C1DBDF452ALL, 1, v_sortText)));
162 (assignCallTemp(eo_0, ref(LINE(43,v_title->o_invoke_few_args("getDBkey", 0x7A72F137192AEF00LL, 0)))),assignCallTemp(eo_1, ref(v_sortText)),toObject(v_parser).o_get("mOutput", 0x7F7FE020D521DBD0LL).o_invoke("addCategory", Array(ArrayInit(2).set(0, eo_0).set(1, eo_1).create()), 0x6DBAA9816B039793LL));
163 return "";
164 } /* function */
165 Object co_corelinkfunctions(CArrRef params, bool init /* = true */) {
166 return Object(p_corelinkfunctions(NEW(c_corelinkfunctions)())->dynCreate(params, init));
168 Variant pm_php$CoreLinkFunctions_php(bool incOnce /* = false */, LVariableTable* variables /* = NULL */) {
169 FUNCTION_INJECTION(run_init::CoreLinkFunctions.php);
171 DECLARE_GLOBAL_VARIABLES(g);
172 bool &alreadyRun = g->run_pm_php$CoreLinkFunctions_php;
173 if (alreadyRun) { if (incOnce) return true;}
174 else alreadyRun = true;
175 if (!variables) variables = g;
177 DECLARE_GLOBAL_VARIABLES(g);
178 LVariableTable *gVariables __attribute__((__unused__)) = get_variable_table();
179 return true;
180 } /* function */
182 ///////////////////////////////////////////////////////////////////////////////