| 1 |
<?php |
| 2 |
/** |
| 3 |
* Core class |
| 4 |
* |
| 5 |
* @since 1.0 |
| 6 |
*/ |
| 7 |
namespace dologin; |
| 8 |
|
| 9 |
defined( 'WPINC' ) || exit; |
| 10 |
|
| 11 |
class Core extends Instance { |
| 12 |
const VER = DOLOGIN_V; |
| 13 |
|
| 14 |
/** |
| 15 |
* Init |
| 16 |
* |
| 17 |
* @since 1.0 |
| 18 |
* @access protected |
| 19 |
*/ |
| 20 |
protected function __construct() { |
| 21 |
defined( 'debug' ) && debug2( 'init' ); |
| 22 |
|
| 23 |
$this->cls( 'Conf' )->init(); |
| 24 |
|
| 25 |
if ( is_admin() ) { |
| 26 |
$this->cls( 'Admin' )->init(); |
| 27 |
} |
| 28 |
|
| 29 |
$this->cls( 'Auth' )->init(); |
| 30 |
|
| 31 |
$this->cls( 'TwoFA' )->init(); |
| 32 |
|
| 33 |
$this->cls( 'GUI' )->init(); |
| 34 |
|
| 35 |
$this->cls( 'REST' )->init(); |
| 36 |
|
| 37 |
$this->cls( 'Util' )->init(); |
| 38 |
|
| 39 |
$this->cls( 'Router' )->init(); |
| 40 |
|
| 41 |
$this->cls( 'Pswdless' )->init(); |
| 42 |
|
| 43 |
$this->cls( 'Site' )->init(); |
| 44 |
|
| 45 |
$this->cls( 'KLSso' )->init(); |
| 46 |
|
| 47 |
register_activation_hook( DOLOGIN_DIR . 'dologin.php', __NAMESPACE__ . '\Util::activate' ); |
| 48 |
register_deactivation_hook( DOLOGIN_DIR . 'dologin.php', __NAMESPACE__ . '\Util::deactivate' ); |
| 49 |
register_uninstall_hook( DOLOGIN_DIR . 'dologin.php', __NAMESPACE__ . '\Util::uninstall' ); |
| 50 |
|
| 51 |
add_action( 'wp_initialize_site', __NAMESPACE__ . '\Util::new_site', 10, 1 ); |
| 52 |
add_action( 'wpmu_new_blog', __NAMESPACE__ . '\Util::new_site', 10, 1 ); |
| 53 |
|
| 54 |
$this->cls( 'Lang' )->init(); |
| 55 |
} |
| 56 |
} |
| 57 |
|