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