本文整理汇总了PHP中ITSEC_Modules::init_modules方法的典型用法代码示例。如果您正苦于以下问题:PHP ITSEC_Modules::init_modules方法的具体用法?PHP ITSEC_Modules::init_modules怎么用?PHP ITSEC_Modules::init_modules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITSEC_Modules
的用法示例。
在下文中一共展示了ITSEC_Modules::init_modules方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Loads core functionality across both admin and frontend.
*
* Creates all plugin globals, registers activation and related hooks,
* loads the text domain and loads all plugin modules
*
* @since 4.0
*
* @access private
*
* @param string $plugin_file The main plugin file
* @param string $plugin_name The plugin name
*
*/
public function init($plugin_file, $plugin_name)
{
global $itsec_globals, $itsec_logger, $itsec_lockout;
$this->plugin_build = 4044;
// used to trigger updates
$this->plugin_file = $plugin_file;
$this->plugin_dir = dirname($plugin_file) . '/';
$this->current_time = current_time('timestamp');
$this->current_time_gmt = current_time('timestamp', true);
$this->notices_loaded = false;
$this->doing_data_upgrade = false;
$this->interactive = false;
// Used to distinguish between a user modifying settings and the API modifying
// settings (such as from Sync requests).
$itsec_globals = array('plugin_name' => sanitize_text_field($plugin_name), 'plugin_dir' => $this->plugin_dir, 'current_time' => $this->current_time, 'current_time_gmt' => $this->current_time_gmt);
require $this->plugin_dir . 'core/class-itsec-modules.php';
add_action('itsec-register-modules', array($this, 'register_modules'));
ITSEC_Modules::init_modules();
require $this->plugin_dir . 'core/class-itsec-lib.php';
require $this->plugin_dir . 'core/class-itsec-logger.php';
require $this->plugin_dir . 'core/class-itsec-lockout.php';
require $this->plugin_dir . 'core/class-itsec-files.php';
require $this->plugin_dir . 'core/class-itsec-notify.php';
require $this->plugin_dir . 'core/class-itsec-response.php';
require $this->plugin_dir . 'core/lib/class-itsec-lib-user-activity.php';
$this->itsec_files = ITSEC_Files::get_instance();
$this->itsec_notify = new ITSEC_Notify();
$itsec_logger = new ITSEC_Logger();
$itsec_lockout = new ITSEC_Lockout($this);
//Determine if we need to run upgrade scripts
$plugin_data = get_site_option('itsec_data');
if (false === $plugin_data) {
$plugin_data = $this->save_plugin_data();
}
$itsec_globals['data'] = $plugin_data;
if (isset($plugin_data['build']) && $plugin_data['build'] !== $this->plugin_build) {
// We need to upgrade the data. Delay init of the rest of the plugin until the upgrade is complete.
$this->doing_data_upgrade = true;
// Run the actions early so that the rest of the code can still use the plugins_loaded hook.
add_action('plugins_loaded', array($this, 'execute_upgrade'), -100);
add_action('plugins_loaded', array($this, 'continue_init'), -90);
} else {
$this->continue_init();
}
}