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