balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

extendify-sdk.php (1359B)


      1 <?php
      2 
      3 if (!defined('ABSPATH')) {
      4     exit;
      5 }
      6 
      7 if (!class_exists('ExtendifySdk')) :
      8 
      9     /**
     10      * The Extendify Sdk
     11      */
     12     // phpcs:ignore Squiz.Classes.ClassFileName.NoMatch,Squiz.Commenting.ClassComment.Missing,PEAR.Commenting.ClassComment.Missing
     13     final class ExtendifySdk
     14     {
     15 
     16         /**
     17          * Var to make sure we only load once
     18          *
     19          * @var boolean $loaded
     20          */
     21         public static $loaded = false;
     22 
     23         /**
     24          * Set up the SDK
     25          *
     26          * @return void
     27          */
     28         public function __invoke()
     29         {
     30             if (!apply_filters('extendifysdk_load_library', true)) {
     31                 return;
     32             }
     33 
     34             if (version_compare(PHP_VERSION, '5.6', '<') || version_compare($GLOBALS['wp_version'], '5.5', '<')) {
     35                 return;
     36             }
     37 
     38             if (!self::$loaded) {
     39                 self::$loaded = true;
     40                 require dirname(__FILE__) . '/bootstrap.php';
     41                 $app = new Extendify\ExtendifySdk\App();
     42                 if (!defined('EXTENDIFYSDK_BASE_URL')) {
     43                     define('EXTENDIFYSDK_BASE_URL', plugin_dir_url(__FILE__));
     44                 }
     45             }
     46         }
     47         // phpcs:ignore Squiz.Classes.ClassDeclaration.SpaceBeforeCloseBrace
     48     }
     49 
     50     $extendifySdk = new ExtendifySdk();
     51     $extendifySdk();
     52 endif;