Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function smartChmod($path, $chmod = null) {
- if (file_exists($path)) {
- if (is_null($chmod)) {
- $chmod = is_file($path) ? 644 : 755;
- if (in_array(get_current_user(), explode('|', 'apache|httpd|nobody|system|webdaemon|www|www-data'))) {
- $chmod += 22;
- }
- }
- return chmod($path, octdec(intval($chmod)));
- }
- return false;
- }
- ?>
Add Comment
Please, Sign In to add comment