static function has_properly_run() { if (\BE_MCH_TPNF_VARS::$emergency === BE_MCH_TPNF_EMERGENCY_KO) { // Potent fatal error \BE_MCH_TPNF_VARS::$working = BE_MCH_TPNF_WORKING_FATAL; } }
function tpnf_uninstall() { BE_MCH_TPNF_VARS::$msg = BE_MCH_TPNF_MSG_UNDEFINED; BE_MCH_TPNF_VARS::$working = BE_MCH_TPNF_WORKING_UNDEFINED; BE_MCH_TPNF_VARS::$emergency = BE_MCH_TPNF_EMERGENCY_UNDEFINED; BE_MCH_TPNF_VARS::$activation = BE_MCH_TPNF_ACTIVATION_UNDEFINED; BE_MCH_TPNF_VARS::store(); }
public static function load() { self::$errors = array(); self::$working = self::$exWorking = get_option(BE_MCH_TPNF_WORKING, BE_MCH_TPNF_WORKING_UNDEFINED); self::$emergency = self::$exEmergency = get_option(BE_MCH_TPNF_EMERGENCY, BE_MCH_TPNF_EMERGENCY_UNDEFINED); self::$msg = self::$exMsg = get_option(BE_MCH_TPNF_MSG, BE_MCH_TPNF_MSG_UNDEFINED); $activation = get_option(BE_MCH_TPNF_ACTIVATION, BE_MCH_TPNF_ACTIVATION_UNDEFINED); if ($activation !== BE_MCH_TPNF_ACTIVATION_UNDEFINED) { $activation = DateTime::createFromFormat(DateTime::W3C, $activation); } self::$activation = self::$exActivation = $activation; }
function tpnf_check_requirements() { static $alreadyChecked = false; if ($alreadyChecked) { return; } $alreadyChecked = true; // Fatal error until proven otherwise BE_MCH_TPNF_VARS::$working = BE_MCH_TPNF_WORKING_FATAL; try { // Expected behaviour: requirement met or not BE_MCH_TPNF_VARS::$working = tpnf_check_requirements_work() ? BE_MCH_TPNF_WORKING_OK : BE_MCH_TPNF_WORKING_KO; } catch (Exception $e) { // Unexpected error BE_MCH_TPNF_VARS::$working = BE_MCH_TPNF_WORKING_ERROR; } }