application/Espo/Core/Utils/File/Permission.php
public function setDefaultPermissions($path, $recurse = false)
    {
        if (!file_exists($path)) {
            return false;
        }

        $permission = $this->getDefaultPermissions();

        $result = $this->chmod($path, array($permission['file'], $permission['dir']), $recurse);
        if (!empty($permission['user'])) {
            $result &= $this->chown($path, $permission['user'], $recurse);
        }
        if (!empty($permission['group'])) {
            $result &= $this->chgrp($path, $permission['group'], $recurse);
        }

        return $result;
    }
public function setDefaultPermissions($path, $recurse = false)
    {
        if (!file_exists($path)) {
            return false;
        }

        $permission = $this->getDefaultPermissions();

        $result = $this->chmod($path, array($permission['file'], $permission['dir']), $recurse);
        if (!empty($permission['user'])) {
            $result &= $this->chown($path, $permission['user'], $recurse);
        }
        if (!empty($permission['group'])) {
            $result &= $this->chgrp($path, $permission['group'], $recurse);
        }

        return $result;
    }
public function setDefaultPermissions ( $ path , $ recurse = false ) { if ( ! file_exists ( $ path ) ) { return false ; } $ permission = $ this -> getDefaultPermissions ( ) ; $ result = $ this -> chmod ( $ path , array ( $ permission [ 'file' ] , $ permission [ 'dir' ] ) , $ recurse ) ; if ( ! empty ( $ permission [ 'user' ] ) ) { $ result &= $ this -> chown ( $ path , $ permission [ 'user' ] , $ recurse ) ; } if ( ! empty ( $ permission [ 'group' ] ) ) { $ result &= $ this -> chgrp ( $ path , $ permission [ 'group' ] , $ recurse ) ; } return $ result ; }
Set default permission

@param string $path
@param bool $recurse

@return bool
Set default permission