(bug 35565) Special:Log/patrol doesn't indicate whether patrolling was automatic
[mediawiki.git] / includes / Defines.php
blobe40c9b25ec04b6c343985ec2b6c78ff03d4b0249
1 <?php
2 /**
3 * A few constants that might be needed during LocalSettings.php.
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.
9 * @file
12 /**
13 * @defgroup Constants
16 /**
17 * Version constants for the benefit of extensions
19 define( 'MW_SPECIALPAGE_VERSION', 2 );
21 /**@{
22 * Database related constants
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 /**@}*/
34 /**@{
35 * Valid database indexes
36 * Operation-based indexes
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 /**@}*/
43 # Obsolete aliases
44 define( 'DB_READ', -1 );
45 define( 'DB_WRITE', -2 );
48 /**@{
49 * Virtual namespaces; don't appear in the page database
51 define( 'NS_MEDIA', -2 );
52 define( 'NS_SPECIAL', -1 );
53 /**@}*/
55 /**@{
56 * Real namespaces
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.
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 );
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.
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.
88 define( 'NS_IMAGE', NS_FILE );
89 define( 'NS_IMAGE_TALK', NS_FILE_TALK );
90 /**@}*/
92 /**@{
93 * Cache type
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 /**@}*/
103 /**@{
104 * Media types.
105 * This defines constants for the value returned by File::getMediaType()
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 /**@}*/
119 /**@{
120 * Antivirus result codes, for use in $wgAntivirusSetup.
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 /**@}*/
128 /**@{
129 * Anti-lock flags
130 * See DefaultSettings.php for a description
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 /**@}*/
138 /**@{
139 * Date format selectors; used in user preference storage and by
140 * Language::date() and co.
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 /**@}*/
154 /**@{
155 * RecentChange type identifiers
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 /**@}*/
164 /**@{
165 * Article edit flags
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 /**@}*/
176 /**@{
177 * Flags for Database::makeList()
178 * These are also available as Database class constants
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 /**@}*/
189 * Unicode and normalisation related
191 require_once dirname(__FILE__).'/normal/UtfNormalDefines.php';
193 /**@{
194 * Hook support constants
196 define( 'MW_SUPPORTS_EDITFILTERMERGED', 1 );
197 define( 'MW_SUPPORTS_PARSERFIRSTCALLINIT', 1 );
198 define( 'MW_SUPPORTS_LOCALISATIONCACHE', 1 );
199 /**@}*/
201 /** Support for $wgResourceModules */
202 define( 'MW_SUPPORTS_RESOURCE_MODULES', 1 );
204 /**@{
205 * Allowed values for Parser::$mOutputType
206 * Parameter to Parser::startExternalParse().
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 /**@}*/
215 /**@{
216 * Flags for Parser::setFunctionHook
218 define( 'SFH_NO_HASH', 1 );
219 define( 'SFH_OBJECT_ARGS', 2 );
220 /**@}*/
223 * Flags for Parser::setLinkHook
225 define( 'SLH_PATTERN', 1 );
228 * Flags for Parser::replaceLinkHolders
230 define( 'RLH_FOR_UPDATE', 1 );
232 /**@{
233 * Autopromote conditions (must be here and not in Autopromote.php, so that
234 * they're loaded for DefaultSettings.php before AutoLoader.php)
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 /**@}*/
248 * Protocol constants for wfExpandUrl()
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 );