Skip to content

Commit a680db2

Browse files
authored
Merge pull request #795 from Codeinwp/fix-loading-sdk
fix: composer dependencies loaded after initialization
2 parents 2edfe5b + 5a2cb5d commit a680db2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

inc/main.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ public function __construct() {
8585
* @since 1.0.0
8686
*/
8787
public static function instance() {
88+
$vendor_file = OPTML_PATH . 'vendor/autoload.php';
89+
if ( is_readable( $vendor_file ) ) {
90+
include_once $vendor_file;
91+
}
92+
8893
if ( null === self::$_instance ) {
8994
add_filter( 'themeisle_sdk_products', [ __CLASS__, 'register_sdk' ] );
9095
add_filter( 'themeisle_sdk_ran_promos', '__return_true' );
@@ -103,10 +108,6 @@ public static function instance() {
103108
self::$_instance->cli = new Optml_Cli();
104109
}
105110
}
106-
$vendor_file = OPTML_PATH . 'vendor/autoload.php';
107-
if ( is_readable( $vendor_file ) ) {
108-
include_once $vendor_file;
109-
}
110111

111112
return self::$_instance;
112113
}

0 commit comments

Comments
 (0)