Parsoid
A bidirectional parser between wikitext and HTML5
Wikimedia\Parsoid\Config\PageConfig Class Reference

Page-level configuration interface for Parsoid. More...

+ Inheritance diagram for Wikimedia\Parsoid\Config\PageConfig:

Public Member Functions

 getContentModel ()
 Get content model. More...
 
 hasLintableContentModel ()
 Whether the page has a lintable content model. More...
 
 getTitle ()
 The page's title, as a string. More...
 
 getNs ()
 The page's namespace ID. More...
 
 getPageId ()
 The page's ID, if any. More...
 
 getPageLanguage ()
 The page's language code. More...
 
 getPageLanguageDir ()
 The page's language direction. More...
 
 getRevisionId ()
 The revision's ID, if any. More...
 
 getParentRevisionId ()
 The revision's parent ID, if any. More...
 
 getRevisionTimestamp ()
 The revision's timestamp, if any. More...
 
 getRevisionUser ()
 The revision's author's user name, if any. More...
 
 getRevisionUserId ()
 The revision's author's user ID, if any. More...
 
 getRevisionSha1 ()
 The revision's SHA1 checksum, if any. More...
 
 getRevisionSize ()
 The revision's length, if known. More...
 
 getRevisionContent ()
 The revision's content. More...
 
 getVariant ()
 Get the page's language variant. More...
 
 setVariant ( $htmlVariant)
 Set the page's language variant. More...
 
 getPageMainContent ()
 FIXME: Once we remove the hardcoded slot name here, the name of this method could be updated, if necessary. More...
 

Detailed Description

Page-level configuration interface for Parsoid.

Member Function Documentation

◆ getContentModel()

Wikimedia\Parsoid\Config\PageConfig::getContentModel ( )
abstract

Get content model.

Returns
string

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getNs()

Wikimedia\Parsoid\Config\PageConfig::getNs ( )
abstract

The page's namespace ID.

Returns
int

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getPageId()

Wikimedia\Parsoid\Config\PageConfig::getPageId ( )
abstract

The page's ID, if any.

Returns
int 0 if the page doesn't exist

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getPageLanguage()

Wikimedia\Parsoid\Config\PageConfig::getPageLanguage ( )
abstract

The page's language code.

Returns
string

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getPageLanguageDir()

Wikimedia\Parsoid\Config\PageConfig::getPageLanguageDir ( )
abstract

The page's language direction.

Returns
string 'ltr' or 'rtl'

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getPageMainContent()

Wikimedia\Parsoid\Config\PageConfig::getPageMainContent ( )

FIXME: Once we remove the hardcoded slot name here, the name of this method could be updated, if necessary.

Shortcut method to get page source

Deprecated:
Use $this->topFrame->getSrcText()
Returns
string

◆ getParentRevisionId()

Wikimedia\Parsoid\Config\PageConfig::getParentRevisionId ( )
abstract

The revision's parent ID, if any.

Returns
int|null

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getRevisionContent()

Wikimedia\Parsoid\Config\PageConfig::getRevisionContent ( )
abstract

The revision's content.

Returns
PageContent|null

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getRevisionId()

Wikimedia\Parsoid\Config\PageConfig::getRevisionId ( )
abstract

The revision's ID, if any.

Returns
int|null

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getRevisionSha1()

Wikimedia\Parsoid\Config\PageConfig::getRevisionSha1 ( )
abstract

The revision's SHA1 checksum, if any.

Returns
string|null Hex encoded

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getRevisionSize()

Wikimedia\Parsoid\Config\PageConfig::getRevisionSize ( )
abstract

The revision's length, if known.

Returns
int|null Bytes

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getRevisionTimestamp()

Wikimedia\Parsoid\Config\PageConfig::getRevisionTimestamp ( )
abstract

The revision's timestamp, if any.

Returns
string|null "YYYYMMDDHHIISS" format

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getRevisionUser()

Wikimedia\Parsoid\Config\PageConfig::getRevisionUser ( )
abstract

The revision's author's user name, if any.

Returns
string|null

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getRevisionUserId()

Wikimedia\Parsoid\Config\PageConfig::getRevisionUserId ( )
abstract

The revision's author's user ID, if any.

Returns
int|null 0 if the user is not registered

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getTitle()

Wikimedia\Parsoid\Config\PageConfig::getTitle ( )
abstract

The page's title, as a string.

Returns
string With namespace, spaces not underscores

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ getVariant()

Wikimedia\Parsoid\Config\PageConfig::getVariant ( )

Get the page's language variant.

Returns
string|null

◆ hasLintableContentModel()

Wikimedia\Parsoid\Config\PageConfig::hasLintableContentModel ( )
abstract

Whether the page has a lintable content model.

Returns
bool

Reimplemented in Wikimedia\Parsoid\Mocks\MockPageConfig, and Wikimedia\Parsoid\Config\Api\PageConfig.

◆ setVariant()

Wikimedia\Parsoid\Config\PageConfig::setVariant (   $htmlVariant)

Set the page's language variant.

(Records the fact that conversion has been done in the parser pipeline.)

Parameters
string$htmlVariant

The documentation for this class was generated from the following file: