Skip to content

Commit

Permalink
version 5.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel committed Feb 15, 2023
1 parent 00714fb commit c85354a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Change Log
==========

5.12.1
------

- FIX: replace deprecated string interpolation

5.12.1
------

- FIX: retry conversion on error 503

5.12.0
------

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pdfcrowd/pdfcrowd",
"type": "library",
"version": "5.12.0",
"version": "5.12.1",
"description": "A client library for the Pdfcrowd API. It lets you convert between HTML, PDF and various image formats",
"keywords": ["html", "pdf", "web service", "api", "client", "convert", "web page"],
"homepage": "https://pdfcrowd.com/api/",
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 5.12.0
VERSION = 5.12.1
PHP ?= php
DIR_NAME := pdfcrowd-5.12.0
DIR_NAME := pdfcrowd-5.12.1

dist: dist/pdfcrowd-$(VERSION)-php.zip

Expand Down
25 changes: 12 additions & 13 deletions pdfcrowd.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function convertFile($src, $outstream=null) {
1. The file is missing.
2. You misspelled the file name.
3. You use a relative file path (e.g. 'index.html') but the current working
directory is somewhere else than you expect: '${cwd}'
directory is somewhere else than you expect: '{$cwd}'
Generally, it is safer to use an absolute file path instead of a relative one.
");
}
Expand Down Expand Up @@ -387,7 +387,7 @@ function setTimeout($timeout) {

private $fields, $scheme, $port, $api_prefix, $curlopt_timeout;

public static $client_version = "5.12.0";
public static $client_version = "5.12.1";
public static $http_port = 80;
public static $https_port = 443;
public static $api_host = 'pdfcrowd.com';
Expand Down Expand Up @@ -547,7 +547,7 @@ function __construct($user_name, $api_key){
$this->reset_response_data();
$this->setProxy(null, null, null, null);
$this->setUseHttp(false);
$this->setUserAgent('pdfcrowd_php_client/5.12.0 (https://pdfcrowd.com)');
$this->setUserAgent('pdfcrowd_php_client/5.12.1 (https://pdfcrowd.com)');

$this->retry_count = 1;
$this->converter_version = '20.10';
Expand Down Expand Up @@ -593,7 +593,7 @@ function __construct($user_name, $api_key){

private static $SSL_ERRORS = array(35, 51, 53, 54, 58, 59, 60, 64, 66, 77, 80, 82, 83, 90, 91);

const CLIENT_VERSION = '5.12.0';
const CLIENT_VERSION = '5.12.1';
public static $MULTIPART_BOUNDARY = '----------ThIs_Is_tHe_bOUnDary_$';

private function add_file_field($name, $file_name, $data, &$body) {
Expand Down Expand Up @@ -652,8 +652,7 @@ private function output_body($http_code, $body, $out_stream) {
}

private function should_retry($code) {
if (($code == 502 || getenv('PDFCROWD_UNIT_TEST_MODE'))
&& $this->retry_count > $this->retry) {
if (($code == 502 || $code == 503) && $this->retry_count > $this->retry) {
// http error 502 occures sometimes due to network problems
// so retry request
$this->retry++;
Expand Down Expand Up @@ -2850,7 +2849,7 @@ function setUseCurl($value) {
}

/**
* Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
* Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
*
* @param count Number of retries.
* @return The converter object.
Expand Down Expand Up @@ -3780,7 +3779,7 @@ function setUseCurl($value) {
}

/**
* Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
* Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
*
* @param count Number of retries.
* @return The converter object.
Expand Down Expand Up @@ -4496,7 +4495,7 @@ function setUseCurl($value) {
}

/**
* Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
* Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
*
* @param count Number of retries.
* @return The converter object.
Expand Down Expand Up @@ -5167,7 +5166,7 @@ function setUseCurl($value) {
}

/**
* Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
* Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
*
* @param count Number of retries.
* @return The converter object.
Expand Down Expand Up @@ -6238,7 +6237,7 @@ function setUseCurl($value) {
}

/**
* Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
* Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
*
* @param count Number of retries.
* @return The converter object.
Expand Down Expand Up @@ -6789,7 +6788,7 @@ function setUseCurl($value) {
}

/**
* Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
* Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
*
* @param count Number of retries.
* @return The converter object.
Expand Down Expand Up @@ -7386,7 +7385,7 @@ function setUseCurl($value) {
}

/**
* Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
* Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
*
* @param count Number of retries.
* @return The converter object.
Expand Down

0 comments on commit c85354a

Please sign in to comment.