Skip to content

Commit

Permalink
return early if not on php 5.4 for braintree
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaijoldis authored Oct 25, 2017
1 parent ed3f050 commit 7e4b35f
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ public function __construct() {

public static function get_instance() {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPEC_Braintree_Helpers ) ) {
self::$instance = new WPEC_Braintree_Helpers;
if( version_compare( phpversion(), '5.4', '<' ) ) {
return;
} else {
self::$instance = new WPEC_Braintree_Helpers;

self::deactivate_plugins();
self::includes();
self::add_actions();
self::add_filters();
self::deactivate_plugins();
self::includes();
self::add_actions();
self::add_filters();
}
}
return self::$instance;
}
Expand All @@ -32,13 +36,7 @@ public static function deactivate_plugins() {
}

public static function includes() {

try {
require_once( WPSC_MERCHANT_V3_SDKS_PATH . '/pp-braintree/sdk/lib/Braintree.php' );
} catch (Braintree_Exception $e) {
return;
}

require_once( WPSC_MERCHANT_V3_SDKS_PATH . '/pp-braintree/sdk/lib/Braintree.php' );
}

public static function add_actions() {
Expand Down

0 comments on commit 7e4b35f

Please sign in to comment.