public static function toPlain(Pulse $pulse) { static::contentType("text/plain"); $temp = ''; foreach ($pulse->getHealthchecks() as $healthcheck) { $temp .= $healthcheck->getDescription() . ' (' . $healthcheck->getType() . '): ' . self::statusToStr($healthcheck->getStatus()) . PHP_EOL; } $temp .= PHP_EOL . 'Healthcheck summary: ' . self::statusToStr($pulse->getStatus()) . PHP_EOL; static::responseIsPassing($pulse->getStatus()); return $temp; }
require COREPATH . 'Classes/Autoloader.php'; //Now let's define all the paths for the system. \Package\Core\Autoloader::add_classes(array('Package\\Core\\Pulse' => COREPATH . 'Classes/Pulse.php', 'Package\\Core\\Config' => COREPATH . 'Classes/Config.php', 'Package\\Core\\Driver' => COREPATH . 'Classes/Driver.php', 'Package\\Core\\Event' => COREPATH . 'Classes/Event.php', 'Package\\Core\\Database' => COREPATH . 'Classes/Database.php', 'Package\\Core\\Input' => COREPATH . 'Classes/Input.php', 'Package\\Core\\Package' => COREPATH . 'Classes/Package.php', 'Package\\Core\\Session' => COREPATH . 'Classes/Session.php', 'Package\\Core\\Error' => COREPATH . 'Classes/Error.php')); \Package\Core\Autoloader::register(); alias(array('Package\\Core\\Autoloader' => 'Autoloader', 'Package\\Core\\Pulse' => 'Pulse', 'Package\\Core\\Event' => 'Event', 'Package\\Core\\Config' => 'Config', 'Package\\Core\\Input' => 'Input', 'Package\\Core\\Error' => 'Error')); } } //Run the autoloader; run_autoloader(); //Set the error reporting; set_exception_handler(array('Error', 'handle')); throw new Exception('Undefined Index : 1'); ////////////////////////////////////// // Now let's load the pulse class // ////////////////////////////////////// \Pulse::init(); ///////////////////////////////////////////////////// // Let's shut the whole system down with an event; // ///////////////////////////////////////////////////// \Event::load('shutdown'); /***********************/ //////////////////////// // The base functions // //////////////////////// if (!function_exists('logger')) { function logger($level, $msg, $method = null) { if ($level > \Config::get('log_threshold')) { return false; } !class_exists('Fuel\\Core\\Log') and import('log');