class MySqlSchemaState extends SchemaState

Traits

Properties

MySqlConnection $connection
protected Filesystem $files

The filesystem instance.

from  SchemaState
protected string|null $migrationTable

The name of the application's migration table.

from  SchemaState
protected Closure $processFactory

The process factory callback.

from  SchemaState
protected mixed $output

The output callable instance.

from  SchemaState

Methods

Closure|null
guardProcessOutput(Process $process, callable|null $output)

Stop the process if its output callback fails.

__construct(Connection $connection, Filesystem|null $files = null, callable|null $processFactory = null)

Create a new dumper instance.

void
dump(Connection $connection, string $path)

Dump the database's schema into a file.

void
load(string $path)

Load the given schema file into the database.

array
baseVariables(array $config)

Get the base variables for a dump / load command.

Process
makeProcess(mixed ...$arguments)

Create a new process instance.

bool
hasMigrationTable()

Determine if the current connection has a migration table.

string
getMigrationTable()

Get the name of the application's migration table.

withMigrationTable(string|null $table)

Specify the name of the application's migration table.

handleOutputUsing(callable $output)

Specify the callback that should be used to handle process output.

void
removeAutoIncrementingState(string $path)

Remove the auto-incrementing state from the given schema dump.

int
skipDumpDelimitedStatements(string $sql, int $offset, string $delimiter, string $sqlMode)

Find the end of an authored routine, trigger or event section in a native dump.

void
appendMigrationData(string $path)

Append the migration data to the schema dump.

string
baseDumpCommand()

Get the base dump command arguments for MySQL as a string.

string
connectionString(array $versionInfo)

Generate a basic connection string (--socket, --host, --port, --user, --password) for the database.

array
sslOptions(array $config)

Resolve PDO's TLS intent and PHP's certificate trust paths for the native client.

Process
executeDumpProcess(Process $process, callable|null $output, array $variables, int $depth = 0)

Execute the given dump process.

array
detectClientVersion()

Detect the MySQL client version.

Details

protected Closure|null guardProcessOutput(Process $process, callable|null $output)

Stop the process if its output callback fails.

Parameters

Process $process
callable|null $output

Return Value

Closure|null

in SchemaState at line 45
__construct(Connection $connection, Filesystem|null $files = null, callable|null $processFactory = null)

Create a new dumper instance.

Parameters

Connection $connection
Filesystem|null $files
callable|null $processFactory

at line 25
void dump(Connection $connection, string $path)

Dump the database's schema into a file.

Parameters

Connection $connection
string $path

Return Value

void

at line 195
void load(string $path)

Load the given schema file into the database.

Parameters

string $path

Return Value

void

at line 314
protected array baseVariables(array $config)

Get the base variables for a dump / load command.

Parameters

array $config

Return Value

array

in SchemaState at line 80
Process makeProcess(mixed ...$arguments)

Create a new process instance.

Parameters

mixed ...$arguments

Return Value

Process

in SchemaState at line 88
bool hasMigrationTable()

Determine if the current connection has a migration table.

Return Value

bool

in SchemaState at line 98
protected string getMigrationTable()

Get the name of the application's migration table.

Return Value

string

in SchemaState at line 108
SchemaState withMigrationTable(string|null $table)

Specify the name of the application's migration table.

Parameters

string|null $table

Return Value

SchemaState

in SchemaState at line 120
SchemaState handleOutputUsing(callable $output)

Specify the callback that should be used to handle process output.

Parameters

callable $output

Return Value

SchemaState

at line 44
protected void removeAutoIncrementingState(string $path)

Remove the auto-incrementing state from the given schema dump.

Parameters

string $path

Return Value

void

at line 78
protected int skipDumpDelimitedStatements(string $sql, int $offset, string $delimiter, string $sqlMode)

Find the end of an authored routine, trigger or event section in a native dump.

Parameters

string $sql
int $offset
string $delimiter
string $sqlMode

Return Value

int

at line 181
protected void appendMigrationData(string $path)

Append the migration data to the schema dump.

Parameters

string $path

Return Value

void

at line 212
protected string baseDumpCommand()

Get the base dump command arguments for MySQL as a string.

Return Value

string

at line 230
protected string connectionString(array $versionInfo)

Generate a basic connection string (--socket, --host, --port, --user, --password) for the database.

Parameters

array $versionInfo

Return Value

string

at line 275
protected array sslOptions(array $config)

Resolve PDO's TLS intent and PHP's certificate trust paths for the native client.

Parameters

array $config

Return Value

array

at line 342
protected Process executeDumpProcess(Process $process, callable|null $output, array $variables, int $depth = 0)

Execute the given dump process.

Parameters

Process $process
callable|null $output
array $variables
int $depth

Return Value

Process

Exceptions

Throwable

at line 375
protected array detectClientVersion()

Detect the MySQL client version.

Return Value

array