SchemaLoader
in package
Create test database schema from one or more SQL dump files.
This class can be useful to create test database schema when your schema is managed by tools external to your CakePHP application.
It is not well suited for applications/plugins that need to support multiple database platforms. You should use migrations for that instead.
Table of Contents
Properties
- $helper : ConnectionHelper
Methods
- __construct() : mixed
- Constructor.
- loadSqlFiles() : void
- Load and apply schema sql file, or an array of files.
Properties
$helper
protected
ConnectionHelper
$helper
Methods
__construct()
Constructor.
public
__construct() : mixed
loadSqlFiles()
Load and apply schema sql file, or an array of files.
public
loadSqlFiles(array<string|int, string>|string $paths[, string $connectionName = 'test' ][, bool $dropTables = true ][, bool $truncateTables = false ]) : void
Parameters
- $paths : array<string|int, string>|string
-
Schema files to load
- $connectionName : string = 'test'
-
Connection name
- $dropTables : bool = true
-
Drop all tables prior to loading schema files
- $truncateTables : bool = false
-
Truncate all tables after loading schema files