Removed strval calls from magicLinkCallback(); items already comes in as one
[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 /**#@-*/
22
23 # Valid database indexes
24 # Operation-based indexes
25 define( 'DB_SLAVE', -1 ); # Read from the slave (or only server)
26 define( 'DB_MASTER', -2 ); # Write to master (or only server)
27 define( 'DB_LAST', -3 ); # Whatever database was used last
28
29 # Obsolete aliases
30 define( 'DB_READ', -1 );
31 define( 'DB_WRITE', -2 );
32
33
34 /**#@+
35 * Virtual namespaces; don't appear in the page database
36 */
37 define('NS_MEDIA', -2);
38 define('NS_SPECIAL', -1);
39 /**#@-*/
40
41 /**#@+
42 * Real namespaces
43 *
44 * Number 100 and beyond are reserved for custom namespaces;
45 * DO NOT assign standard namespaces at 100 or beyond.
46 * DO NOT Change integer values as they are most probably hardcoded everywhere
47 * see bug #696 which talked about that.
48 */
49 define('NS_MAIN', 0);
50 define('NS_TALK', 1);
51 define('NS_USER', 2);
52 define('NS_USER_TALK', 3);
53 define('NS_PROJECT', 4);
54 define('NS_PROJECT_TALK', 5);
55 define('NS_FILE', 6);
56 define('NS_FILE_TALK', 7);
57 define('NS_MEDIAWIKI', 8);
58 define('NS_MEDIAWIKI_TALK', 9);
59 define('NS_TEMPLATE', 10);
60 define('NS_TEMPLATE_TALK', 11);
61 define('NS_HELP', 12);
62 define('NS_HELP_TALK', 13);
63 define('NS_CATEGORY', 14);
64 define('NS_CATEGORY_TALK', 15);
65 /**
66 * NS_IMAGE and NS_IMAGE_TALK are the pre-v1.14 names for NS_FILE and
67 * NS_FILE_TALK respectively, and are kept for compatibility.
68 *
69 * When writing code that should be compatible with older MediaWiki
70 * versions, either stick to the old names or define the new constants
71 * yourself, if they're not defined already.
72 */
73 define('NS_IMAGE', NS_FILE);
74 define('NS_IMAGE_TALK', NS_FILE_TALK);
75 /**#@-*/
76
77 /**
78 * Available feeds objects
79 * Should probably only be defined when a page is syndicated ie when
80 * $wgOut->isSyndicated() is true
81 */
82 $wgFeedClasses = array(
83 'rss' => 'RSSFeed',
84 'atom' => 'AtomFeed',
85 );
86
87 /**#@+
88 * Maths constants
89 */
90 define( 'MW_MATH_PNG', 0 );
91 define( 'MW_MATH_SIMPLE', 1 );
92 define( 'MW_MATH_HTML', 2 );
93 define( 'MW_MATH_SOURCE', 3 );
94 define( 'MW_MATH_MODERN', 4 );
95 define( 'MW_MATH_MATHML', 5 );
96 /**#@-*/
97
98 /**#@+
99 * Cache type
100 */
101 define( 'CACHE_ANYTHING', -1 ); // Use anything, as long as it works
102 define( 'CACHE_NONE', 0 ); // Do not cache
103 define( 'CACHE_DB', 1 ); // Store cache objects in the DB
104 define( 'CACHE_MEMCACHED', 2 ); // MemCached, must specify servers in $wgMemCacheServers
105 define( 'CACHE_ACCEL', 3 ); // eAccelerator or Turck, whichever is available
106 define( 'CACHE_DBA', 4 ); // Use PHP's DBA extension to store in a DBM-style database
107 /**#@-*/
108
109
110
111 /**#@+
112 * Media types.
113 * This defines constants for the value returned by Image::getMediaType()
114 */
115 define( 'MEDIATYPE_UNKNOWN', 'UNKNOWN' ); // unknown format
116 define( 'MEDIATYPE_BITMAP', 'BITMAP' ); // some bitmap image or image source (like psd, etc). Can't scale up.
117 define( 'MEDIATYPE_DRAWING', 'DRAWING' ); // some vector drawing (SVG, WMF, PS, ...) or image source (oo-draw, etc). Can scale up.
118 define( 'MEDIATYPE_AUDIO', 'AUDIO' ); // simple audio file (ogg, mp3, wav, midi, whatever)
119 define( 'MEDIATYPE_VIDEO', 'VIDEO' ); // simple video file (ogg, mpg, etc; no not include formats here that may contain executable sections or scripts!)
120 define( 'MEDIATYPE_MULTIMEDIA', 'MULTIMEDIA' ); // Scriptable Multimedia (flash, advanced video container formats, etc)
121 define( 'MEDIATYPE_OFFICE', 'OFFICE' ); // Office Documents, Spreadsheets (office formats possibly containing apples, scripts, etc)
122 define( 'MEDIATYPE_TEXT', 'TEXT' ); // Plain text (possibly containing program code or scripts)
123 define( 'MEDIATYPE_EXECUTABLE', 'EXECUTABLE' ); // binary executable
124 define( 'MEDIATYPE_ARCHIVE', 'ARCHIVE' ); // archive file (zip, tar, etc)
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
195 /**
196 * Unicode and normalisation related
197 */
198 require_once dirname(__FILE__).'/normal/UtfNormalDefines.php';
199
200 # Hook support constants
201 define( 'MW_SUPPORTS_EDITFILTERMERGED', 1 );
202 define( 'MW_SUPPORTS_PARSERFIRSTCALLINIT', 1 );
203
204 # Allowed values for Parser::$mOutputType
205 # Parameter to Parser::startExternalParse().
206 define( 'OT_HTML', 1 );
207 define( 'OT_WIKI', 2 );
208 define( 'OT_PREPROCESS', 3 );
209 define( 'OT_MSG' , 3 ); // b/c alias for OT_PREPROCESS
210
211 # Flags for Parser::setFunctionHook
212 define( 'SFH_NO_HASH', 1 );
213 define( 'SFH_OBJECT_ARGS', 2 );
214
215 # Flags for Parser::setLinkHook
216 define( 'SLH_PATTERN', 1 );
217
218 # Flags for Parser::replaceLinkHolders
219 define( 'RLH_FOR_UPDATE', 1 );
220
221 # Autopromote conditions (must be here and not in Autopromote.php, so that
222 # they're loaded for DefaultSettings.php before AutoLoader.php)
223 define( 'APCOND_EDITCOUNT', 1 );
224 define( 'APCOND_AGE', 2 );
225 define( 'APCOND_EMAILCONFIRMED', 3 );
226 define( 'APCOND_INGROUPS', 4 );
227 define( 'APCOND_ISIP', 5 );
228 define( 'APCOND_IPINRANGE', 6 );
229 define( 'APCOND_AGE_FROM_EDIT', 7 );