Wikibase
MediaWiki Wikibase extension
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. More...
 
 execute ()
 Do the actual work. More...
 
 finalSetup ()
 

Protected Member Functions

 createDumper ( $output)
 Create concrete dumper instance. More...
 
 getRedirectMode ()
 Returns EntityIdPager::NO_REDIRECTS. More...
 
 getEntityRevisionLookupCacheMode ()
 Cache flag for use in Store::getEntityRevisionLookup. More...
 

Private Member Functions

 openLogFile ( $file)
 Opens the given file for use by logMessage(). More...
 
 closeLogFile ()
 Closes any currently open file opened with openLogFile(). More...
 
 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\DumpRdf, and Wikibase\Repo\Maintenance\DumpJson.

◆ execute()

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

Do the actual work.

All child classes will need to implement this

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

◆ finalSetup()

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

◆ getEntityRevisionLookupCacheMode()

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

◆ getEntityTypes()

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

◆ 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
Exceptions
MWException
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"
Exceptions
MWException

◆ 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: