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