class DebugDestination in Backup and Migrate 5.0.x
@package Drupal\backup_migrate\Core\Destination
Hierarchy
- class \Drupal\backup_migrate\Core\Plugin\PluginBase implements ConfigurableInterface, PluginInterface uses ConfigurableTrait
- class \Drupal\backup_migrate\Core\Destination\StreamDestination implements ConfigurableInterface, WritableDestinationInterface
- class \Drupal\backup_migrate\Core\Destination\DebugDestination implements WritableDestinationInterface
- class \Drupal\backup_migrate\Core\Destination\StreamDestination implements ConfigurableInterface, WritableDestinationInterface
Expanded class hierarchy of DebugDestination
File
- src/
Core/ Destination/ DebugDestination.php, line 13
Namespace
Drupal\backup_migrate\Core\DestinationView source
class DebugDestination extends StreamDestination implements WritableDestinationInterface {
/**
* {@inheritdoc}
*/
public function saveFile(BackupFileReadableInterface $file) {
// Quick and dirty way to html format this output.
if ($this
->confGet('format') == 'html') {
print '<pre>';
}
// Output the metadata.
if ($this
->confGet('showmeta')) {
print "---------------------\n";
print "Metadata: \n";
print_r($file
->getMetaAll());
print "---------------------\n";
}
// Output the body.
if ($this
->confGet('showbody')) {
print "---------------------\n";
print "Body: \n";
$max = $this
->confGet('maxbody');
$chunk = min($max, 1024);
if ($file
->openForRead()) {
// Transfer file in 1024 byte chunks to save memory usage.
while ($max > 0 && ($data = $file
->readBytes($chunk))) {
print $data;
$max -= $chunk;
}
$file
->close();
}
print "---------------------\n";
}
// Quick and dirty way to html format this output.
if ($this
->confGet('format') == 'html') {
print '</pre>';
}
exit;
}
/**
* Get the default values for the plugin.
*
* @return \Drupal\backup_migrate\Core\Config\Config
*/
public function configDefaults() {
return new Config([
'showmeta' => TRUE,
'showbody' => TRUE,
'maxbody' => 1024 * 16,
'format' => 'text',
]);
}
}
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 | Get a default (blank) schema. | 10 |
ConfigurableTrait:: |
public | function | Set the configuration for all plugins. | 1 |
ConfigurableTrait:: |
public | function | 2 | |
DebugDestination:: |
public | function |
Get the default values for the plugin. Overrides ConfigurableTrait:: |
|
DebugDestination:: |
public | function |
Save a file to the destination. Overrides StreamDestination:: |
|
PluginBase:: |
public | function |
What is the weight of the given operation for this plugin. Overrides PluginInterface:: |
|
PluginBase:: |
public | function |
Get a list of supported operations and their weight. Overrides PluginInterface:: |
8 |
PluginBase:: |
public | function |
Does this plugin implement the given operation. Overrides PluginInterface:: |
|
StreamDestination:: |
public | function | 1 | |
StreamDestination:: |
public | function | ||
StreamDestination:: |
public | function | ||
StreamDestination:: |
public | function | ||
TranslatableTrait:: |
protected | property | ||
TranslatableTrait:: |
public | function | ||
TranslatableTrait:: |
public | function | Translate the given string if there is a translator service available. |