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