Skip to content

Commit

Permalink
use vendorized version of scbFramework
Browse files Browse the repository at this point in the history
  • Loading branch information
scribu committed Oct 25, 2015
1 parent 671029f commit 90d9882
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build/
vendor/
composer.phar
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions bin/build
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#!/usr/bin/env bash

rm -rf vendor/
composer install

vendor/scribu/scb-framework/bin/vendorize P2P
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 8 additions & 14 deletions posts-to-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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' );

0 comments on commit 90d9882

Please sign in to comment.