コード例 #1
0
ファイル: Tinify.php プロジェクト: Cyken-Zeraux/tinify-php
function validate()
{
    try {
        Tinify::getClient()->request("post", "/shrink");
    } catch (ClientException $e) {
        return true;
    }
}
コード例 #2
0
ファイル: Source.php プロジェクト: maomaotp/up2S3
 public function result()
 {
     $response = Tinify::getClient()->request("get", $this->url, $this->commands);
     return new Result($response["headers"], $response["body"]);
 }
コード例 #3
0
function validate()
{
    try {
        Tinify::getClient()->request("post", "/shrink");
    } catch (AccountException $err) {
        if ($err->status == 429) {
            return true;
        }
        throw $err;
    } catch (ClientException $err) {
        return true;
    }
}