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
13 * Version constants for the benefit of extensions
15 define( 'MW_VERSION', '1.19alpha' );
16 define( 'MW_SPECIALPAGE_VERSION', 2 );
19 * Database related constants
21 define( 'DBO_DEBUG', 1 );
22 define( 'DBO_NOBUFFER', 2 );
23 define( 'DBO_IGNORE', 4 );
24 define( 'DBO_TRX', 8 );
25 define( 'DBO_DEFAULT', 16 );
26 define( 'DBO_PERSISTENT', 32 );
27 define( 'DBO_SYSDBA', 64 ); //for oracle maintenance
28 define( 'DBO_DDLMODE', 128 ); // when using schema files: mostly for Oracle
32 * Valid database indexes
33 * Operation-based indexes
35 define( 'DB_SLAVE', -1 ); # Read from the slave (or only server)
36 define( 'DB_MASTER', -2 ); # Write to master (or only server)
37 define( 'DB_LAST', -3 ); # Whatever database was used last
41 define( 'DB_READ', -1 );
42 define( 'DB_WRITE', -2 );
46 * Virtual namespaces; don't appear in the page database
48 define( 'NS_MEDIA', -2 );
49 define( 'NS_SPECIAL', -1 );
55 * Number 100 and beyond are reserved for custom namespaces;
56 * DO NOT assign standard namespaces at 100 or beyond.
57 * DO NOT Change integer values as they are most probably hardcoded everywhere
58 * see bug #696 which talked about that.
60 define( 'NS_MAIN', 0 );
61 define( 'NS_TALK', 1 );
62 define( 'NS_USER', 2 );
63 define( 'NS_USER_TALK', 3 );
64 define( 'NS_PROJECT', 4 );
65 define( 'NS_PROJECT_TALK', 5 );
66 define( 'NS_FILE', 6 );
67 define( 'NS_FILE_TALK', 7 );
68 define( 'NS_MEDIAWIKI', 8 );
69 define( 'NS_MEDIAWIKI_TALK', 9 );
70 define( 'NS_TEMPLATE', 10 );
71 define( 'NS_TEMPLATE_TALK', 11 );
72 define( 'NS_HELP', 12 );
73 define( 'NS_HELP_TALK', 13 );
74 define( 'NS_CATEGORY', 14 );
75 define( 'NS_CATEGORY_TALK', 15 );
78 * NS_IMAGE and NS_IMAGE_TALK are the pre-v1.14 names for NS_FILE and
79 * NS_FILE_TALK respectively, and are kept for compatibility.
81 * When writing code that should be compatible with older MediaWiki
82 * versions, either stick to the old names or define the new constants
83 * yourself, if they're not defined already.
85 define( 'NS_IMAGE', NS_FILE
);
86 define( 'NS_IMAGE_TALK', NS_FILE_TALK
);
92 define( 'CACHE_ANYTHING', -1 ); // Use anything, as long as it works
93 define( 'CACHE_NONE', 0 ); // Do not cache
94 define( 'CACHE_DB', 1 ); // Store cache objects in the DB
95 define( 'CACHE_MEMCACHED', 2 ); // MemCached, must specify servers in $wgMemCacheServers
96 define( 'CACHE_ACCEL', 3 ); // eAccelerator
97 define( 'CACHE_DBA', 4 ); // Use PHP's DBA extension to store in a DBM-style database
102 * This defines constants for the value returned by File::getMediaType()
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 define( 'MEDIATYPE_DATA', 'DATA' ); // A generic data file (like kml and kmz)
118 * Antivirus result codes, for use in $wgAntivirusSetup.
120 define( 'AV_NO_VIRUS', 0 ); #scan ok, no virus found
121 define( 'AV_VIRUS_FOUND', 1 ); #virus found!
122 define( 'AV_SCAN_ABORTED', -1 ); #scan aborted, the file is probably imune
123 define( 'AV_SCAN_FAILED', false ); #scan failed (scanner not found or error in scanner)
128 * See DefaultSettings.php for a description
130 define( 'ALF_PRELOAD_LINKS', 1 );
131 define( 'ALF_PRELOAD_EXISTENCE', 2 );
132 define( 'ALF_NO_LINK_LOCK', 4 );
133 define( 'ALF_NO_BLOCK_LOCK', 8 );
137 * Date format selectors; used in user preference storage and by
138 * Language::date() and co.
140 /*define( 'MW_DATE_DEFAULT', '0' );
141 define( 'MW_DATE_MDY', '1' );
142 define( 'MW_DATE_DMY', '2' );
143 define( 'MW_DATE_YMD', '3' );
144 define( 'MW_DATE_ISO', 'ISO 8601' );*/
145 define( 'MW_DATE_DEFAULT', 'default' );
146 define( 'MW_DATE_MDY', 'mdy' );
147 define( 'MW_DATE_DMY', 'dmy' );
148 define( 'MW_DATE_YMD', 'ymd' );
149 define( 'MW_DATE_ISO', 'ISO 8601' );
153 * RecentChange type identifiers
154 * This may be obsolete; log items are now used for moves?
156 define( 'RC_EDIT', 0);
157 define( 'RC_NEW', 1);
158 define( 'RC_MOVE', 2);
159 define( 'RC_LOG', 3);
160 define( 'RC_MOVE_OVER_REDIRECT', 4);
166 define( 'EDIT_NEW', 1 );
167 define( 'EDIT_UPDATE', 2 );
168 define( 'EDIT_MINOR', 4 );
169 define( 'EDIT_SUPPRESS_RC', 8 );
170 define( 'EDIT_FORCE_BOT', 16 );
171 define( 'EDIT_DEFER_UPDATES', 32 );
172 define( 'EDIT_AUTOSUMMARY', 64 );
176 * Flags for Database::makeList()
177 * These are also available as Database class constants
179 define( 'LIST_COMMA', 0 );
180 define( 'LIST_AND', 1 );
181 define( 'LIST_SET', 2 );
182 define( 'LIST_NAMES', 3);
183 define( 'LIST_OR', 4);
184 define( 'LIST_SET_PREPARED', 8); // List of (?, ?, ?) for DatabaseIbm_db2
188 * Unicode and normalisation related
190 require_once dirname(__FILE__
).'/normal/UtfNormalDefines.php';
193 * Hook support constants
195 define( 'MW_SUPPORTS_EDITFILTERMERGED', 1 );
196 define( 'MW_SUPPORTS_PARSERFIRSTCALLINIT', 1 );
197 define( 'MW_SUPPORTS_LOCALISATIONCACHE', 1 );
200 /** Support for $wgResourceModules */
201 define( 'MW_SUPPORTS_RESOURCE_MODULES', 1 );
204 * Allowed values for Parser::$mOutputType
205 * Parameter to Parser::startExternalParse().
207 define( 'OT_HTML', 1 );
208 define( 'OT_WIKI', 2 );
209 define( 'OT_PREPROCESS', 3 );
210 define( 'OT_MSG' , 3 ); // b/c alias for OT_PREPROCESS
211 define( 'OT_PLAIN', 4 );
215 * Flags for Parser::setFunctionHook
217 define( 'SFH_NO_HASH', 1 );
218 define( 'SFH_OBJECT_ARGS', 2 );
222 * Flags for Parser::setLinkHook
224 define( 'SLH_PATTERN', 1 );
227 * Flags for Parser::replaceLinkHolders
229 define( 'RLH_FOR_UPDATE', 1 );
232 * Autopromote conditions (must be here and not in Autopromote.php, so that
233 * they're loaded for DefaultSettings.php before AutoLoader.php)
235 define( 'APCOND_EDITCOUNT', 1 );
236 define( 'APCOND_AGE', 2 );
237 define( 'APCOND_EMAILCONFIRMED', 3 );
238 define( 'APCOND_INGROUPS', 4 );
239 define( 'APCOND_ISIP', 5 );
240 define( 'APCOND_IPINRANGE', 6 );
241 define( 'APCOND_AGE_FROM_EDIT', 7 );
242 define( 'APCOND_BLOCKED', 8 );