Пример #1
0
 /**
  * Validate directory permissions by given directory code
  *
  * @param string $code
  * @return bool
  */
 protected function validate($code)
 {
     $directory = $this->filesystem->getDirectoryWrite($code);
     if (!$directory->isExist()) {
         return false;
     }
     if (!$directory->isDirectory()) {
         return false;
     }
     if (!$directory->isReadable()) {
         return false;
     }
     if (!$directory->isWritable()) {
         return false;
     }
     return true;
 }
Пример #2
0
 /**
  * @param Filesystem $filesystem
  */
 public function __construct(Filesystem $filesystem)
 {
     $this->filesystem = $filesystem;
     $this->configDirectory = $filesystem->getDirectoryWrite('etc');
 }
Пример #3
0
 /**
  * Debug write to file process
  *
  * @param string $str
  * @return void
  */
 protected function _debugWriteToFile($str)
 {
     $str = '## ' . date('Y-m-d H:i:s') . "\r\n" . $str;
     $this->_filesystem->getDirectoryWrite('var')->writeFile($this->_debugFile, $str, FILE_APPEND | LOCK_EX);
 }
Пример #4
0
 /**
  * @param Filesystem $filesystem
  */
 public function __construct(Filesystem $filesystem)
 {
     $this->_modulesDirectory = $filesystem->getDirectoryRead(self::MODULES_DIR);
 }