コード例 #1
0
<?php

require_once $settings['functions'] . 'function.task.clean.php';
$result = task_clean($connection, $settings, $time);
////	WARNING
// This test doesn't clean up after itself
// as the only way to test it is to actually
// run a clean on the tracker.
if (!$result) {
    echo 'Error: Test for Function "task_clean" failed.' . PHP_EOL;
    $failure = true;
}
コード例 #2
0
ファイル: admin.php プロジェクト: dogsAreReallyCool/phoenix
    $result = mysqli_query($connection, 'CREATE TABLE IF NOT EXISTS `' . $settings['db_prefix'] . 'torrents` (' . '`name` varchar(255) NULL,' . '`info_hash` varchar(40) NOT NULL,' . '`downloads` int(10) unsigned NOT NULL DEFAULT \'0\',' . 'PRIMARY KEY (`info_hash`)' . ') ENGINE=MyISAM DEFAULT CHARSET=latin1;');
    if (!$result) {
        echo mysqli_error($connection);
        $success = false;
    }
    if ($success) {
        $Message = 'Your MySQL Tracker Database has been setup.';
        require_once $settings['functions'] . 'function.task.log.php';
        task($connection, $settings, 'install', $time);
    } else {
        $Message = 'Could not setup the MySQL Database.';
    }
} else {
    if ($Process == 'clean') {
        require_once $settings['functions'] . 'function.task.clean.php';
        if (task_clean($connection, $settings, $time)) {
            $Message = 'The peers list has been cleaned.';
        } else {
            $Message = 'Could not clean the peers list.';
        }
    } else {
        if ($Process == 'optimize') {
            require_once $settings['functions'] . 'function.task.optimize.php';
            if (task_optimize($connection, $settings, $time)) {
                $Message = 'Your MySQL Tracker Database has been optimized.';
            } else {
                $Message = 'Could not optimize the MySQL Database.';
            }
        }
    }
}