Пример #1
0
function main()
{
    // Define and get a list of all our test functions
    $fnsAll = get_defined_functions();
    tests();
    $fnsTest = get_defined_functions();
    $fnsTest = array_diff($fnsTest['user'], $fnsAll['user']);
    // Dump
    var_dump(array_combine($fnsTest, array_map(array('DocBlock', 'ofFunction'), $fnsTest)));
}
Пример #2
0
<?php

include_once dirname(__FILE__) . "/__settings__.php";
application_settings(__FILE__, null, dirname(dirname(__FILE__)));
import("core.Log");
import("core.Flow");
import("core.File");
import("ext.Test");
import("ext.Setup");
header_output_text();
$flow = new Flow();
if ($flow->isVars("class")) {
    test($flow->inVars("class"), $flow->inVars("method"), $flow->inVars("block"));
} else {
    if (!$flow->isVars("full")) {
        Test::exec_type(Test::FAIL);
    }
    tests(root_path());
}
}
if (preg_match("#--reconfigure#", implode(" ", $argv), $re)) {
    $GLOBALS["RECONFIGURE"] = true;
}
$GLOBALS["AS_ROOT"] = true;
include_once dirname(__FILE__) . '/ressources/class.ldap.inc';
include_once dirname(__FILE__) . '/ressources/class.squid.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/framework/frame.class.inc';
include_once dirname(__FILE__) . '/framework/class.settings.inc';
include_once dirname(__FILE__) . '/ressources/class.os.system.inc';
include_once dirname(__FILE__) . '/ressources/class.system.nics.inc';
include_once dirname(__FILE__) . "/ressources/class.influx.inc";
if ($argv[1] == "--tests") {
    tests();
    exit;
}
$GLOBALS["zMD5"] = $argv[1];
BUILD_REPORT($argv[1]);
function build_progress($text, $pourc)
{
    $GLOBALS["PROGRESS_FILE"] = "/usr/share/artica-postfix/ressources/logs/web/squid.statistics-{$GLOBALS["zMD5"]}.progress";
    $array["POURC"] = $pourc;
    $array["TEXT"] = $text;
    echo "[{$pourc}]: {$text}\n";
    @file_put_contents($GLOBALS["PROGRESS_FILE"], serialize($array));
    @chmod($GLOBALS["PROGRESS_FILE"], 0755);
}
function tests()
{
Пример #4
0
<?php

require dirname(dirname(__FILE__)) . "/rhaco2";
header_output_text();
def("core.Log@disp", "debug");
def("db.Db@test_1", "type=mysql,dbname=rhacotest1,user=root,password=root,");
def("db.Db@test_2", "type=mysql,dbname=rhacotest2,user=root,password=root,");
import("core.Flow");
import("ext.Test");
$flow = new Flow();
if ($flow->isVars("class")) {
    test($flow->inVars("class"), $flow->inVars("method"), $flow->inVars("block"));
} else {
    if (!$flow->isVars("full")) {
        Test::exec_type(Test::FAIL);
    }
    tests(dirname(dirname(__FILE__)));
}
if ($GLOBALS["VERBOSE"]) {
    "echo Loading...\n";
}
include_once dirname(__FILE__) . '/ressources/class.templates.inc';
include_once dirname(__FILE__) . '/ressources/class.ini.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/ressources/class.squid.inc';
include_once dirname(__FILE__) . '/ressources/class.os.system.inc';
include_once dirname(__FILE__) . "/framework/frame.class.inc";
include_once dirname(__FILE__) . '/ressources/class.artica-meta.inc';
include_once dirname(__FILE__) . '/ressources/class.computers.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.stats-appliance.inc';
include_once dirname(__FILE__) . '/ressources/class.parse.berekley.inc';
if ($argv[1] == "--tests") {
    tests($argv[2]);
    die;
}
parse();
function tests($filepath)
{
    $berekley = new parse_berekley_dbs();
    $array = $berekley->PROTO_PARSE_DB($filepath, $xdate);
    print_r($array);
}
function parse()
{
    $TimeFile = "/etc/artica-postfix/pids/exec.squid.stats.mime.proto.php.time";
    $pidfile = "/etc/artica-postfix/pids/exec.squid.stats.mime.proto.php.pid";
    $GLOBALS["LogFileDeamonLogDir"] = @file_get_contents("/etc/artica-postfix/settings/Daemons/LogFileDeamonLogDir");
    if ($GLOBALS["LogFileDeamonLogDir"] == null) {