1: <?php
2:
3: namespace Himedia\Padocc\Task\Base;
4:
5: use Himedia\Padocc\AttributeProperties;
6: use Himedia\Padocc\Task;
7:
8: /**
9: * @author Geoffroy AUBRY <gaubry@hi-media.com>
10: */
11: class Backup extends Task
12: {
13: /**
14: * {@inheritdoc}
15: */
16: protected function init()
17: {
18: $this->aAttrProperties = array(
19: 'src' => AttributeProperties::SRC_PATH | AttributeProperties::FILEJOKER | AttributeProperties::REQUIRED,
20: 'destfile' => AttributeProperties::FILE | AttributeProperties::REQUIRED
21: );
22: }
23:
24: /**
25: * {@inheritdoc}
26: * @codeCoverageIgnore
27: */
28: public static function getTagName ()
29: {
30: return 'backup';
31: }
32:
33: /**
34: * Phase de traitements centraux de l'exécution de la tâche.
35: * Elle devrait systématiquement commencer par "parent::centralExecute();".
36: * Appelé par execute().
37: * @see execute()
38: */
39: protected function centralExecute ()
40: {
41: parent::centralExecute();
42: $this->getLogger()->info('+++');
43: $this->oShell->backup($this->aAttValues['src'], $this->aAttValues['destfile']);
44: $this->getLogger()->info('---');
45: }
46: }
47: