Exemplo n.º 1
0
 public static function readPost($name, $default = null)
 {
     return Azukari::readRequest($name, $default, 'post');
 }
Exemplo n.º 2
0
        if ($r2 === false) {
            response('', -5, 'Failed to save file in [Step 2]');
        } else {
            response(Azukari::urlInStore($filename));
        }
    }
} elseif ($act == 'delete') {
    if (file_exists(Azukari::pathInStore($filename))) {
        $r = unlink(Azukari::pathInStore($filename));
        if ($r === false) {
            response('', -6, 'Failed to delete file.');
        } else {
            response('Deleted');
        }
    } else {
        response('', -7, 'Filename Not Existed');
    }
} elseif ($act == 'validate') {
    if (file_exists(Azukari::pathInStore($filename))) {
        response('Existed');
    } else {
        response('', -7, 'Filename Not Existed');
    }
}
////////
function response($object, $code = 0, $msg = '')
{
    $json = json_encode(array('code' => $code, 'object' => $object, 'msg' => $msg));
    echo $json;
    exit;
}