diff --git a/.gitignore b/.gitignore index ed2bb698..a25d3fa1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +build/ vendor/ composer.phar diff --git a/.travis.yml b/.travis.yml index 1247feb9..1ffe0f79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,7 @@ env: - WP_VERSION=3.9.8 WP_MULTISITE=0 - WP_VERSION=3.9.8 WP_MULTISITE=1 -install: - - composer install +install: bin/build before_script: - bash bin/install-wp-tests.sh wordpress_test travis '' localhost $WP_VERSION diff --git a/bin/build b/bin/build index 6ea169ed..7daf8214 100755 --- a/bin/build +++ b/bin/build @@ -1,2 +1,6 @@ +#!/usr/bin/env bash + rm -rf vendor/ composer install + +vendor/scribu/scb-framework/bin/vendorize P2P diff --git a/composer.lock b/composer.lock index 585e5dd5..2a418498 100644 --- a/composer.lock +++ b/composer.lock @@ -187,12 +187,12 @@ "source": { "type": "git", "url": "https://github.com/scribu/wp-scb-framework.git", - "reference": "e766eda522230858d1c6a3928d3b12da643cb690" + "reference": "efa9b2c9c6bc2213115f2f7cd0d1405b3c8eafe7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scribu/wp-scb-framework/zipball/e766eda522230858d1c6a3928d3b12da643cb690", - "reference": "e766eda522230858d1c6a3928d3b12da643cb690", + "url": "https://api.github.com/repos/scribu/wp-scb-framework/zipball/efa9b2c9c6bc2213115f2f7cd0d1405b3c8eafe7", + "reference": "efa9b2c9c6bc2213115f2f7cd0d1405b3c8eafe7", "shasum": "" }, "type": "library", @@ -220,7 +220,7 @@ "keywords": [ "wordpress" ], - "time": "2015-05-11 17:14:48" + "time": "2015-10-25 19:55:25" } ], "packages-dev": [], diff --git a/posts-to-posts.php b/posts-to-posts.php index 1d00fde9..cd410f0d 100644 --- a/posts-to-posts.php +++ b/posts-to-posts.php @@ -32,9 +32,6 @@ function _p2p_load() { P2P_Shortcodes::init(); register_uninstall_hook( __FILE__, array( 'P2P_Storage', 'uninstall' ) ); - - if ( is_admin() ) - _p2p_load_admin(); } function _p2p_load_admin() { @@ -49,22 +46,19 @@ function _p2p_load_admin() { new P2P_Tools_Page; } -function _p2p_init() { - // Safe hook for calling p2p_register_connection_type() - do_action( 'p2p_init' ); +if ( is_dir( dirname( __FILE__ ) . '/vendor' ) ) { + require_once dirname( __FILE__ ) . '/vendor/autoload.php'; } -if ( is_dir( dirname( __FILE__ ) . '/vendor' ) ) { - // Not using vendor/autload.php because scb-framework/load.php has better compatibility +_p2p_load(); - if (!class_exists('Mustache_Autoloader')) { - require_once dirname( __FILE__ ) . '/vendor/mustache/mustache/src/Mustache/Autoloader.php'; - Mustache_Autoloader::register(); - } +if ( is_admin() ) + _p2p_load_admin(); - require_once dirname( __FILE__ ) . '/vendor/scribu/scb-framework/load.php'; +function _p2p_init() { + // Safe hook for calling p2p_register_connection_type() + do_action( 'p2p_init' ); } -scb_init( '_p2p_load' ); add_action( 'wp_loaded', '_p2p_init' );