public static function chmod(MOXMAN_Vfs_Local_File $file) { if ($file->isFile()) { $mask = $file->getConfig()->get("filesystem.local.file_mask"); } else { $mask = $file->getConfig()->get("filesystem.local.dir_mask"); } if ($mask && DIRECTORY_SEPARATOR == "/") { if ($mask[0] != '0') { throw new MOXMAN_Exception("Invalid bitmask value use octal string."); } @chmod($file->getInternalPath(), octdec($mask)); } }
/** * Closes the specified stream. This will first flush the stream before closing. */ public function close() { if ($this->fp) { fclose($this->fp); $this->fp = null; MOXMAN_Vfs_Local_File::chmod($this->file); } }