public static function chmod($path, $mode = null)
  {
    if ($mode) {
      return chmod($path, $mode);
    }

    return substr(sprintf('%o', fileperms($path)), -4);
  }
public static function chmod($path, $mode = null)
  {
    if ($mode) {
      return chmod($path, $mode);
    }

    return substr(sprintf('%o', fileperms($path)), -4);
  }
public static function chmod ( $ path , $ mode = null ) { if ( $ mode ) { return chmod ( $ path , $ mode ) ; } return substr ( sprintf ( '%o' , fileperms ( $ path ) ) , - 4 ) ; }
Get or set UNIX mode of a file or directory.

@param  string  $path
@param  int  $mode
@return mixed
Get or set UNIX mode of a file or directory .