protected function chownRecurse($path, $user)
    {
        if (!file_exists($path)) {
            return false;
        }

        if (!is_dir($path)) {
            return $this->chownReal($path, $user);
        }

        $result = $this->chownReal($path, $user);

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

        return (bool) $result;
    }
protected function chownRecurse($path, $user)
    {
        if (!file_exists($path)) {
            return false;
        }

        if (!is_dir($path)) {
            return $this->chownReal($path, $user);
        }

        $result = $this->chownReal($path, $user);

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

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

@param string $path
@param string $user

@return bool
Change owner permission recursive