/**
  * @param LeConfigData $data
  */
 public function init(LeConfigData $data)
 {
     exec('mkdir ' . $this->getAppDir());
     exec('chmod 777 -Rf ' . $this->getAppDir());
     exec('mkdir ' . $this->getConfigDir());
     $owner = $data->getLdapOwner();
     $group = $data->getLdapOwner();
     if (!empty($owner) && !empty($group)) {
         exec('chown -Rf ' . $owner . ':' . $group . ' ' . $this->getAppDir());
     }
 }
Beispiel #2
0
 /**
  * @param LeValidator|null $validator
  * @param array|null $input
  */
 public function __construct(LeValidator $validator = null, array $input = null)
 {
     parent::__construct($validator);
     if (!is_null($input)) {
         foreach ($input as $name => $value) {
             $this->load($name, $value);
         }
     }
 }
 /**
  * @param LeQuest $leQuest
  * @param $data
  */
 private function setLdapCredentials(LeQuest $leQuest, LeConfigData &$data)
 {
     if (!is_null($leQuest->get('owner'))) {
         $data->setLdapOwner($leQuest->get('owner'));
     }
     if (!is_null($leQuest->get('group'))) {
         $data->setLdapGroup($leQuest->get('group'));
     }
 }
Beispiel #4
0
 public function initConfigClass(LeConfigData $data)
 {
     $classPathAndName = $this->getConfigDir() . $this->getClassFileName();
     exec("cp src/Leroy/LePackage/Config/Templates/{$this->getClassFileName()} {$classPathAndName}");
     exec("chmod 775 {$classPathAndName}");
     $owner = $data->getLdapOwner();
     $group = $data->getLdapOwner();
     if (!empty($owner) && !empty($group)) {
         exec('chown -Rf ' . $owner . ':' . $group . ' ' . $classPathAndName);
     }
 }