Extension:PhpTags Wiki/Reference
This page is currently a draft.
|
- Note: static methods and properties works with the objects of current page
W
editclass W {
/*
* Constants
*/
// Site language code ($wgLanguageCode)
const string CONTENT_LANGUAGE;
// The MediaWiki version (with git revision if available)
const string CURRENT_VERSION;
// The base URL of the server ($wgServer)
const string SERVER;
// The name of the server, derived from $wgServer
const string SERVER_NAME;
// The wiki's site name ($wgSitename)
const string SITE_NAME;
// Relative script path ($wgScriptPath)
const string SCRIPT_PATH;
// Relative style path ($wgStylePath)
const string STYLE_PATH;
}
WCache
editThe WCache class manages the cache of page rendering.
class WCache {
/*
* Constants
*/
// Time when current page was generated
const DateTime CACHE_TIME;
// Time when current page was generated
const string CACHE_TIME_STRING;
/*
* Static properties
*/
// The number of seconds after which cache of current page should expire
static int $cacheExpiry;
/*
* Methods
*/
// Set a flag in current page indicating that the content is dynamic and shouldn't be cached
static disableCache();
}
WCategory
editThe WCategory class is representation for a category.
class WCategory {
/*
* Read-only properties
*/
// Gets category ID, or false on failure
int $id;
// Gets DB key name, or false on failure
string $name;
// Gets WTitle of the category, or false on failure
WTitle $title;
// Gets total number of member pages and subcategories and files, or false
// on failure
int $memberCount;
// Gets total number of member pages, or false on failure
int $pageCount;
// Gets total number of member files, or false on failure
int $fileCount;
// Gets total number of member subcategories, or false on failure
int $subcatCount;
/*
* Methods
*/
// Returns new WCategory object
WCategory __construct( mixed $name );
}
WPage
editThe WPage class is representation for a page.
class WPage {
/*
* Constants
*/
// Current page's identifier
const int ID;
// Current page's WTitle object
const WTitle TITLE;
/*
* Static properties
*/
// Current page's default sort key for categories
static string $defaultSortKey;
// Deprecated, please use defaultSortKey static property!!!
static string $DEFAULT_SORT_KEY;
/*
* Static methods
*/
// Add current page to specified category
public static bool addCategory( mixed $category );
}
WStats
editThe WStats class has accessors for the site-wide statistics
class WStats {
/*
* Constants
*/
// Number of active users, based on the criteria used in
// Special:Statistics
const int ACTIVE_USERS;
// Number of users in the sysop group
const int ADMINS;
// Number of pages in content namespaces
const int ARTICLES;
// Number of wiki edits
const int EDITS;
// Number of uploaded files
const int FILES;
// Number of wiki pages
const int PAGES;
// Number of registered users
const int USERS;
// Size of of the job queue
const int JOBS;
}
WTitle
editThe WTitle class represents a title within MediaWiki
class WTitle {
/*
* Constants
*/
// Current page title without the namespace
const string NAME;
// Current page namespace and title
const string FULL_NAME;
// Page title of current page in the immediately superior subpage level
// without the namespace ('Title/foo' on 'Help:Title/foo/bar')
const string BASE_NAME;
// The subpage title of current page ('bar' on 'Help:Title/foo/bar')
const string SUBPAGE_NAME;
// Name of the root of the current page. Would return Foo on page
// Help:Foo/Bar/Baz
const string ROOT_NAME;
// Current page's namespace text
const string NS_TEXT;
// ID of current page's namespace
const int NS_NUMBER;
// Name of the associated content namespace
const string SUBJECT_NS_TEXT;
// ID of the associated content namespace
const int SUBJECT_NS_NUMBER;
// Name of the associated talk namespace
const string TALK_NS_TEXT;
// ID of the associated talk namespace
const int TALK_NS_NUMBER;
// Is this Title of current page in a namespace which contains content?
const string IS_CONTENT_PAGE;
// Would anybody with sufficient privileges be able to move current page?
const string IS_MOVABLE;
// Is current page the main page?
const string IS_MAIN_PAGE;
/*
* Read-only properties
*/
// Get full page title without the namespace
string $name;
// Get namespace and full page title
string $fullName;
// Get title of the page in the immediately superior subpage level without
// the namespace ('Title/foo' on 'Help:Title/foo/bar')
string $baseName;
// The subpage title ('bar' on 'Help:Title/foo/bar')
string $subpageName;
// Name of the root of the title. Would return Foo for title
// Help:Foo/Bar/Baz
string $rootName;
// Get ID of the page's namespace
string $nsText;
// Get the namespace text
int $nsNumber;
// Name of the associated content namespace
string $subjectNsText;
// ID of the associated content namespace
int $subjectNsNumber;
// Name of the associated talk namespace
string $talkNsText;
// ID of the associated talk namespace
int $talkNsNumber;
// Is this Title in a namespace which contains content?
string $isContentPage;
// Would anybody with sufficient privileges be able to move this page?
string $isMovable;
// Is this the main page?
string $isMainPage;
/*
* Methods
*/
// Returns new WTitle object
WTitle __construct( string $name, int $namespace = NS_MAIN );
}
WTitleArray
editThe WTitleArray class is designed to walk into a list of WTitle objects.