nette / utils

🛠 Lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
https://doc.nette.org/utils
Other
1.98k stars 147 forks source link

FileSystem: Add method makeWritable() #244

Closed janbarasek closed 3 years ago

janbarasek commented 3 years ago

Very often I need to write to a directory where I cannot guarantee the correctly set permissions in advance.

This feature can try to fix the permissions according to the settings, or throw an exception.

Directory permissions are set recursively.

JanTvrdik commented 3 years ago

1) fix permission is bad name; it should be called changePermissions (with removal of default values for $dirMode and $fileMode) or makeWritable (and keep the default values) 2) i'm not sure if you need the $recursive parameter as everything in FileSytem is always recursive

janbarasek commented 3 years ago

@JanTvrdik Fixed, thanks.