PHP 8 compatibility fixes
This commit is contained in:
+35
-24
@@ -9,32 +9,43 @@ Author URI: http://www.hawkix.net
|
||||
License: GPLv2 or newer.
|
||||
*/
|
||||
|
||||
if( !defined('PG4WP_ROOT'))
|
||||
{
|
||||
// You can choose the driver to load here
|
||||
define('DB_DRIVER', 'pgsql'); // 'pgsql' or 'mysql' are supported for now
|
||||
// Ensure we only load this config once
|
||||
if(!defined('PG4WP_ROOT')) {
|
||||
|
||||
// Set this to 'true' and check that `pg4wp` is writable if you want debug logs to be written
|
||||
define( 'PG4WP_DEBUG', false);
|
||||
// If you just want to log queries that generate errors, leave PG4WP_DEBUG to "false"
|
||||
// and set this to true
|
||||
define( 'PG4WP_LOG_ERRORS', true);
|
||||
// You can choose the driver to load here
|
||||
if (!defined('DB_DRIVER')) {
|
||||
define('DB_DRIVER', pgsql);
|
||||
}
|
||||
|
||||
// If you want to allow insecure configuration (from the author point of view) to work with PG4WP,
|
||||
// change this to true
|
||||
define( 'PG4WP_INSECURE', false);
|
||||
// Set this to 'true' and check that `pg4wp` is writable if you want debug logs to be written
|
||||
if (!defined('PG4WP_DEBUG')) {
|
||||
define('PG4WP_DEBUG', false);
|
||||
}
|
||||
|
||||
// This defines the directory where PG4WP files are loaded from
|
||||
// 3 places checked : wp-content, wp-content/plugins and the base directory
|
||||
if( file_exists( ABSPATH.'/wp-content/pg4wp'))
|
||||
define( 'PG4WP_ROOT', ABSPATH.'/wp-content/pg4wp');
|
||||
else if( file_exists( ABSPATH.'/wp-content/plugins/pg4wp'))
|
||||
define( 'PG4WP_ROOT', ABSPATH.'/wp-content/plugins/pg4wp');
|
||||
else if( file_exists( ABSPATH.'/pg4wp'))
|
||||
define( 'PG4WP_ROOT', ABSPATH.'/pg4wp');
|
||||
else
|
||||
die('PG4WP file directory not found');
|
||||
if (!defined('PG4WP_LOG_ERRORS')) {
|
||||
// If you just want to log queries that generate errors, leave PG4WP_DEBUG to "false"
|
||||
// and set this to true
|
||||
define('PG4WP_LOG_ERRORS', true);
|
||||
}
|
||||
|
||||
// Here happens all the magic
|
||||
require_once( PG4WP_ROOT.'/core.php');
|
||||
if (!defined('PG4WP_INSECURE')) {
|
||||
// If you want to allow insecure configuration (from the author point of view) to work with PG4WP,
|
||||
// change this to true
|
||||
define('PG4WP_INSECURE', false);
|
||||
}
|
||||
|
||||
// This defines the directory where PG4WP files are loaded from
|
||||
// 3 places checked : wp-content, wp-content/plugins and the base directory
|
||||
if(file_exists(ABSPATH . '/wp-content/pg4wp')) {
|
||||
define('PG4WP_ROOT', ABSPATH . '/wp-content/pg4wp');
|
||||
} elseif(file_exists(ABSPATH . '/wp-content/plugins/pg4wp')) {
|
||||
define('PG4WP_ROOT', ABSPATH . '/wp-content/plugins/pg4wp');
|
||||
} elseif(file_exists(ABSPATH . '/pg4wp')) {
|
||||
define('PG4WP_ROOT', ABSPATH . '/pg4wp');
|
||||
} else {
|
||||
die('PG4WP file directory not found');
|
||||
}
|
||||
|
||||
// Here happens all the magic
|
||||
require_once(PG4WP_ROOT . '/core.php');
|
||||
} // Protection against multiple loading
|
||||
|
||||
Reference in New Issue
Block a user