Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Maintenance\DumpEntities Class Reference

Maintenance script for generating a dump of entities in the repository. More...

+ Inheritance diagram for Wikibase\Repo\Maintenance\DumpEntities:
+ Collaboration diagram for Wikibase\Repo\Maintenance\DumpEntities:

Public Member Functions

 __construct ()
 
 setDumpEntitiesServices (SqlEntityIdPagerFactory $sqlEntityIdPagerFactory, array $existingEntityTypes, array $entityTypesToExcludeFromOutput)
 
 logMessage ( $message)
 Outputs a message vis the output() method.
 
 execute ()
 Do the actual work.
 
 finalSetup (SettingsBuilder $settingsBuilder=null)
 

Protected Member Functions

 getDumpType ()
 Used in description of script at command-line.
 
 createDumper ( $output)
 Create concrete dumper instance.
 
 getRedirectMode ()
 Returns EntityIdPager::NO_REDIRECTS.
 
 getEntityRevisionLookupCacheMode ()
 Cache flag for use in Store::getEntityRevisionLookup.
 

Private Member Functions

 openLogFile ( $file)
 Opens the given file for use by logMessage().
 
 closeLogFile ()
 Closes any currently open file opened with openLogFile().
 
 getEntityTypes ()
 
 makeIdStream (array $entityTypes, ExceptionHandler $exceptionReporter=null)
 
 makeIdQueryStream (array $entityTypes)
 
 makeIdFileStream ( $listFile, ExceptionHandler $exceptionReporter=null)
 

Private Attributes

 $sqlEntityIdPagerFactory
 
 $logFileHandle = false
 
 $existingEntityTypes = []
 
 $entityTypesToExcludeFromOutput = []
 

Detailed Description

Maintenance script for generating a dump of entities in the repository.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Maintenance\DumpEntities::__construct ( )

Member Function Documentation

◆ closeLogFile()

Wikibase\Repo\Maintenance\DumpEntities::closeLogFile ( )
private

Closes any currently open file opened with openLogFile().

◆ createDumper()

Wikibase\Repo\Maintenance\DumpEntities::createDumper ( $output)
abstractprotected

Create concrete dumper instance.

Parameters
resource$output
Returns
DumpGenerator

Reimplemented in Wikibase\Repo\Maintenance\DumpJson, and Wikibase\Repo\Maintenance\DumpRdf.

◆ execute()

Wikibase\Repo\Maintenance\DumpEntities::execute ( )

Do the actual work.

All child classes will need to implement this

Reimplemented in Wikibase\Repo\Maintenance\DumpJson, and Wikibase\Repo\Maintenance\DumpRdf.

◆ finalSetup()

Wikibase\Repo\Maintenance\DumpEntities::finalSetup ( SettingsBuilder $settingsBuilder = null)

◆ getDumpType()

Wikibase\Repo\Maintenance\DumpEntities::getDumpType ( )
abstractprotected

Used in description of script at command-line.

Returns
string

Reimplemented in Wikibase\Repo\Maintenance\DumpJson, and Wikibase\Repo\Maintenance\DumpRdf.

◆ getEntityRevisionLookupCacheMode()

Wikibase\Repo\Maintenance\DumpEntities::getEntityRevisionLookupCacheMode ( )
protected

Cache flag for use in Store::getEntityRevisionLookup.

Returns
string One of Store::LOOKUP_CACHING_RETRIEVE_ONLY and Store::LOOKUP_CACHING_DISABLED

◆ getEntityTypes()

Wikibase\Repo\Maintenance\DumpEntities::getEntityTypes ( )
private
Returns
string[]

◆ getRedirectMode()

Wikibase\Repo\Maintenance\DumpEntities::getRedirectMode ( )
protected

Returns EntityIdPager::NO_REDIRECTS.

Returns
mixed a EntityIdPager::XXX_REDIRECTS constant

Reimplemented in Wikibase\Repo\Maintenance\DumpRdf.

◆ logMessage()

Wikibase\Repo\Maintenance\DumpEntities::logMessage ( $message)

Outputs a message vis the output() method.

See also
MessageReporter::logMessage()
Parameters
string$message

◆ makeIdFileStream()

Wikibase\Repo\Maintenance\DumpEntities::makeIdFileStream ( $listFile,
ExceptionHandler $exceptionReporter = null )
private
Parameters
string$listFile
ExceptionHandler | null$exceptionReporter
Returns
EntityIdReader

◆ makeIdQueryStream()

Wikibase\Repo\Maintenance\DumpEntities::makeIdQueryStream ( array $entityTypes)
private
Parameters
string[]$entityTypes
Returns
SqlEntityIdPager

◆ makeIdStream()

Wikibase\Repo\Maintenance\DumpEntities::makeIdStream ( array $entityTypes,
ExceptionHandler $exceptionReporter = null )
private
Parameters
string[]$entityTypes
ExceptionHandler | null$exceptionReporter
Returns
EntityIdReader|SqlEntityIdPager a stream of EntityId objects

◆ openLogFile()

Wikibase\Repo\Maintenance\DumpEntities::openLogFile ( $file)
private

Opens the given file for use by logMessage().

Parameters
string$fileuse "-" as a shortcut for "php://stdout"

◆ setDumpEntitiesServices()

Wikibase\Repo\Maintenance\DumpEntities::setDumpEntitiesServices ( SqlEntityIdPagerFactory $sqlEntityIdPagerFactory,
array $existingEntityTypes,
array $entityTypesToExcludeFromOutput )

Member Data Documentation

◆ $entityTypesToExcludeFromOutput

Wikibase\Repo\Maintenance\DumpEntities::$entityTypesToExcludeFromOutput = []
private

◆ $existingEntityTypes

Wikibase\Repo\Maintenance\DumpEntities::$existingEntityTypes = []
private

◆ $logFileHandle

Wikibase\Repo\Maintenance\DumpEntities::$logFileHandle = false
private

◆ $sqlEntityIdPagerFactory

Wikibase\Repo\Maintenance\DumpEntities::$sqlEntityIdPagerFactory
private

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