install/core/SystemHelper.php
public function getPermissionCommands($path, $permissions = array('644', '755'), $isSudo = false, $isFile = null, $changeOwner = true)
    {
        if (is_string($path)) {
            $path = array_fill(0, 2, $path);
        }
        list($chmodPath, $chownPath) = $path;

        $commands = array();
        $commands[] = $this->getChmodCommand($chmodPath, $permissions, $isSudo, $isFile);

        if ($changeOwner) {
            $chown = $this->getChownCommand($chownPath, $isSudo, false);
            if (isset($chown)) {
                $commands[] = $chown;
            }
        }
        return implode(' ' . $this->combineOperator . ' ', $commands).';';
    }
public function getPermissionCommands($path, $permissions = array('644', '755'), $isSudo = false, $isFile = null, $changeOwner = true)
    {
        if (is_string($path)) {
            $path = array_fill(0, 2, $path);
        }
        list($chmodPath, $chownPath) = $path;

        $commands = array();
        $commands[] = $this->getChmodCommand($chmodPath, $permissions, $isSudo, $isFile);

        if ($changeOwner) {
            $chown = $this->getChownCommand($chownPath, $isSudo, false);
            if (isset($chown)) {
                $commands[] = $chown;
            }
        }
        return implode(' ' . $this->combineOperator . ' ', $commands).';';
    }
public function getPermissionCommands ( $ path , $ permissions = array ( '644' , '755' ) , $ isSudo = false , $ isFile = null , $ changeOwner = true ) { if ( is_string ( $ path ) ) { $ path = array_fill ( 0 , 2 , $ path ) ; } list ( $ chmodPath , $ chownPath ) = $ path ; $ commands = array ( ) ; $ commands [ ] = $ this -> getChmodCommand ( $ chmodPath , $ permissions , $ isSudo , $ isFile ) ; if ( $ changeOwner ) { $ chown = $ this -> getChownCommand ( $ chownPath , $ isSudo , false ) ; if ( isset ( $ chown ) ) { $ commands [ ] = $ chown ; } } return implode ( ' ' . $ this -> combineOperator . ' ' , $ commands ) . ';' ; }
Get permission commands

@param  string | array  $path
@param  string | array  $permissions
@param  boolean $isSudo
@param  bool  $isFile
@return string
Get permission commands