1: <?php
2:
3: namespace Himedia\Padocc\Task\Base;
4:
5: use Himedia\Padocc\AttributeProperties;
6: use Himedia\Padocc\Task;
7:
8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19:
20: class MkDir extends Task
21: {
22: 23: 24:
25: protected function init()
26: {
27: parent::init();
28:
29: $this->aAttrProperties = array(
30: 'destdir' => AttributeProperties::DIR | AttributeProperties::REQUIRED
31: | AttributeProperties::ALLOW_PARAMETER,
32: 'mode' => 0
33: );
34: }
35:
36: 37: 38: 39:
40: public static function getTagName ()
41: {
42: return 'mkdir';
43: }
44:
45: 46: 47: 48: 49: 50:
51: protected function centralExecute ()
52: {
53: parent::centralExecute();
54: $this->getLogger()->info("+++Create directory '" . $this->aAttValues['destdir'] . "'.+++");
55: $sMode = (empty($this->aAttValues['mode']) ? '' : $this->aAttValues['mode']);
56:
57: $aDestDirs = $this->processPath($this->aAttValues['destdir']);
58: foreach ($aDestDirs as $sDestDir) {
59: $this->oShell->mkdir($sDestDir, $sMode);
60: }
61: $this->getLogger()->info('------');
62: }
63: }
64: