Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/release/2.7' into f…
Browse files Browse the repository at this point in the history
…eature/#3967
  • Loading branch information
JoryHogeveen committed Mar 2, 2017
2 parents 67f415c + 33fb758 commit c27acef
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ matrix:
- php: 5.6
env: WP_VERSION=latest WP_MULTISITE=0
- php: 5.3
env: WP_VERSION=3.8 WP_MULTISITE=0
env: WP_VERSION=4.0 WP_MULTISITE=0
# MySQL 5.7
#- env: DB=mysql-5.7 WP_VERSION=latest WP_MULTISITE=0
# MySQL 8.0
Expand Down
143 changes: 72 additions & 71 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
GitHub Plugin URI: https://github.com/pods-framework/pods
GitHub Branch: 2.x
Copyright 2009-2015 Pods Foundation, Inc (email : contact@podsfoundation.org)
Copyright 2009-2017 Pods Foundation, Inc (email : contact@podsfoundation.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -33,96 +33,97 @@

// Prevent conflicts with Pods 1.x
if ( defined( 'PODS_VERSION' ) || defined( 'PODS_DIR' ) ) {
add_action( 'init', 'pods_deactivate_pods_1_x' );
add_action( 'init', 'pods_deactivate_pods_ui' );
}
else {
// Current version
define( 'PODS_VERSION', '2.7.0-a-2' );
add_action( 'init', 'pods_deactivate_pods_1_x' );
add_action( 'init', 'pods_deactivate_pods_ui' );
} else {
// Current version
define( 'PODS_VERSION', '2.7.0-a-2' );

// Version tracking between DB updates themselves
define( 'PODS_DB_VERSION', '2.3.5' );
// Version tracking between DB updates themselves
define( 'PODS_DB_VERSION', '2.3.5' );

if ( !defined( 'PODS_WP_VERSION_MINIMUM' ) ) {
define( 'PODS_WP_VERSION_MINIMUM', '3.8' );
if ( ! defined( 'PODS_WP_VERSION_MINIMUM' ) ) {
define( 'PODS_WP_VERSION_MINIMUM', '4.0' );
}

if ( !defined( 'PODS_PHP_VERSION_MINIMUM' ) ) {
define( 'PODS_PHP_VERSION_MINIMUM', '5.2.4' );
if ( ! defined( 'PODS_PHP_VERSION_MINIMUM' ) ) {
define( 'PODS_PHP_VERSION_MINIMUM', '5.3' );
}

if ( !defined( 'PODS_MYSQL_VERSION_MINIMUM' ) ) {
define( 'PODS_MYSQL_VERSION_MINIMUM', '5.0' );
if ( ! defined( 'PODS_MYSQL_VERSION_MINIMUM' ) ) {
define( 'PODS_MYSQL_VERSION_MINIMUM', '5.0' );
}

define( 'PODS_SLUG', plugin_basename( __FILE__ ) );
define( 'PODS_URL', plugin_dir_url( __FILE__ ) );
define( 'PODS_DIR', plugin_dir_path( __FILE__ ) );

// Prevent conflicts with old Pods UI plugin
if ( function_exists( 'pods_ui_manage' ) )
add_action( 'init', 'pods_deactivate_pods_ui' );
else {
global $pods, $pods_init, $pods_form;

require_once( PODS_DIR . 'includes/classes.php' );
require_once( PODS_DIR . 'includes/data.php' );
require_once( PODS_DIR . 'includes/general.php' );

if ( !defined( 'PODS_MEDIA' ) || PODS_MEDIA )
require_once( PODS_DIR . 'includes/media.php' );

if ( !defined( 'SHORTINIT' ) || !SHORTINIT ) {
if ( pods_allow_deprecated() ) {
require_once( PODS_DIR . 'deprecated/deprecated.php' );
}

if ( false !== pods_compatibility_check() ) {
$pods_form = pods_form();

if ( ! is_network_admin() ) {
$pods_init = pods_init();
}

}

}

}
define( 'PODS_SLUG', plugin_basename( __FILE__ ) );
define( 'PODS_URL', plugin_dir_url( __FILE__ ) );
define( 'PODS_DIR', plugin_dir_path( __FILE__ ) );

// Prevent conflicts with old Pods UI plugin
if ( function_exists( 'pods_ui_manage' ) ) {
add_action( 'init', 'pods_deactivate_pods_ui' );
} else {
global $pods, $pods_init, $pods_form;

require_once( PODS_DIR . 'includes/classes.php' );
require_once( PODS_DIR . 'includes/data.php' );
require_once( PODS_DIR . 'includes/general.php' );

if ( ! defined( 'PODS_MEDIA' ) || PODS_MEDIA ) {
require_once( PODS_DIR . 'includes/media.php' );
}

if ( ! defined( 'SHORTINIT' ) || ! SHORTINIT ) {
if ( pods_allow_deprecated() ) {
require_once( PODS_DIR . 'deprecated/deprecated.php' );
}

if ( false !== pods_compatibility_check() ) {
$pods_form = pods_form();

if ( ! is_network_admin() ) {
$pods_init = pods_init();
}
}
}
}
}

/**
* Deactivate Pods 1.x or other Pods plugins
*/
function pods_deactivate_pods_1_x () {
if ( defined( 'PODS_VERSION' ) && defined( 'PODS_DIR' ) && file_exists( untrailingslashit( PODS_DIR ) . '/init.php' ) ) {
if ( !function_exists( 'deactivate_plugins' ) )
include_once ABSPATH . 'wp-admin/includes/plugin.php';

deactivate_plugins( realpath( untrailingslashit( PODS_DIR ) . '/init.php' ) );

if ( !headers_sent() && ( !function_exists( 'pods_ui_manage' ) && !file_exists( WP_CONTENT_DIR . 'plugins/pods-ui/pods-ui.php' ) ) ) {
wp_redirect( $_SERVER[ 'REQUEST_URI' ] );
die();
}
}
function pods_deactivate_pods_1_x() {

if ( defined( 'PODS_VERSION' ) && defined( 'PODS_DIR' ) && file_exists( untrailingslashit( PODS_DIR ) . '/init.php' ) ) {
if ( ! function_exists( 'deactivate_plugins' ) ) {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
}

deactivate_plugins( realpath( untrailingslashit( PODS_DIR ) . '/init.php' ) );

if ( ! headers_sent() && ( ! function_exists( 'pods_ui_manage' ) && ! file_exists( WP_CONTENT_DIR . 'plugins/pods-ui/pods-ui.php' ) ) ) {
wp_redirect( $_SERVER['REQUEST_URI'] );
die();
}
}

}

/**
* Deactivate Pods UI plugin
*/
function pods_deactivate_pods_ui () {
if ( function_exists( 'pods_ui_manage' ) && file_exists( WP_CONTENT_DIR . 'plugins/pods-ui/pods-ui.php' ) ) {
if ( !function_exists( 'deactivate_plugins' ) )
include_once ABSPATH . 'wp-admin/includes/plugin.php';
function pods_deactivate_pods_ui() {

deactivate_plugins( realpath( WP_CONTENT_DIR . 'plugins/pods-ui/pods-ui.php' ) );
if ( function_exists( 'pods_ui_manage' ) && file_exists( WP_CONTENT_DIR . 'plugins/pods-ui/pods-ui.php' ) ) {
if ( ! function_exists( 'deactivate_plugins' ) ) {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
}

if ( !headers_sent() ) {
wp_redirect( $_SERVER[ 'REQUEST_URI' ] );
die();
}
deactivate_plugins( realpath( WP_CONTENT_DIR . 'plugins/pods-ui/pods-ui.php' ) );

}
if ( ! headers_sent() ) {
wp_redirect( $_SERVER['REQUEST_URI'] );
die();
}
}

}

0 comments on commit c27acef

Please sign in to comment.