mirror of
https://github.com/Chouchen/Shikiryu_Backup.git
synced 2021-06-30 16:02:14 +02:00
20 lines
561 B
PHP
20 lines
561 B
PHP
<?php
|
|
|
|
class Shikiryu_Backup_Transport_Factory
|
|
{
|
|
/**
|
|
* @param $type
|
|
* @param Shikiryu_Backup_Abstract $backup
|
|
*
|
|
* @return bool
|
|
*/
|
|
public static function getAndSend($type, Shikiryu_Backup_Abstract $backup, $args = null) {
|
|
$class = sprintf('Shikiryu_Backup_Transport_%s', ucfirst($type));
|
|
if (class_exists($class)) {
|
|
/* @var $instance Shikiryu_Backup_Transport_Abstract */
|
|
$instance = new $class($backup, $args);
|
|
return $instance->send();
|
|
}
|
|
return false;
|
|
}
|
|
} |