* Rename wfGetAvailableRights() to User::getAllRights()
[lhc/web/wiklou.git] / includes / Defines.php
1 <?php
2 /**
3 * A few constants that might be needed during LocalSettings.php
4 */
5
6 /**
7 * Version constants for the benefit of extensions
8 */
9 define( 'MW_SPECIALPAGE_VERSION', 2 );
10
11 /**#@+
12 * Database related constants
13 */
14 define( 'DBO_DEBUG', 1 );
15 define( 'DBO_NOBUFFER', 2 );
16 define( 'DBO_IGNORE', 4 );
17 define( 'DBO_TRX', 8 );
18 define( 'DBO_DEFAULT', 16 );
19 define( 'DBO_PERSISTENT', 32 );
20 /**#@-*/
21
22 # Valid database indexes
23 # Operation-based indexes
24 define( 'DB_SLAVE', -1 ); # Read from the slave (or only server)
25 define( 'DB_MASTER', -2 ); # Write to master (or only server)
26 define( 'DB_LAST', -3 ); # Whatever database was used last
27
28 # Obsolete aliases
29 define( 'DB_READ', -1 );
30 define( 'DB_WRITE', -2 );
31
32
33 /**#@+
34 * Virtual namespaces; don't appear in the page database
35 */
36 define('NS_MEDIA', -2);
37 define('NS_SPECIAL', -1);
38 /**#@-*/
39
40 /**#@+
41 * Real namespaces
42 *
43 * Number 100 and beyond are reserved for custom namespaces;
44 * DO NOT assign standard namespaces at 100 or beyond.
45 * DO NOT Change integer values as they are most probably hardcoded everywhere
46 * see bug #696 which talked about that.
47 */
48 define('NS_MAIN', 0);
49 define('NS_TALK', 1);
50 define('NS_USER', 2);
51 define('NS_USER_TALK', 3);
52 define('NS_PROJECT', 4);
53 define('NS_PROJECT_TALK', 5);
54 define('NS_IMAGE', 6);
55 define('NS_IMAGE_TALK', 7);
56 define('NS_MEDIAWIKI', 8);
57 define('NS_MEDIAWIKI_TALK', 9);
58 define('NS_TEMPLATE', 10);
59 define('NS_TEMPLATE_TALK', 11);
60 define('NS_HELP', 12);
61 define('NS_HELP_TALK', 13);
62 define('NS_CATEGORY', 14);
63 define('NS_CATEGORY_TALK', 15);
64 /**#@-*/
65
66 /**
67 * Available feeds objects
68 * Should probably only be defined when a page is syndicated ie when
69 * $wgOut->isSyndicated() is true
70 */
71 $wgFeedClasses = array(
72 'rss' => 'RSSFeed',
73 'atom' => 'AtomFeed',
74 );
75
76 /**#@+
77 * Maths constants
78 */
79 define( 'MW_MATH_PNG', 0 );
80 define( 'MW_MATH_SIMPLE', 1 );
81 define( 'MW_MATH_HTML', 2 );
82 define( 'MW_MATH_SOURCE', 3 );
83 define( 'MW_MATH_MODERN', 4 );
84 define( 'MW_MATH_MATHML', 5 );
85 /**#@-*/
86
87 /**#@+
88 * Cache type
89 */
90 define( 'CACHE_ANYTHING', -1 ); // Use anything, as long as it works
91 define( 'CACHE_NONE', 0 ); // Do not cache
92 define( 'CACHE_DB', 1 ); // Store cache objects in the DB
93 define( 'CACHE_MEMCACHED', 2 ); // MemCached, must specify servers in $wgMemCacheServers
94 define( 'CACHE_ACCEL', 3 ); // eAccelerator or Turck, whichever is available
95 define( 'CACHE_DBA', 4 ); // Use PHP's DBA extension to store in a DBM-style database
96 /**#@-*/
97
98
99
100 /**#@+
101 * Media types.
102 * This defines constants for the value returned by Image::getMediaType()
103 */
104 define( 'MEDIATYPE_UNKNOWN', 'UNKNOWN' ); // unknown format
105 define( 'MEDIATYPE_BITMAP', 'BITMAP' ); // some bitmap image or image source (like psd, etc). Can't scale up.
106 define( 'MEDIATYPE_DRAWING', 'DRAWING' ); // some vector drawing (SVG, WMF, PS, ...) or image source (oo-draw, etc). Can scale up.
107 define( 'MEDIATYPE_AUDIO', 'AUDIO' ); // simple audio file (ogg, mp3, wav, midi, whatever)
108 define( 'MEDIATYPE_VIDEO', 'VIDEO' ); // simple video file (ogg, mpg, etc; no not include formats here that may contain executable sections or scripts!)
109 define( 'MEDIATYPE_MULTIMEDIA', 'MULTIMEDIA' ); // Scriptable Multimedia (flash, advanced video container formats, etc)
110 define( 'MEDIATYPE_OFFICE', 'OFFICE' ); // Office Documents, Spreadsheets (office formats possibly containing apples, scripts, etc)
111 define( 'MEDIATYPE_TEXT', 'TEXT' ); // Plain text (possibly containing program code or scripts)
112 define( 'MEDIATYPE_EXECUTABLE', 'EXECUTABLE' ); // binary executable
113 define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); // archive file (zip, tar, etc)
114 /**#@-*/
115
116 /**#@+
117 * Antivirus result codes, for use in $wgAntivirusSetup.
118 */
119 define( 'AV_NO_VIRUS', 0 ); #scan ok, no virus found
120 define( 'AV_VIRUS_FOUND', 1 ); #virus found!
121 define( 'AV_SCAN_ABORTED', -1 ); #scan aborted, the file is probably imune
122 define( 'AV_SCAN_FAILED', false ); #scan failed (scanner not found or error in scanner)
123 /**#@-*/
124
125 /**#@+
126 * Anti-lock flags
127 * See DefaultSettings.php for a description
128 */
129 define( 'ALF_PRELOAD_LINKS', 1 );
130 define( 'ALF_PRELOAD_EXISTENCE', 2 );
131 define( 'ALF_NO_LINK_LOCK', 4 );
132 define( 'ALF_NO_BLOCK_LOCK', 8 );
133 /**#@-*/
134
135 /**#@+
136 * Date format selectors; used in user preference storage and by
137 * Language::date() and co.
138 */
139 /*define( 'MW_DATE_DEFAULT', '0' );
140 define( 'MW_DATE_MDY', '1' );
141 define( 'MW_DATE_DMY', '2' );
142 define( 'MW_DATE_YMD', '3' );
143 define( 'MW_DATE_ISO', 'ISO 8601' );*/
144 define( 'MW_DATE_DEFAULT', 'default' );
145 define( 'MW_DATE_MDY', 'mdy' );
146 define( 'MW_DATE_DMY', 'dmy' );
147 define( 'MW_DATE_YMD', 'ymd' );
148 define( 'MW_DATE_ISO', 'ISO 8601' );
149 /**#@-*/
150
151 /**#@+
152 * RecentChange type identifiers
153 * This may be obsolete; log items are now used for moves?
154 */
155 define( 'RC_EDIT', 0);
156 define( 'RC_NEW', 1);
157 define( 'RC_MOVE', 2);
158 define( 'RC_LOG', 3);
159 define( 'RC_MOVE_OVER_REDIRECT', 4);
160 /**#@-*/
161
162 /**#@+
163 * Article edit flags
164 */
165 define( 'EDIT_NEW', 1 );
166 define( 'EDIT_UPDATE', 2 );
167 define( 'EDIT_MINOR', 4 );
168 define( 'EDIT_SUPPRESS_RC', 8 );
169 define( 'EDIT_FORCE_BOT', 16 );
170 define( 'EDIT_DEFER_UPDATES', 32 );
171 define( 'EDIT_AUTOSUMMARY', 64 );
172 /**#@-*/
173
174 /**
175 * Flags for Database::makeList()
176 * These are also available as Database class constants
177 */
178 define( 'LIST_COMMA', 0 );
179 define( 'LIST_AND', 1 );
180 define( 'LIST_SET', 2 );
181 define( 'LIST_NAMES', 3);
182 define( 'LIST_OR', 4);
183
184 /**
185 * Unicode and normalisation related
186 */
187 define( 'UNICODE_HANGUL_FIRST', 0xac00 );
188 define( 'UNICODE_HANGUL_LAST', 0xd7a3 );
189
190 define( 'UNICODE_HANGUL_LBASE', 0x1100 );
191 define( 'UNICODE_HANGUL_VBASE', 0x1161 );
192 define( 'UNICODE_HANGUL_TBASE', 0x11a7 );
193
194 define( 'UNICODE_HANGUL_LCOUNT', 19 );
195 define( 'UNICODE_HANGUL_VCOUNT', 21 );
196 define( 'UNICODE_HANGUL_TCOUNT', 28 );
197 define( 'UNICODE_HANGUL_NCOUNT', UNICODE_HANGUL_VCOUNT * UNICODE_HANGUL_TCOUNT );
198
199 define( 'UNICODE_HANGUL_LEND', UNICODE_HANGUL_LBASE + UNICODE_HANGUL_LCOUNT - 1 );
200 define( 'UNICODE_HANGUL_VEND', UNICODE_HANGUL_VBASE + UNICODE_HANGUL_VCOUNT - 1 );
201 define( 'UNICODE_HANGUL_TEND', UNICODE_HANGUL_TBASE + UNICODE_HANGUL_TCOUNT - 1 );
202
203 define( 'UNICODE_SURROGATE_FIRST', 0xd800 );
204 define( 'UNICODE_SURROGATE_LAST', 0xdfff );
205 define( 'UNICODE_MAX', 0x10ffff );
206 define( 'UNICODE_REPLACEMENT', 0xfffd );
207
208
209 define( 'UTF8_HANGUL_FIRST', "\xea\xb0\x80" /*codepointToUtf8( UNICODE_HANGUL_FIRST )*/ );
210 define( 'UTF8_HANGUL_LAST', "\xed\x9e\xa3" /*codepointToUtf8( UNICODE_HANGUL_LAST )*/ );
211
212 define( 'UTF8_HANGUL_LBASE', "\xe1\x84\x80" /*codepointToUtf8( UNICODE_HANGUL_LBASE )*/ );
213 define( 'UTF8_HANGUL_VBASE', "\xe1\x85\xa1" /*codepointToUtf8( UNICODE_HANGUL_VBASE )*/ );
214 define( 'UTF8_HANGUL_TBASE', "\xe1\x86\xa7" /*codepointToUtf8( UNICODE_HANGUL_TBASE )*/ );
215
216 define( 'UTF8_HANGUL_LEND', "\xe1\x84\x92" /*codepointToUtf8( UNICODE_HANGUL_LEND )*/ );
217 define( 'UTF8_HANGUL_VEND', "\xe1\x85\xb5" /*codepointToUtf8( UNICODE_HANGUL_VEND )*/ );
218 define( 'UTF8_HANGUL_TEND', "\xe1\x87\x82" /*codepointToUtf8( UNICODE_HANGUL_TEND )*/ );
219
220 define( 'UTF8_SURROGATE_FIRST', "\xed\xa0\x80" /*codepointToUtf8( UNICODE_SURROGATE_FIRST )*/ );
221 define( 'UTF8_SURROGATE_LAST', "\xed\xbf\xbf" /*codepointToUtf8( UNICODE_SURROGATE_LAST )*/ );
222 define( 'UTF8_MAX', "\xf4\x8f\xbf\xbf" /*codepointToUtf8( UNICODE_MAX )*/ );
223 define( 'UTF8_REPLACEMENT', "\xef\xbf\xbd" /*codepointToUtf8( UNICODE_REPLACEMENT )*/ );
224 #define( 'UTF8_REPLACEMENT', '!' );
225
226 define( 'UTF8_OVERLONG_A', "\xc1\xbf" );
227 define( 'UTF8_OVERLONG_B', "\xe0\x9f\xbf" );
228 define( 'UTF8_OVERLONG_C', "\xf0\x8f\xbf\xbf" );
229
230 # These two ranges are illegal
231 define( 'UTF8_FDD0', "\xef\xb7\x90" /*codepointToUtf8( 0xfdd0 )*/ );
232 define( 'UTF8_FDEF', "\xef\xb7\xaf" /*codepointToUtf8( 0xfdef )*/ );
233 define( 'UTF8_FFFE', "\xef\xbf\xbe" /*codepointToUtf8( 0xfffe )*/ );
234 define( 'UTF8_FFFF', "\xef\xbf\xbf" /*codepointToUtf8( 0xffff )*/ );
235
236 define( 'UTF8_HEAD', false );
237 define( 'UTF8_TAIL', true );
238
239 # Hook support constants
240 define( 'MW_SUPPORTS_EDITFILTERMERGED', 1 );
241 define( 'MW_SUPPORTS_PARSERFIRSTCALLINIT', 1 );
242
243 # Allowed values for Parser::$mOutputType
244 # Parameter to Parser::startExternalParse().
245 define( 'OT_HTML', 1 );
246 define( 'OT_WIKI', 2 );
247 define( 'OT_PREPROCESS', 3 );
248 define( 'OT_MSG' , 3 ); // b/c alias for OT_PREPROCESS
249
250 # Flags for Parser::setFunctionHook
251 define( 'SFH_NO_HASH', 1 );
252 define( 'SFH_OBJECT_ARGS', 2 );
253
254 # Flags for Parser::replaceLinkHolders
255 define( 'RLH_FOR_UPDATE', 1 );
256
257 # Autopromote conditions (must be here and not in Autopromote.php, so that
258 # they're loaded for DefaultSettings.php before AutoLoader.php)
259 define( 'APCOND_EDITCOUNT', 1 );
260 define( 'APCOND_AGE', 2 );
261 define( 'APCOND_EMAILCONFIRMED', 3 );
262 define( 'APCOND_INGROUPS', 4 );