public function filePermission($path, $mode = self::CHMOD_775)
    {
        $results = array();
        $success = 0;
        if(file_exists($path)) {
            if(!is_writable($path))
                chmod($path, $mode);

            if(!is_readable($path))
                chmod($path, $mode);

            if(is_readable($path) && is_writable($path))
                $status = 1;
        }

        $results = array(
            'path' => $path,
            'mode' => $mode,
            'success' => $success
        );

        return Json::encode($results);
    }
public function filePermission($path, $mode = self::CHMOD_775)
    {
        $results = array();
        $success = 0;
        if(file_exists($path)) {
            if(!is_writable($path))
                chmod($path, $mode);

            if(!is_readable($path))
                chmod($path, $mode);

            if(is_readable($path) && is_writable($path))
                $status = 1;
        }

        $results = array(
            'path' => $path,
            'mode' => $mode,
            'success' => $success
        );

        return Json::encode($results);
    }
public function filePermission ( $ path , $ mode = self :: CHMOD_775 ) { $ results = array ( ) ; $ success = 0 ; if ( file_exists ( $ path ) ) { if ( ! is_writable ( $ path ) ) chmod ( $ path , $ mode ) ; if ( ! is_readable ( $ path ) ) chmod ( $ path , $ mode ) ; if ( is_readable ( $ path ) && is_writable ( $ path ) ) $ status = 1 ; } $ results = array ( 'path' => $ path , 'mode' => $ mode , 'success' => $ success ) ; return Json :: encode ( $ results ) ; }
Changes the file permission
@param String $path
@param int $mode
@return Json
Changes the file permission