File tree Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 22All notable changes to this project will be documented in this file.
33This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
44
5+ ## 0.8.2 / 2017-01-10
6+
7+ ### Fixed:
8+ - Added missing polyfill for "json_last_error_msg".
9+
510## 0.8.1 / 2016-05-08
611
712### Fixed:
Original file line number Diff line number Diff line change 2828 "ext-curl" : " *"
2929 },
3030 "autoload" : {
31- "psr-0" : { "Bitbucket\\ " : " lib/" }
31+ "psr-0" : { "Bitbucket\\ " : " lib/" },
32+ "files" : [" polyfill-55.php" ]
3233 },
3334 "scripts" : {
3435 "test" : " vendor/bin/phpunit"
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class Client extends ClientListener implements ClientInterface
3333 'api_versions ' => array ('1.0 ' , '2.0 ' ), // supported versions
3434 'format ' => 'json ' ,
3535 'formats ' => array ('json ' , 'xml ' ), // supported response formats
36- 'user_agent ' => 'bitbucket-api-php/0.8.1 (https://bitbucket.org/gentlero/bitbucket-api) ' ,
36+ 'user_agent ' => 'bitbucket-api-php/0.8.2 (https://bitbucket.org/gentlero/bitbucket-api) ' ,
3737 'timeout ' => 10 ,
3838 'verify_peer ' => false
3939 );
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright 2015 - 2016 Alexandru Guzinschi <alex@gentle.ro>
4+ *
5+ * This software may be modified and distributed under the terms
6+ * of the MIT license. See the LICENSE file for details.
7+ */
8+
9+ /**
10+ * Provides functions unavailable in PHP releases prior to v5.5
11+ */
12+ if (PHP_VERSION_ID < 50500 ) {
13+ if (!function_exists ('json_last_error_msg ' )) {
14+ function json_last_error_msg ()
15+ {
16+ switch (json_last_error ()) {
17+ case JSON_ERROR_NONE :
18+ return 'No error ' ;
19+ case JSON_ERROR_DEPTH :
20+ return 'Maximum stack depth exceeded ' ;
21+ case JSON_ERROR_STATE_MISMATCH :
22+ return 'State mismatch (invalid or malformed JSON) ' ;
23+ case JSON_ERROR_CTRL_CHAR :
24+ return 'Control character error, possibly incorrectly encoded ' ;
25+ case JSON_ERROR_SYNTAX :
26+ return 'Syntax error ' ;
27+ case JSON_ERROR_UTF8 :
28+ return 'Malformed UTF-8 characters, possibly incorrectly encoded ' ;
29+ default :
30+ return 'Unknown error ' ;
31+ }
32+ }
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments