refactor: upgrade to PHP 5.3

This commit is contained in:
Ben Goldsworthy 2021-05-02 19:47:58 +01:00
parent 2165b60929
commit a5dcebca44
9 changed files with 20 additions and 20 deletions

View file

@ -90,14 +90,14 @@ class Admin {
/**
* The class responsible for WYSIWYG editor integration.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wysiwyg.php';
require_once plugin_dir_path( __DIR__ ) . 'admin/class-wysiwyg.php';
$this->wysiwyg = new WYSIWYG( $this->plugin_name );
/**
* The class responsible for constructing the plugin dashboard page(s).
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/layout/class-init.php';
require_once plugin_dir_path( __DIR__ ) . 'admin/layout/class-init.php';
new layout\Init( $this->plugin_name );
}

View file

@ -19,7 +19,7 @@ namespace footnotes\admin\layout;
use footnotes\includes as Includes;
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-init.php';
require_once plugin_dir_path( __DIR__ ) . 'layout/class-init.php';
/**
* Class to be extended by page layout sub-classes.

View file

@ -125,7 +125,7 @@ class Init {
/**
* Represents the plugin settings dashboard page.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-settings.php';
require_once plugin_dir_path( __DIR__ ) . 'layout/class-settings.php';
}
/**

View file

@ -23,7 +23,7 @@ use footnotes\general as General;
/**
* Provides the abstract class to be extended for page layouts.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'layout/class-engine.php';
require_once plugin_dir_path( __DIR__ ) . 'layout/class-engine.php';
/**
* Class to initialise all defined page layouts.

View file

@ -124,32 +124,32 @@ class Core {
* The class responsible for orchestrating the actions and filters of the
* core plugin.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-loader.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-loader.php';
/**
* The class responsible for defining internationalization functionality
* of the plugin.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-i18n.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-i18n.php';
/**
* The various utility classes.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-config.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-convert.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-settings.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-template.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-config.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-convert.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-settings.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-template.php';
/**
* The class responsible for defining all actions that occur in the admin area.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php';
require_once plugin_dir_path( __DIR__ ) . 'admin/class-admin.php';
/**
* The class responsible for defining all actions that occur in the public-facing
* side of the site.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-general.php';
require_once plugin_dir_path( __DIR__ ) . 'public/class-general.php';
$this->loader = new Loader();

View file

@ -12,7 +12,7 @@ declare(strict_types=1);
namespace footnotes\includes;
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-config.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-config.php';
/**
* Class providing internationalization functionality.

View file

@ -17,7 +17,7 @@ namespace footnotes\includes;
*
* @todo Move to {@see Loader}.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-convert.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-convert.php';
/**
* Class defining configurable plugin settings.

View file

@ -91,7 +91,7 @@ class Template {
return;
}
$this->plugin_directory = plugin_dir_path( dirname( __FILE__ ) );
$this->plugin_directory = plugin_dir_path( __DIR__ );
$template = $this->get_template( $p_str_file_type, $p_str_file_name, $p_str_extension );
if ( $template ) {

View file

@ -268,10 +268,10 @@ class Parser {
*/
public function __construct() {
// TODO: Reorg dependencies.
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-config.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-convert.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-settings.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-template.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-config.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-convert.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-settings.php';
require_once plugin_dir_path( __DIR__ ) . 'includes/class-template.php';
// TODO: Move to `General`.
$this->register_hooks();