/** * 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; }
/** * @param Filesystem $filesystem */ public function __construct(Filesystem $filesystem) { $this->filesystem = $filesystem; $this->configDirectory = $filesystem->getDirectoryWrite('etc'); }
/** * 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); }
/** * @param Filesystem $filesystem */ public function __construct(Filesystem $filesystem) { $this->_modulesDirectory = $filesystem->getDirectoryRead(self::MODULES_DIR); }