Skip to content

Commit

Permalink
require autoloader only if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe Mazzapica committed Oct 28, 2013
1 parent 2a130da commit 16a011e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion EasyAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function easyajax( $scope = '', $where = '', $allowed = array() ) {
$action = ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ? 'admin_init' : 'wp_footer';
if ( did_action( $action ) ) return;
if ( ! defined( 'EASYAJAX_URL' ) ) define( 'EASYAJAX_URL', plugins_url( '/', __FILE__ ) );
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
if ( ! class_exists( '\EasyAjax\Front' ) )
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
$instance = new \EasyAjax\Front( new \EasyAjax\Proxy );
$instance->setup( $scope, $where, $allowed );
}
Expand Down

0 comments on commit 16a011e

Please sign in to comment.