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