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
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.
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.
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
28 * @defgroup Constants MediaWiki constants
32 * Version constants for the benefit of extensions
34 define( 'MW_SPECIALPAGE_VERSION', 2 );
37 * Database related constants
39 define( 'DBO_DEBUG', 1 );
40 define( 'DBO_NOBUFFER', 2 );
41 define( 'DBO_IGNORE', 4 );
42 define( 'DBO_TRX', 8 ); // automatically start transaction on first query
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 define( 'DBO_SSL', 256 );
48 define( 'DBO_COMPRESS', 512 );
52 * Valid database indexes
53 * Operation-based indexes
55 define( 'DB_SLAVE', -1 ); # Read from the slave (or only server)
56 define( 'DB_MASTER', -2 ); # Write to master (or only server)
60 define( 'DB_READ', -1 );
61 define( 'DB_WRITE', -2 );
62 define( 'DB_LAST', -3 ); # deprecated since 2008, usage throws exception
65 * Virtual namespaces; don't appear in the page database
67 define( 'NS_MEDIA', -2 );
68 define( 'NS_SPECIAL', -1 );
74 * Number 100 and beyond are reserved for custom namespaces;
75 * DO NOT assign standard namespaces at 100 or beyond.
76 * DO NOT Change integer values as they are most probably hardcoded everywhere
77 * see bug #696 which talked about that.
79 define( 'NS_MAIN', 0 );
80 define( 'NS_TALK', 1 );
81 define( 'NS_USER', 2 );
82 define( 'NS_USER_TALK', 3 );
83 define( 'NS_PROJECT', 4 );
84 define( 'NS_PROJECT_TALK', 5 );
85 define( 'NS_FILE', 6 );
86 define( 'NS_FILE_TALK', 7 );
87 define( 'NS_MEDIAWIKI', 8 );
88 define( 'NS_MEDIAWIKI_TALK', 9 );
89 define( 'NS_TEMPLATE', 10 );
90 define( 'NS_TEMPLATE_TALK', 11 );
91 define( 'NS_HELP', 12 );
92 define( 'NS_HELP_TALK', 13 );
93 define( 'NS_CATEGORY', 14 );
94 define( 'NS_CATEGORY_TALK', 15 );
97 * NS_IMAGE and NS_IMAGE_TALK are the pre-v1.14 names for NS_FILE and
98 * NS_FILE_TALK respectively, and are kept for compatibility.
100 * When writing code that should be compatible with older MediaWiki
101 * versions, either stick to the old names or define the new constants
102 * yourself, if they're not defined already.
104 define( 'NS_IMAGE', NS_FILE
);
105 define( 'NS_IMAGE_TALK', NS_FILE_TALK
);
111 define( 'CACHE_ANYTHING', -1 ); // Use anything, as long as it works
112 define( 'CACHE_NONE', 0 ); // Do not cache
113 define( 'CACHE_DB', 1 ); // Store cache objects in the DB
114 define( 'CACHE_MEMCACHED', 2 ); // MemCached, must specify servers in $wgMemCacheServers
115 define( 'CACHE_ACCEL', 3 ); // APC, XCache or WinCache
116 define( 'CACHE_DBA', 4 ); // Use PHP's DBA extension to store in a DBM-style database
121 * This defines constants for the value returned by File::getMediaType()
123 define( 'MEDIATYPE_UNKNOWN', 'UNKNOWN' ); // unknown format
124 define( 'MEDIATYPE_BITMAP', 'BITMAP' ); // some bitmap image or image source (like psd, etc). Can't scale up.
125 define( 'MEDIATYPE_DRAWING', 'DRAWING' ); // some vector drawing (SVG, WMF, PS, ...) or image source (oo-draw, etc). Can scale up.
126 define( 'MEDIATYPE_AUDIO', 'AUDIO' ); // simple audio file (ogg, mp3, wav, midi, whatever)
127 define( 'MEDIATYPE_VIDEO', 'VIDEO' ); // simple video file (ogg, mpg, etc; no not include formats here that may contain executable sections or scripts!)
128 define( 'MEDIATYPE_MULTIMEDIA', 'MULTIMEDIA' ); // Scriptable Multimedia (flash, advanced video container formats, etc)
129 define( 'MEDIATYPE_OFFICE', 'OFFICE' ); // Office Documents, Spreadsheets (office formats possibly containing apples, scripts, etc)
130 define( 'MEDIATYPE_TEXT', 'TEXT' ); // Plain text (possibly containing program code or scripts)
131 define( 'MEDIATYPE_EXECUTABLE', 'EXECUTABLE' ); // binary executable
132 define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); // archive file (zip, tar, etc)
136 * Antivirus result codes, for use in $wgAntivirusSetup.
138 define( 'AV_NO_VIRUS', 0 ); #scan ok, no virus found
139 define( 'AV_VIRUS_FOUND', 1 ); #virus found!
140 define( 'AV_SCAN_ABORTED', -1 ); #scan aborted, the file is probably immune
141 define( 'AV_SCAN_FAILED', false ); #scan failed (scanner not found or error in scanner)
146 * See DefaultSettings.php for a description
148 define( 'ALF_PRELOAD_LINKS', 1 ); // unused
149 define( 'ALF_PRELOAD_EXISTENCE', 2 ); // unused
150 define( 'ALF_NO_LINK_LOCK', 4 );
151 define( 'ALF_NO_BLOCK_LOCK', 8 );
155 * Date format selectors; used in user preference storage and by
156 * Language::date() and co.
158 /*define( 'MW_DATE_DEFAULT', '0' );
159 define( 'MW_DATE_MDY', '1' );
160 define( 'MW_DATE_DMY', '2' );
161 define( 'MW_DATE_YMD', '3' );
162 define( 'MW_DATE_ISO', 'ISO 8601' );*/
163 define( 'MW_DATE_DEFAULT', 'default' );
164 define( 'MW_DATE_MDY', 'mdy' );
165 define( 'MW_DATE_DMY', 'dmy' );
166 define( 'MW_DATE_YMD', 'ymd' );
167 define( 'MW_DATE_ISO', 'ISO 8601' );
171 * RecentChange type identifiers
173 define( 'RC_EDIT', 0 );
174 define( 'RC_NEW', 1 );
175 define( 'RC_MOVE', 2 ); // obsolete
176 define( 'RC_LOG', 3 );
177 define( 'RC_MOVE_OVER_REDIRECT', 4 ); // obsolete
178 define( 'RC_EXTERNAL', 5 );
184 define( 'EDIT_NEW', 1 );
185 define( 'EDIT_UPDATE', 2 );
186 define( 'EDIT_MINOR', 4 );
187 define( 'EDIT_SUPPRESS_RC', 8 );
188 define( 'EDIT_FORCE_BOT', 16 );
189 define( 'EDIT_DEFER_UPDATES', 32 );
190 define( 'EDIT_AUTOSUMMARY', 64 );
194 * Flags for Database::makeList()
195 * These are also available as Database class constants
197 define( 'LIST_COMMA', 0 );
198 define( 'LIST_AND', 1 );
199 define( 'LIST_SET', 2 );
200 define( 'LIST_NAMES', 3 );
201 define( 'LIST_OR', 4 );
205 * Unicode and normalisation related
207 require_once __DIR__
. '/normal/UtfNormalDefines.php';
210 * Hook support constants
212 define( 'MW_SUPPORTS_EDITFILTERMERGED', 1 );
213 define( 'MW_SUPPORTS_PARSERFIRSTCALLINIT', 1 );
214 define( 'MW_SUPPORTS_LOCALISATIONCACHE', 1 );
215 define( 'MW_SUPPORTS_CONTENTHANDLER', 1 );
218 /** Support for $wgResourceModules */
219 define( 'MW_SUPPORTS_RESOURCE_MODULES', 1 );
222 * Allowed values for Parser::$mOutputType
223 * Parameter to Parser::startExternalParse().
225 define( 'OT_HTML', 1 );
226 define( 'OT_WIKI', 2 );
227 define( 'OT_PREPROCESS', 3 );
228 define( 'OT_MSG', 3 ); // b/c alias for OT_PREPROCESS
229 define( 'OT_PLAIN', 4 );
233 * Flags for Parser::setFunctionHook
235 define( 'SFH_NO_HASH', 1 );
236 define( 'SFH_OBJECT_ARGS', 2 );
240 * Flags for Parser::setLinkHook
242 define( 'SLH_PATTERN', 1 );
245 * Flags for Parser::replaceLinkHolders
247 define( 'RLH_FOR_UPDATE', 1 );
250 * Autopromote conditions (must be here and not in Autopromote.php, so that
251 * they're loaded for DefaultSettings.php before AutoLoader.php)
253 define( 'APCOND_EDITCOUNT', 1 );
254 define( 'APCOND_AGE', 2 );
255 define( 'APCOND_EMAILCONFIRMED', 3 );
256 define( 'APCOND_INGROUPS', 4 );
257 define( 'APCOND_ISIP', 5 );
258 define( 'APCOND_IPINRANGE', 6 );
259 define( 'APCOND_AGE_FROM_EDIT', 7 );
260 define( 'APCOND_BLOCKED', 8 );
261 define( 'APCOND_ISBOT', 9 );
265 * Protocol constants for wfExpandUrl()
267 define( 'PROTO_HTTP', 'http://' );
268 define( 'PROTO_HTTPS', 'https://' );
269 define( 'PROTO_RELATIVE', '//' );
270 define( 'PROTO_CURRENT', null );
271 define( 'PROTO_CANONICAL', 1 );
272 define( 'PROTO_INTERNAL', 2 );
276 * Content model ids, used by Content and ContentHandler.
277 * These IDs will be exposed in the API and XML dumps.
279 * Extensions that define their own content model IDs should take
280 * care to avoid conflicts. Using the extension name as a prefix is recommended,
281 * for example 'myextension-somecontent'.
283 define( 'CONTENT_MODEL_WIKITEXT', 'wikitext' );
284 define( 'CONTENT_MODEL_JAVASCRIPT', 'javascript' );
285 define( 'CONTENT_MODEL_CSS', 'css' );
286 define( 'CONTENT_MODEL_TEXT', 'text' );
290 * Content formats, used by Content and ContentHandler.
291 * These should be MIME types, and will be exposed in the API and XML dumps.
293 * Extensions are free to use the below formats, or define their own.
294 * It is recommended to stick with the conventions for MIME types.
296 define( 'CONTENT_FORMAT_WIKITEXT', 'text/x-wiki' ); // wikitext
297 define( 'CONTENT_FORMAT_JAVASCRIPT', 'text/javascript' ); // for js pages
298 define( 'CONTENT_FORMAT_CSS', 'text/css' ); // for css pages
299 define( 'CONTENT_FORMAT_TEXT', 'text/plain' ); // for future use, e.g. with some plain-html messages.
300 define( 'CONTENT_FORMAT_HTML', 'text/html' ); // for future use, e.g. with some plain-html messages.
301 define( 'CONTENT_FORMAT_SERIALIZED', 'application/vnd.php.serialized' ); // for future use with the api and for extensions
302 define( 'CONTENT_FORMAT_JSON', 'application/json' ); // for future use with the api, and for use by extensions
303 define( 'CONTENT_FORMAT_XML', 'application/xml' ); // for future use with the api, and for use by extensions