示例#1
0
 public function setUp()
 {
     $_SERVER['SERVER_NAME'] = 'flourishlib.com';
     if (defined('EMAIL_DEBUG')) {
         fCore::enableDebugging(TRUE);
     }
 }
 public function setUp()
 {
     if (defined('SKIPPING') || !defined('EMAIL_PASSWORD')) {
         $this->markTestSkipped();
     }
     if (defined('EMAIL_DEBUG')) {
         fCore::enableDebugging(TRUE);
     }
 }
示例#3
0
 /**
  * @dataProvider debugProvider
  */
 public function testDebug($value, $force, $global, $expected_output)
 {
     ob_start();
     if ($global) {
         fCore::enableDebugging(TRUE);
     }
     fCore::debug($value, $force);
     $output = ob_get_clean();
     $this->assertEquals($expected_output, rtrim($output, "\n"));
 }
示例#4
0
 public function setUp()
 {
     if (defined('SKIPPING') || !defined('EMAIL_PASSWORD')) {
         $this->markTestSkipped();
     }
     $_SERVER['SERVER_NAME'] = 'flourishlib.com';
     if (defined('EMAIL_DEBUG')) {
         fCore::enableDebugging(TRUE);
     }
 }
示例#5
0
include_once 'inc/init.php';
$debug = false;
if (isset($_SERVER['argc'])) {
    $args = getopt('d::h::', array('debug', 'help'));
    if (isset($args['debug']) || isset($args['d'])) {
        $debug = true;
    } elseif (isset($args['help']) || isset($args['h'])) {
        print "Tattle Check Processor: \n" . "\n" . "--help, -h : Displays this help \n" . "\n" . "--debug, -d : Enables debuging (?debug=true can be used via a web request) \n";
    }
} elseif ($debug = fRequest::get('debug', 'boolean')) {
    $debug = true;
}
if ($debug) {
    print "debug enabled";
    fCore::enableDebugging(TRUE);
}
$checks = Check::findActive();
foreach ($checks as $check) {
    $data = Check::getData($check);
    if (count($data) > 0) {
        $title = $check->prepareName();
        fCore::debug('Processing :' . $title . ":\n", FALSE);
        $check_value = Check::getResultValue($data, $check);
        fCore::debug("Result :" . $check_value . ":\n", FALSE);
        $result = Check::setResultsLevel($check_value, $check);
        fCore::debug("Check Value:" . $result . ":\n", FALSE);
        if (is_null($check->getLastCheckTime())) {
            $next_check = new fTimestamp();
            fCore::debug("is null?\n", FALSE);
        } else {
示例#6
0
 // New method (1.4.0+)
 // Paths and URLs
 define('DOC_ROOT', realpath(dirname(__FILE__) . '/../'));
 define('URL_ROOT', str_replace('\\', '/', substr(DOC_ROOT, strlen(realpath($_SERVER['DOCUMENT_ROOT']))) . '/'));
 spl_autoload_register('printmaster_autoload');
 // Initialise configuration
 $config = new Config();
 $config->features = new Config();
 // Include base config file
 require_once dirname(__FILE__) . '/config/config.default.php';
 // Include custom config file
 if (file_exists(DOC_ROOT . '/inc/config/config.php')) {
     require_once dirname(__FILE__) . '/config/config.php';
 }
 // Debugging assistance
 fCore::enableDebugging(config_item('debug', FALSE));
 //fCore::enableErrorHandling(DOC_ROOT . '/error.log');
 //fCore::enableExceptionHandling(DOC_ROOT . '/exceptions.log');
 fCore::enableErrorHandling('html');
 fCore::enableExceptionHandling('html');
 // Set page template
 $tpl = new fTemplating(DOC_ROOT . '/views/template');
 $tpl->set('header', 'header.php');
 $tpl->set('footer', 'footer.php');
 $tpl->set('menu', 'menu.php');
 // @TODO remove these when the thresholds become configurable.
 global $status;
 $status[3] = array('OK', '73D216');
 // 3+ OK
 $status[2] = array('Low', 'EDD400');
 // 2+ Warning
示例#7
0
<?php

// Consumable status
global $status;
$status[3] = array('OK', '73D216');
// 3+ OK
$status[2] = array('Low', 'EDD400');
// 2+ Warning
$status[0] = array('Critical', 'CC0000');
// 0: Empty - bad.
// Paths and URLs
define('DOC_ROOT', realpath(dirname(__FILE__) . '/../'));
define('URL_ROOT', str_replace('\\', '/', substr(DOC_ROOT, strlen(realpath($_SERVER['DOCUMENT_ROOT']))) . '/'));
// Error reporting
#error_reporting(E_ALL);
fCore::enableDebugging(FALSE);
#fCore::enableErrorHandling(DOC_ROOT . '/error.log');
#fCore::enableExceptionHandling(DOC_ROOT . '/exceptions.log');
fCore::enableErrorHandling('html');
fCore::enableExceptionHandling('html');
/**
 * Automatically includes classes
 * 
 * @throws Exception
 * 
 * @param  string $class_name  Name of the class to load
 * @return void
 */
function __autoload($class)
{
    $flourish_file = DOC_ROOT . '/inc/flourish/' . $class . '.php';
示例#8
0
 public function setUp()
 {
     if (defined('EMAIL_DEBUG')) {
         fCore::enableDebugging(TRUE);
     }
 }