Go to the documentation of this file.
41 require_once __DIR__ .
"/ORMRowTest.php";
69 $isSqlite =
$GLOBALS[
'wgDBtype'] ===
'sqlite';
70 $isPostgres =
$GLOBALS[
'wgDBtype'] ===
'postgres';
72 $idField = $isSqlite ?
'INTEGER' :
'INT unsigned';
73 $primaryKey = $isSqlite ?
'PRIMARY KEY AUTOINCREMENT' :
'auto_increment PRIMARY KEY';
77 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName(
'orm_test' ) .
"(
78 test_id serial PRIMARY KEY,
79 test_name TEXT NOT NULL DEFAULT '',
80 test_age INTEGER NOT NULL DEFAULT 0,
81 test_height REAL NOT NULL DEFAULT 0,
82 test_awesome INTEGER NOT NULL DEFAULT 0,
91 'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName(
'orm_test' ) .
'(
92 test_id ' . $idField .
' NOT NULL ' . $primaryKey .
',
93 test_name VARCHAR(255) NOT NULL,
94 test_age TINYINT unsigned NOT NULL,
95 test_height FLOAT NOT NULL,
96 test_awesome TINYINT unsigned NOT NULL,
97 test_stuff BLOB NOT NULL,
98 test_moarstuff BLOB NOT NULL,
99 test_time varbinary(14) NOT NULL
108 $dbw->dropTable(
'orm_test', __METHOD__ );
119 'time' => $dbw->timestamp(
'20120101020202' ),
123 'stuff' =>
array( 13, 11, 7, 5, 3, 2 ),
138 'str' =>
'foobar4645645',
142 'array' =>
array( 42,
'foobar' ),
143 'blob' =>
new stdClass()
203 'moarstuff' =>
'blob',
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration which are documented in DefaultSettings php There is no comprehensive documentation for the remaining however some of the most important ones are listed below They are typically initialised either in index php or in Setup php For a description of the see design txt $wgTitle Title object created from the request URL $wgOut OutputPage object for HTTP response $wgUser User object for the user associated with the current request $wgLang Language object selected by user preferences $wgContLang Language object associated with the wiki being viewed $wgParser Parser object Parser extensions register their hooks here $wgRequest WebRequest object
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
getName()
Returns the name of the database table objects of this type are stored in.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
getRowClass()
Returns the name of a IORMRow implementing class that represents single rows in this table.
constructorTestProvider()
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
getFieldPrefix()
Gets the db field prefix.
getFields()
Returns an array with the fields and their types this object contains.
static singleton()
Get an instance of this class.