* Added possibility to set short options aliases to long long options, added -h alias...
[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 * Available feeds objects
90 * Should probably only be defined when a page is syndicated ie when
91 * $wgOut->isSyndicated() is true
92 */
93 $wgFeedClasses = array(
94 'rss' => 'RSSFeed',
95 'atom' => 'AtomFeed',
96 );
97
98 /**@{
99 * Maths constants
100 */
101 define( 'MW_MATH_PNG', 0 );
102 define( 'MW_MATH_SIMPLE', 1 );
103 define( 'MW_MATH_HTML', 2 );
104 define( 'MW_MATH_SOURCE', 3 );
105 define( 'MW_MATH_MODERN', 4 );
106 define( 'MW_MATH_MATHML', 5 );
107 /**@}*/
108
109 /**@{
110 * Cache type
111 */
112 define( 'CACHE_ANYTHING', -1 ); // Use anything, as long as it works
113 define( 'CACHE_NONE', 0 ); // Do not cache
114 define( 'CACHE_DB', 1 ); // Store cache objects in the DB
115 define( 'CACHE_MEMCACHED', 2 ); // MemCached, must specify servers in $wgMemCacheServers
116 define( 'CACHE_ACCEL', 3 ); // eAccelerator
117 define( 'CACHE_DBA', 4 ); // Use PHP's DBA extension to store in a DBM-style database
118 /**@}*/
119
120 /**@{
121 * Media types.
122 * This defines constants for the value returned by File::getMediaType()
123 */
124 define( 'MEDIATYPE_UNKNOWN', 'UNKNOWN' ); // unknown format
125 define( 'MEDIATYPE_BITMAP', 'BITMAP' ); // some bitmap image or image source (like psd, etc). Can't scale up.
126 define( 'MEDIATYPE_DRAWING', 'DRAWING' ); // some vector drawing (SVG, WMF, PS, ...) or image source (oo-draw, etc). Can scale up.
127 define( 'MEDIATYPE_AUDIO', 'AUDIO' ); // simple audio file (ogg, mp3, wav, midi, whatever)
128 define( 'MEDIATYPE_VIDEO', 'VIDEO' ); // simple video file (ogg, mpg, etc; no not include formats here that may contain executable sections or scripts!)
129 define( 'MEDIATYPE_MULTIMEDIA', 'MULTIMEDIA' ); // Scriptable Multimedia (flash, advanced video container formats, etc)
130 define( 'MEDIATYPE_OFFICE', 'OFFICE' ); // Office Documents, Spreadsheets (office formats possibly containing apples, scripts, etc)
131 define( 'MEDIATYPE_TEXT', 'TEXT' ); // Plain text (possibly containing program code or scripts)
132 define( 'MEDIATYPE_EXECUTABLE', 'EXECUTABLE' ); // binary executable
133 define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); // archive file (zip, tar, etc)
134 define( 'MEDIATYPE_DATA', 'DATA' ); // A generic data file (like kml and kmz)
135 /**@}*/
136
137 /**@{
138 * Antivirus result codes, for use in $wgAntivirusSetup.
139 */
140 define( 'AV_NO_VIRUS', 0 ); #scan ok, no virus found
141 define( 'AV_VIRUS_FOUND', 1 ); #virus found!
142 define( 'AV_SCAN_ABORTED', -1 ); #scan aborted, the file is probably imune
143 define( 'AV_SCAN_FAILED', false ); #scan failed (scanner not found or error in scanner)
144 /**@}*/
145
146 /**@{
147 * Anti-lock flags
148 * See DefaultSettings.php for a description
149 */
150 define( 'ALF_PRELOAD_LINKS', 1 );
151 define( 'ALF_PRELOAD_EXISTENCE', 2 );
152 define( 'ALF_NO_LINK_LOCK', 4 );
153 define( 'ALF_NO_BLOCK_LOCK', 8 );
154 /**@}*/
155
156 /**@{
157 * Date format selectors; used in user preference storage and by
158 * Language::date() and co.
159 */
160 /*define( 'MW_DATE_DEFAULT', '0' );
161 define( 'MW_DATE_MDY', '1' );
162 define( 'MW_DATE_DMY', '2' );
163 define( 'MW_DATE_YMD', '3' );
164 define( 'MW_DATE_ISO', 'ISO 8601' );*/
165 define( 'MW_DATE_DEFAULT', 'default' );
166 define( 'MW_DATE_MDY', 'mdy' );
167 define( 'MW_DATE_DMY', 'dmy' );
168 define( 'MW_DATE_YMD', 'ymd' );
169 define( 'MW_DATE_ISO', 'ISO 8601' );
170 /**@}*/
171
172 /**@{
173 * RecentChange type identifiers
174 * This may be obsolete; log items are now used for moves?
175 */
176 define( 'RC_EDIT', 0);
177 define( 'RC_NEW', 1);
178 define( 'RC_MOVE', 2);
179 define( 'RC_LOG', 3);
180 define( 'RC_MOVE_OVER_REDIRECT', 4);
181 /**@}*/
182
183 /**@{
184 * Article edit flags
185 */
186 define( 'EDIT_NEW', 1 );
187 define( 'EDIT_UPDATE', 2 );
188 define( 'EDIT_MINOR', 4 );
189 define( 'EDIT_SUPPRESS_RC', 8 );
190 define( 'EDIT_FORCE_BOT', 16 );
191 define( 'EDIT_DEFER_UPDATES', 32 );
192 define( 'EDIT_AUTOSUMMARY', 64 );
193 /**@}*/
194
195 /**@{
196 * Flags for Database::makeList()
197 * These are also available as Database class constants
198 */
199 define( 'LIST_COMMA', 0 );
200 define( 'LIST_AND', 1 );
201 define( 'LIST_SET', 2 );
202 define( 'LIST_NAMES', 3);
203 define( 'LIST_OR', 4);
204 define( 'LIST_SET_PREPARED', 8); // List of (?, ?, ?) for DatabaseIbm_db2
205 /**@}*/
206
207 /**
208 * Unicode and normalisation related
209 */
210 require_once dirname(__FILE__).'/normal/UtfNormalDefines.php';
211
212 /**@{
213 * Hook support constants
214 */
215 define( 'MW_SUPPORTS_EDITFILTERMERGED', 1 );
216 define( 'MW_SUPPORTS_PARSERFIRSTCALLINIT', 1 );
217 define( 'MW_SUPPORTS_LOCALISATIONCACHE', 1 );
218 /**@}*/
219
220 /** Support for $wgResourceModules */
221 define( 'MW_SUPPORTS_RESOURCE_MODULES', 1 );
222
223 /**@{
224 * Allowed values for Parser::$mOutputType
225 * Parameter to Parser::startExternalParse().
226 */
227 define( 'OT_HTML', 1 );
228 define( 'OT_WIKI', 2 );
229 define( 'OT_PREPROCESS', 3 );
230 define( 'OT_MSG' , 3 ); // b/c alias for OT_PREPROCESS
231 define( 'OT_PLAIN', 4 );
232 /**@}*/
233
234 /**@{
235 * Flags for Parser::setFunctionHook
236 */
237 define( 'SFH_NO_HASH', 1 );
238 define( 'SFH_OBJECT_ARGS', 2 );
239 /**@}*/
240
241 /**
242 * Flags for Parser::setLinkHook
243 */
244 define( 'SLH_PATTERN', 1 );
245
246 /**
247 * Flags for Parser::replaceLinkHolders
248 */
249 define( 'RLH_FOR_UPDATE', 1 );
250
251 /**@{
252 * Autopromote conditions (must be here and not in Autopromote.php, so that
253 * they're loaded for DefaultSettings.php before AutoLoader.php)
254 */
255 define( 'APCOND_EDITCOUNT', 1 );
256 define( 'APCOND_AGE', 2 );
257 define( 'APCOND_EMAILCONFIRMED', 3 );
258 define( 'APCOND_INGROUPS', 4 );
259 define( 'APCOND_ISIP', 5 );
260 define( 'APCOND_IPINRANGE', 6 );
261 define( 'APCOND_AGE_FROM_EDIT', 7 );
262 define( 'APCOND_BLOCKED', 8 );
263 /**@}*/