application/Espo/Core/Utils/File/Permission.php
protected function chgrpRecurse($path, $group) {

        if (!file_exists($path)) {
            return false;
        }

        if (!is_dir($path)) {
            return $this->chgrpReal($path, $group);
        }

        $result = $this->chgrpReal($path, $group);

        $allFiles = $this->getFileManager()->getFileList($path);
        foreach ($allFiles as $item) {
            $result &= $this->chgrpRecurse($path . Utils\Util::getSeparator() . $item, $group);
        }

        return (bool) $result;
    }
protected function chgrpRecurse($path, $group) {

        if (!file_exists($path)) {
            return false;
        }

        if (!is_dir($path)) {
            return $this->chgrpReal($path, $group);
        }

        $result = $this->chgrpReal($path, $group);

        $allFiles = $this->getFileManager()->getFileList($path);
        foreach ($allFiles as $item) {
            $result &= $this->chgrpRecurse($path . Utils\Util::getSeparator() . $item, $group);
        }

        return (bool) $result;
    }
protected function chgrpRecurse ( $ path , $ group ) { if ( ! file_exists ( $ path ) ) { return false ; } if ( ! is_dir ( $ path ) ) { return $ this -> chgrpReal ( $ path , $ group ) ; } $ result = $ this -> chgrpReal ( $ path , $ group ) ; $ allFiles = $ this -> getFileManager ( ) -> getFileList ( $ path ) ; foreach ( $ allFiles as $ item ) { $ result &= $ this -> chgrpRecurse ( $ path . Utils \ Util :: getSeparator ( ) . $ item , $ group ) ; } return ( bool ) $ result ; }
Change group permission recursive

@param string $filename
@param int $fileOctal - ex. 0644
@param int $dirOctal - ex. 0755

@return bool
Change group permission recursive