Skip to content

Commit e3765d4

Browse files
committed
use vendorized version of scbFramework
1 parent 671029f commit e3765d4

File tree

6 files changed

+20
-22
lines changed

6 files changed

+20
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
build/
12
vendor/
23
composer.phar

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ env:
1010
- WP_VERSION=3.9.8 WP_MULTISITE=0
1111
- WP_VERSION=3.9.8 WP_MULTISITE=1
1212

13-
install:
14-
- composer install
13+
install: bin/build
1514

1615
before_script:
1716
- bash bin/install-wp-tests.sh wordpress_test travis '' localhost $WP_VERSION

bin/build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
#!/usr/bin/env bash
2+
13
rm -rf vendor/
24
composer install
5+
6+
vendor/scribu/scb-framework/bin/vendorize P2P

composer.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

posts-to-posts.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ function _p2p_load() {
3232
P2P_Shortcodes::init();
3333

3434
register_uninstall_hook( __FILE__, array( 'P2P_Storage', 'uninstall' ) );
35-
36-
if ( is_admin() )
37-
_p2p_load_admin();
3835
}
3936

4037
function _p2p_load_admin() {
@@ -49,22 +46,19 @@ function _p2p_load_admin() {
4946
new P2P_Tools_Page;
5047
}
5148

52-
function _p2p_init() {
53-
// Safe hook for calling p2p_register_connection_type()
54-
do_action( 'p2p_init' );
49+
if ( is_dir( dirname( __FILE__ ) . '/vendor' ) ) {
50+
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
5551
}
5652

57-
if ( is_dir( dirname( __FILE__ ) . '/vendor' ) ) {
58-
// Not using vendor/autload.php because scb-framework/load.php has better compatibility
53+
_p2p_load();
5954

60-
if (!class_exists('Mustache_Autoloader')) {
61-
require_once dirname( __FILE__ ) . '/vendor/mustache/mustache/src/Mustache/Autoloader.php';
62-
Mustache_Autoloader::register();
63-
}
55+
if ( is_admin() )
56+
_p2p_load_admin();
6457

65-
require_once dirname( __FILE__ ) . '/vendor/scribu/scb-framework/load.php';
58+
function _p2p_init() {
59+
// Safe hook for calling p2p_register_connection_type()
60+
do_action( 'p2p_init' );
6661
}
6762

68-
scb_init( '_p2p_load' );
6963
add_action( 'wp_loaded', '_p2p_init' );
7064

tests/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
require_once $_tests_dir . '/includes/functions.php';
77

88
function _manually_load_plugin() {
9-
require dirname( __FILE__ ) . '/../posts-to-posts.php';
10-
require dirname( __FILE__ ) . '/../debug-utils.php';
9+
require dirname( __FILE__ ) . '/../build/posts-to-posts.php';
10+
require dirname( __FILE__ ) . '/../build/debug-utils.php';
1111
}
1212
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
1313

0 commit comments

Comments
 (0)