merged master
[lhc/web/wiklou.git] / includes / Defines.php
1 <?php
2 /**
3 * A few constants that might be needed during LocalSettings.php.
4 *
5 * Note: these constants must all be resolvable at compile time by HipHop,
6 * since this file will not be executed during request startup for a compiled
7 * MediaWiki.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
23 *
24 * @file
25 */
26
27 /**
28 * @defgroup Constants
29 */
30
31 /**
32 * Version constants for the benefit of extensions
33 */
34 define( 'MW_SPECIALPAGE_VERSION', 2 );
35
36 /**@{
37 * Database related constants
38 */
39 define( 'DBO_DEBUG', 1 );
40 define( 'DBO_NOBUFFER', 2 );
41 define( 'DBO_IGNORE', 4 );
42 define( 'DBO_TRX', 8 );
43 define( 'DBO_DEFAULT', 16 );
44 define( 'DBO_PERSISTENT', 32 );
45 define( 'DBO_SYSDBA', 64 ); //for oracle maintenance
46 define( 'DBO_DDLMODE', 128 ); // when using schema files: mostly for Oracle
47 /**@}*/
48
49 /**@{
50 * Valid database indexes
51 * Operation-based indexes
52 */
53 define( 'DB_SLAVE', -1 ); # Read from the slave (or only server)
54 define( 'DB_MASTER', -2 ); # Write to master (or only server)
55 define( 'DB_LAST', -3 ); # Whatever database was used last
56 /**@}*/
57
58 # Obsolete aliases
59 define( 'DB_READ', -1 );
60 define( 'DB_WRITE', -2 );
61
62
63 /**@{
64 * Virtual namespaces; don't appear in the page database
65 */
66 define( 'NS_MEDIA', -2 );
67 define( 'NS_SPECIAL', -1 );
68 /**@}*/
69
70 /**@{
71 * Real namespaces
72 *
73 * Number 100 and beyond are reserved for custom namespaces;
74 * DO NOT assign standard namespaces at 100 or beyond.
75 * DO NOT Change integer values as they are most probably hardcoded everywhere
76 * see bug #696 which talked about that.
77 */
78 define( 'NS_MAIN', 0 );
79 define( 'NS_TALK', 1 );
80 define( 'NS_USER', 2 );
81 define( 'NS_USER_TALK', 3 );
82 define( 'NS_PROJECT', 4 );
83 define( 'NS_PROJECT_TALK', 5 );
84 define( 'NS_FILE', 6 );
85 define( 'NS_FILE_TALK', 7 );
86 define( 'NS_MEDIAWIKI', 8 );
87 define( 'NS_MEDIAWIKI_TALK', 9 );
88 define( 'NS_TEMPLATE', 10 );
89 define( 'NS_TEMPLATE_TALK', 11 );
90 define( 'NS_HELP', 12 );
91 define( 'NS_HELP_TALK', 13 );
92 define( 'NS_CATEGORY', 14 );
93 define( 'NS_CATEGORY_TALK', 15 );
94
95 /**
96 * NS_IMAGE and NS_IMAGE_TALK are the pre-v1.14 names for NS_FILE and
97 * NS_FILE_TALK respectively, and are kept for compatibility.
98 *
99 * When writing code that should be compatible with older MediaWiki
100 * versions, either stick to the old names or define the new constants
101 * yourself, if they're not defined already.
102 */
103 define( 'NS_IMAGE', NS_FILE );
104 define( 'NS_IMAGE_TALK', NS_FILE_TALK );
105 /**@}*/
106
107 /**@{
108 * Cache type
109 */
110 define( 'CACHE_ANYTHING', -1 ); // Use anything, as long as it works
111 define( 'CACHE_NONE', 0 ); // Do not cache
112 define( 'CACHE_DB', 1 ); // Store cache objects in the DB
113 define( 'CACHE_MEMCACHED', 2 ); // MemCached, must specify servers in $wgMemCacheServers
114 define( 'CACHE_ACCEL', 3 ); // APC, XCache or WinCache
115 define( 'CACHE_DBA', 4 ); // Use PHP's DBA extension to store in a DBM-style database
116 /**@}*/
117
118 /**@{
119 * Media types.
120 * This defines constants for the value returned by File::getMediaType()
121 */
122 define( 'MEDIATYPE_UNKNOWN', 'UNKNOWN' ); // unknown format
123 define( 'MEDIATYPE_BITMAP', 'BITMAP' ); // some bitmap image or image source (like psd, etc). Can't scale up.
124 define( 'MEDIATYPE_DRAWING', 'DRAWING' ); // some vector drawing (SVG, WMF, PS, ...) or image source (oo-draw, etc). Can scale up.
125 define( 'MEDIATYPE_AUDIO', 'AUDIO' ); // simple audio file (ogg, mp3, wav, midi, whatever)
126 define( 'MEDIATYPE_VIDEO', 'VIDEO' ); // simple video file (ogg, mpg, etc; no not include formats here that may contain executable sections or scripts!)
127 define( 'MEDIATYPE_MULTIMEDIA', 'MULTIMEDIA' ); // Scriptable Multimedia (flash, advanced video container formats, etc)
128 define( 'MEDIATYPE_OFFICE', 'OFFICE' ); // Office Documents, Spreadsheets (office formats possibly containing apples, scripts, etc)
129 define( 'MEDIATYPE_TEXT', 'TEXT' ); // Plain text (possibly containing program code or scripts)
130 define( 'MEDIATYPE_EXECUTABLE', 'EXECUTABLE' ); // binary executable
131 define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); // archive file (zip, tar, etc)
132 /**@}*/
133
134 /**@{
135 * Antivirus result codes, for use in $wgAntivirusSetup.
136 */
137 define( 'AV_NO_VIRUS', 0 ); #scan ok, no virus found
138 define( 'AV_VIRUS_FOUND', 1 ); #virus found!
139 define( 'AV_SCAN_ABORTED', -1 ); #scan aborted, the file is probably imune
140 define( 'AV_SCAN_FAILED', false ); #scan failed (scanner not found or error in scanner)
141 /**@}*/
142
143 /**@{
144 * Anti-lock flags
145 * See DefaultSettings.php for a description
146 */
147 define( 'ALF_PRELOAD_LINKS', 1 );
148 define( 'ALF_PRELOAD_EXISTENCE', 2 );
149 define( 'ALF_NO_LINK_LOCK', 4 );
150 define( 'ALF_NO_BLOCK_LOCK', 8 );
151 /**@}*/
152
153 /**@{
154 * Date format selectors; used in user preference storage and by
155 * Language::date() and co.
156 */
157 /*define( 'MW_DATE_DEFAULT', '0' );
158 define( 'MW_DATE_MDY', '1' );
159 define( 'MW_DATE_DMY', '2' );
160 define( 'MW_DATE_YMD', '3' );
161 define( 'MW_DATE_ISO', 'ISO 8601' );*/
162 define( 'MW_DATE_DEFAULT', 'default' );
163 define( 'MW_DATE_MDY', 'mdy' );
164 define( 'MW_DATE_DMY', 'dmy' );
165 define( 'MW_DATE_YMD', 'ymd' );
166 define( 'MW_DATE_ISO', 'ISO 8601' );
167 /**@}*/
168
169 /**@{
170 * RecentChange type identifiers
171 */
172 define( 'RC_EDIT', 0);
173 define( 'RC_NEW', 1);
174 define( 'RC_MOVE', 2); // obsolete
175 define( 'RC_LOG', 3);
176 define( 'RC_MOVE_OVER_REDIRECT', 4); // obsolete
177 /**@}*/
178
179 /**@{
180 * Article edit flags
181 */
182 define( 'EDIT_NEW', 1 );
183 define( 'EDIT_UPDATE', 2 );
184 define( 'EDIT_MINOR', 4 );
185 define( 'EDIT_SUPPRESS_RC', 8 );
186 define( 'EDIT_FORCE_BOT', 16 );
187 define( 'EDIT_DEFER_UPDATES', 32 );
188 define( 'EDIT_AUTOSUMMARY', 64 );
189 /**@}*/
190
191 /**@{
192 * Flags for Database::makeList()
193 * These are also available as Database class constants
194 */
195 define( 'LIST_COMMA', 0 );
196 define( 'LIST_AND', 1 );
197 define( 'LIST_SET', 2 );
198 define( 'LIST_NAMES', 3);
199 define( 'LIST_OR', 4);
200 define( 'LIST_SET_PREPARED', 8); // List of (?, ?, ?) for DatabaseIbm_db2
201 /**@}*/
202
203 /**
204 * Unicode and normalisation related
205 */
206 require_once dirname(__FILE__).'/normal/UtfNormalDefines.php';
207
208 /**@{
209 * Hook support constants
210 */
211 define( 'MW_SUPPORTS_EDITFILTERMERGED', 1 );
212 define( 'MW_SUPPORTS_PARSERFIRSTCALLINIT', 1 );
213 define( 'MW_SUPPORTS_LOCALISATIONCACHE', 1 );
214 /**@}*/
215
216 /** Support for $wgResourceModules */
217 define( 'MW_SUPPORTS_RESOURCE_MODULES', 1 );
218
219 /**@{
220 * Allowed values for Parser::$mOutputType
221 * Parameter to Parser::startExternalParse().
222 */
223 define( 'OT_HTML', 1 );
224 define( 'OT_WIKI', 2 );
225 define( 'OT_PREPROCESS', 3 );
226 define( 'OT_MSG' , 3 ); // b/c alias for OT_PREPROCESS
227 define( 'OT_PLAIN', 4 );
228 /**@}*/
229
230 /**@{
231 * Flags for Parser::setFunctionHook
232 */
233 define( 'SFH_NO_HASH', 1 );
234 define( 'SFH_OBJECT_ARGS', 2 );
235 /**@}*/
236
237 /**
238 * Flags for Parser::setLinkHook
239 */
240 define( 'SLH_PATTERN', 1 );
241
242 /**
243 * Flags for Parser::replaceLinkHolders
244 */
245 define( 'RLH_FOR_UPDATE', 1 );
246
247 /**@{
248 * Autopromote conditions (must be here and not in Autopromote.php, so that
249 * they're loaded for DefaultSettings.php before AutoLoader.php)
250 */
251 define( 'APCOND_EDITCOUNT', 1 );
252 define( 'APCOND_AGE', 2 );
253 define( 'APCOND_EMAILCONFIRMED', 3 );
254 define( 'APCOND_INGROUPS', 4 );
255 define( 'APCOND_ISIP', 5 );
256 define( 'APCOND_IPINRANGE', 6 );
257 define( 'APCOND_AGE_FROM_EDIT', 7 );
258 define( 'APCOND_BLOCKED', 8 );
259 define( 'APCOND_ISBOT', 9 );
260 /**@}*/
261
262 /** @{
263 * Protocol constants for wfExpandUrl()
264 */
265 define( 'PROTO_HTTP', 'http://' );
266 define( 'PROTO_HTTPS', 'https://' );
267 define( 'PROTO_RELATIVE', '//' );
268 define( 'PROTO_CURRENT', null );
269 define( 'PROTO_CANONICAL', 1 );
270 define( 'PROTO_INTERNAL', 2 );
271 /**@}*/
272
273 /**@{
274 * Content model ids, used by Content and ContentHandler
275 *
276 * Extensions that define their own content models shall use IDs
277 * larger than 100 and register the ids they use at
278 * <http://mediawiki.org/ContentHandler/registry>
279 * to avoid conflicts with other extensions.
280 */
281 define( 'CONTENT_MODEL_WIKITEXT', 1 );
282 define( 'CONTENT_MODEL_JAVASCRIPT', 2 );
283 define( 'CONTENT_MODEL_CSS', 3 );
284 define( 'CONTENT_MODEL_TEXT', 4 );
285 /**@}*/
286
287 /**@{
288 * Content format ids, used by Content and ContentHandler.
289 * Use ContentHander::getFormatMimeType() to get the associated mime type.
290 * Register mime types in $wgContentFormatMimeTypes.
291 *
292 * Extensions that define their own content formats shall use IDs
293 * larger than 100 and register the ids they use at
294 * <http://mediawiki.org/ContentHandler/registry>
295 * to avoid conflicts with other extensions.
296 */
297 define( 'CONTENT_FORMAT_WIKITEXT', 1 ); // wikitext
298 define( 'CONTENT_FORMAT_JAVASCRIPT', 2 ); // for js pages
299 define( 'CONTENT_FORMAT_CSS', 3 ); // for css pages
300 define( 'CONTENT_FORMAT_TEXT', 4 ); // for future use, e.g. with some plain-html messages.
301 define( 'CONTENT_FORMAT_HTML', 5 ); // for future use, e.g. with some plain-html messages.
302 define( 'CONTENT_FORMAT_SERIALIZED', 11 ); // for future use with the api, and for use by extensions
303 define( 'CONTENT_FORMAT_JSON', 12 ); // for future use with the api, and for use by extensions
304 define( 'CONTENT_FORMAT_XML', 13 ); // for future use with the api, and for use by extensions
305 /**@}*/
306
307