class DrupalMySQLiSource in Backup and Migrate 5.0.x
@package Drupal\backup_migrate\Drupal\Source
Hierarchy
- class \Drupal\backup_migrate\Core\Plugin\PluginBase implements ConfigurableInterface, PluginInterface uses ConfigurableTrait
- class \Drupal\backup_migrate\Core\Source\DatabaseSource implements FileProcessorInterface, DatabaseSourceInterface uses FileProcessorTrait
- class \Drupal\backup_migrate\Core\Source\MySQLiSource implements PluginCallerInterface uses PluginCallerTrait
- class \Drupal\backup_migrate\Drupal\Source\DrupalMySQLiSource
- class \Drupal\backup_migrate\Core\Source\MySQLiSource implements PluginCallerInterface uses PluginCallerTrait
- class \Drupal\backup_migrate\Core\Source\DatabaseSource implements FileProcessorInterface, DatabaseSourceInterface uses FileProcessorTrait
Expanded class hierarchy of DrupalMySQLiSource
2 files declare their use of DrupalMySQLiSource
- DefaultDBSourcePlugin.php in src/
Plugin/ BackupMigrateSource/ DefaultDBSourcePlugin.php - EntireSiteSourcePlugin.php in src/
Plugin/ BackupMigrateSource/ EntireSiteSourcePlugin.php
File
- src/
Drupal/ Source/ DrupalMySQLiSource.php, line 13
Namespace
Drupal\backup_migrate\Drupal\SourceView source
class DrupalMySQLiSource extends MySQLiSource {
/**
*
*/
public function importFromFile(BackupFileReadableInterface $file) {
$num = 0;
if ($conn = $this
->_getConnection()) {
// Open (or rewind) the file.
$file
->openForRead();
// Read one line at a time and run the query.
while ($line = $this
->_readSqlCommand($file)) {
// @todo Why was this commented out?
// @code
// if (_backup_migrate_check_timeout()) {
// return FALSE;
// }
// @endcode
if ($line) {
// Execute the sql query from the file.
$stmt = $conn
->prepare($line);
if (!$stmt) {
return FALSE;
}
$stmt
->execute();
$num++;
}
}
// Close the file, we're done reading it.
$file
->close();
}
return $num;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableTrait:: |
protected | property | The object's configuration object. | |
ConfigurableTrait:: |
protected | property | The initial configuration. | |
ConfigurableTrait:: |
public | function | Get a specific value from the configuration. | |
ConfigurableTrait:: |
public | function | Get the configuration object for this item. | |
ConfigurableTrait:: |
public | function | Get any validation errors in the config. | |
ConfigurableTrait:: |
public | function | Set the configuration for all plugins. | 1 |
ConfigurableTrait:: |
public | function | 2 | |
DatabaseSource:: |
public | function |
Get the default values for the plugin. Overrides ConfigurableTrait:: |
|
DatabaseSource:: |
public | function |
Get a definition for user-configurable settings. Overrides ConfigurableTrait:: |
|
DatabaseSource:: |
protected | function | Get the list of tables from this db. | |
DatabaseSource:: |
public | function |
Get a list of tables in this source. Overrides DatabaseSourceInterface:: |
|
DatabaseSource:: |
public | function |
Get an array of tables with some info. Overrides DatabaseSourceInterface:: |
|
DrupalMySQLiSource:: |
public | function |
Import to this source from the given backup file. Overrides MySQLiSource:: |
|
FileProcessorTrait:: |
protected | property | ||
FileProcessorTrait:: |
public | function | Provide the file mime for the given file extension if known. | |
FileProcessorTrait:: |
public | function | Get the temp file manager. | |
FileProcessorTrait:: |
public | function | Inject the temp file manager. | |
MySQLiSource:: |
protected | property | A MySQLi connection. | |
MySQLiSource:: |
public | function |
Export this source to the given temp file. Overrides SourceInterface:: |
|
MySQLiSource:: |
protected | function |
Get a list of tables in the db. Overrides DatabaseSource:: |
|
MySQLiSource:: |
protected | function | Run a db query on this destination's db. | |
MySQLiSource:: |
public | function |
Get a list of supported operations and their weight. Overrides PluginBase:: |
|
MySQLiSource:: |
protected | function | Get the version info for the given DB. | |
MySQLiSource:: |
protected | function | Get the sql to insert the data for a given table. | |
MySQLiSource:: |
protected | function | Return the first result of the query as an associated array. | |
MySQLiSource:: |
protected | function | Return the first field of the first result of a query. | |
MySQLiSource:: |
protected | function | Get the db connection for the specified db. | |
MySQLiSource:: |
protected | function | The footer of the sql dump file. | |
MySQLiSource:: |
protected | function | Get the header for the top of the SQL file. | |
MySQLiSource:: |
protected | function | Get the sql for the structure of the given table. | |
MySQLiSource:: |
protected | function | Lock the list of given tables in the database. | |
MySQLiSource:: |
protected | function | Read a multiline sql command from a file. | |
MySQLiSource:: |
protected | function | Unlock all tables in the database. | |
PluginBase:: |
public | function |
What is the weight of the given operation for this plugin. Overrides PluginInterface:: |
|
PluginBase:: |
public | function |
Does this plugin implement the given operation. Overrides PluginInterface:: |
|
PluginCallerTrait:: |
protected | property | ||
PluginCallerTrait:: |
public | function | Get the plugin manager. | |
PluginCallerTrait:: |
public | function | Inject the plugin manager. | |
TranslatableTrait:: |
protected | property | ||
TranslatableTrait:: |
public | function | ||
TranslatableTrait:: |
public | function | Translate the given string if there is a translator service available. |