Skip to content

Commit ca38776

Browse files
committed
extension_loaded for dependencies
1 parent fdd1e99 commit ca38776

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/woocommerce-api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
$dir = dirname( __FILE__ ) . '/woocommerce-api/';
1010

1111
// required functions
12-
if ( ! function_exists( 'curl_init' ) ) {
12+
if ( ! extension_loaded( 'curl' ) ) {
1313
throw new Exception( 'WooCommerce REST API client requires the cURL PHP extension.' );
1414
}
1515

16-
if ( ! function_exists( 'json_decode' ) ) {
16+
if ( ! extension_loaded( 'json' ) ) {
1717
throw new Exception( 'WooCommerce REST API client needs the JSON extension.' );
1818
}
1919

0 commit comments

Comments
 (0)