Overview

Namespaces

  • GAubry
    • ErrorHandler
    • Helpers
    • Logger
    • Shell
  • Himedia
    • Padocc
      • DB
      • Minifier
      • Numbering
      • Properties
      • Task
        • Base
        • Extended
  • None
  • Psr
    • Log

Classes

  • Backup
  • Call
  • Composer
  • Copy
  • Environment
  • ExternalProperty
  • FillTemplate
  • HTTP
  • Link
  • MkDir
  • Project
  • Property
  • Rename
  • Sync
  • Target
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: 
 3: namespace Himedia\Padocc\Task\Base;
 4: 
 5: use Himedia\Padocc\AttributeProperties;
 6: use Himedia\Padocc\Task;
 7: 
 8: /**
 9:  * Crée un répertoire.
10:  * À inclure dans une tâche env ou target.
11:  *
12:  * Attributs :
13:  * - 'destdir'
14:  * - 'mode' : pour ajouter un chmod au mkdir
15:  *
16:  * Exemple : <mkdir destdir="${SERVERS}:${BASEDIR}/cache/smarty/templates_c" mode="777" />
17:  *
18:  * @author Geoffroy AUBRY <gaubry@hi-media.com>
19:  */
20: class MkDir extends Task
21: {
22:     /**
23:      * {@inheritdoc}
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:      * {@inheritdoc}
38:      * @codeCoverageIgnore
39:      */
40:     public static function getTagName ()
41:     {
42:         return 'mkdir';
43:     }
44: 
45:     /**
46:      * Phase de traitements centraux de l'exécution de la tâche.
47:      * Elle devrait systématiquement commencer par "parent::centralExecute();".
48:      * Appelé par execute().
49:      * @see execute()
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: 
Platform for Automatized Deployments with pOwerful Concise Configuration API documentation generated by ApiGen 2.8.0