boot(); } return self::$instance; } /** * Capability required to view logs. Single source of truth. * * @return string */ public static function capability() { $cap = apply_filters( 'evlfl_capability', 'manage_options' ); return ( is_string( $cap ) && '' !== $cap ) ? $cap : 'manage_options'; } /** * Boot services. * * @return void */ private function boot() { // Run migrations on upgrade (cheap autoloaded option compare). EVLFL_Database::maybe_upgrade(); $this->logger = new EVLFL_Logger(); $manager = new EVLFL_Event_Manager( new EVLFL_Event_Detector(), new EVLFL_Source_Detector(), new EVLFL_Event_Verifier(), $this->logger ); $this->learndash = new EVLFL_LearnDash( $manager ); $this->learndash->init(); $this->notifier = new EVLFL_Notifier( $this->logger ); $this->notifier->init(); $this->lifecycle = new EVLFL_Data_Lifecycle( $this->logger ); $this->lifecycle->init(); if ( is_admin() ) { require_once EVLFL_PLUGIN_DIR . 'includes/class-test-data.php'; require_once EVLFL_PLUGIN_DIR . 'admin/class-log-details.php'; require_once EVLFL_PLUGIN_DIR . 'admin/class-settings-page.php'; require_once EVLFL_PLUGIN_DIR . 'admin/class-admin.php'; $admin = new EVLFL_Admin( $this->logger, new EVLFL_Settings_Page( $this->notifier ) ); $admin->init(); } } }