Defines.php 6.7 KB

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