Skip to content

Commit

Permalink
putting back the 5.2 compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolsen committed Nov 29, 2012
1 parent 17152a2 commit ee616ac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions php/UAParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*
*/

// address 5.2 compatibility
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));

// address 5.1 compatibility
if (!function_exists('json_decode') || !function_exists('json_encode')) {
require_once(__DIR__."/lib/json/jsonwrapper.php");
Expand Down
8 changes: 8 additions & 0 deletions php/uaparser-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
*
*/

// address 5.2 compatibility
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));

// address 5.1 compatibility
if (!function_exists('json_decode') || !function_exists('json_encode')) {
require_once(__DIR__."/lib/json/jsonwrapper.php");
}

// include UAParser.php and make sure to turn off the CLI error
require __DIR__."/UAParser.php";

Expand Down
3 changes: 3 additions & 0 deletions php/uaparser-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

// address 5.2 compatibility
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));

// include UAParser.php and make sure to turn off the CLI error
require __DIR__."/UAParser.php";

Expand Down

0 comments on commit ee616ac

Please sign in to comment.