Documentation

MongoDb extends DbDumper
in package

Table of Contents

$authenticationDatabase  : null|string
$collection  : null|string
$compressor  : object
$dbName  : string
$dumpBinaryPath  : string
$excludeTables  : array<string|int, mixed>
$extraOptions  : array<string|int, mixed>
$host  : string
$includeTables  : array<string|int, mixed>
$password  : string
$port  : int
$socket  : string
$timeout  : int
$userName  : string
addExtraOption()  : $this
create()  : mixed
dumpToFile()  : mixed
Dump the contents of the database to the given file.
enableCompression()  : $this
excludeTables()  : $this
getCompressorExtension()  : string
getDbName()  : string
getDumpCommand()  : string
Generate the dump command for MongoDb.
getHost()  : string
includeTables()  : $this
setAuthenticationDatabase()  : MongoDb
setCollection()  : MongoDb
setDbName()  : $this
setDumpBinaryPath()  : mixed
setHost()  : $this
setPassword()  : $this
setPort()  : $this
setSocket()  : $this
setTimeout()  : $this
setUserName()  : $this
useCompressor()  : mixed
checkIfDumpWasSuccessFul()  : mixed
echoToFile()  : string
guardAgainstIncompleteCredentials()  : void
Verifies if the dbname and host options are set.

Properties

$authenticationDatabase

protected null|string $authenticationDatabase = null

$collection

protected null|string $collection = null

$compressor

protected object $compressor = null

$dumpBinaryPath

protected string $dumpBinaryPath = ''

$excludeTables

protected array<string|int, mixed> $excludeTables = []

$extraOptions

protected array<string|int, mixed> $extraOptions = []

$host

protected string $host = 'localhost'

$includeTables

protected array<string|int, mixed> $includeTables = []

Methods

addExtraOption()

public addExtraOption(string $extraOption) : $this
Parameters
$extraOption : string
Return values
$this

create()

public static create() : mixed
Return values
mixed

dumpToFile()

Dump the contents of the database to the given file.

public dumpToFile(string $dumpFile) : mixed
Parameters
$dumpFile : string
Tags
throws
CannotStartDump
throws
DumpFailed
Return values
mixed

enableCompression()

public enableCompression() : $this
Tags
deprecated
Return values
$this

excludeTables()

public excludeTables(string|array<string|int, mixed> $excludeTables) : $this
Parameters
$excludeTables : string|array<string|int, mixed>
Tags
throws
CannotSetParameter
Return values
$this

getCompressorExtension()

public getCompressorExtension() : string
Return values
string

getDbName()

public getDbName() : string
Return values
string

getDumpCommand()

Generate the dump command for MongoDb.

public getDumpCommand(string $filename) : string
Parameters
$filename : string
Return values
string

getHost()

public getHost() : string
Return values
string

includeTables()

public includeTables(string|array<string|int, mixed> $includeTables) : $this
Parameters
$includeTables : string|array<string|int, mixed>
Tags
throws
CannotSetParameter
Return values
$this

setAuthenticationDatabase()

public setAuthenticationDatabase(string $authenticationDatabase) : MongoDb
Parameters
$authenticationDatabase : string
Return values
MongoDb

setCollection()

public setCollection(string $collection) : MongoDb
Parameters
$collection : string
Return values
MongoDb

setDbName()

public setDbName(string $dbName) : $this
Parameters
$dbName : string
Return values
$this

setDumpBinaryPath()

public setDumpBinaryPath(string $dumpBinaryPath) : mixed
Parameters
$dumpBinaryPath : string
Return values
mixed

setHost()

public setHost(string $host) : $this
Parameters
$host : string
Return values
$this

setPassword()

public setPassword(string $password) : $this
Parameters
$password : string
Return values
$this

setPort()

public setPort(int $port) : $this
Parameters
$port : int
Return values
$this

setSocket()

public setSocket(string $socket) : $this
Parameters
$socket : string
Return values
$this

setTimeout()

public setTimeout(int $timeout) : $this
Parameters
$timeout : int
Return values
$this

setUserName()

public setUserName(string $userName) : $this
Parameters
$userName : string
Return values
$this

checkIfDumpWasSuccessFul()

protected checkIfDumpWasSuccessFul(Process $process, string $outputFile) : mixed
Parameters
$process : Process
$outputFile : string
Return values
mixed

echoToFile()

protected echoToFile(string $command, string $dumpFile) : string
Parameters
$command : string
$dumpFile : string
Return values
string

guardAgainstIncompleteCredentials()

Verifies if the dbname and host options are set.

protected guardAgainstIncompleteCredentials() : void
Tags
throws
CannotStartDump
Return values
void

Search results