Skip to content

Commit

Permalink
fix this broken shit mess
Browse files Browse the repository at this point in the history
  • Loading branch information
Ne00n committed Jul 21, 2020
1 parent 3e26057 commit c493258
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,7 @@ before_script:
- mysql -u root -e "CREATE DATABASE night;"
- mysql -u root -e "CREATE USER 'night'@'localhost' IDENTIFIED BY 'night';"
- mysql -u root -e "GRANT ALL ON night.* TO 'night'@'localhost';"
- mysql -u root night < content/sql/travis.sql
- mysql -u root night < content/sql/night-sky.sql
- php -v
- phpunit --version

Expand Down
2 changes: 1 addition & 1 deletion class/CronjobServ/ThreadLock.php
Expand Up @@ -47,7 +47,7 @@ public function setLock() {

$time = time();
$stmt = $this->DB->GetConnection()->prepare("UPDATE threads SET THREAD_LOCK = ?, THREAD_LOCK_TIME = ? WHERE THREAD_ID = ?");
$stmt->bind_param('is', $THREAD_LOCK,$time,$this->THREAD_ID);
$stmt->bind_param('iis', $THREAD_LOCK,$time,$this->THREAD_ID);
$rc = $stmt->execute();
if ( false===$rc ) { $this->error = "MySQL Error"; }
$stmt->close();
Expand Down
2 changes: 1 addition & 1 deletion class/Night.php
Expand Up @@ -7,10 +7,10 @@ class Night {
private $test = false;

public function __construct($test = false) {
$this->test = $test;
if ($test == false) {
include '../content/configs/config.php';
include '../content/configs/regex.php';
$this->test = $test;
}

$this->DB = new Database;
Expand Down
17 changes: 16 additions & 1 deletion content/sql/night-sky.sql
@@ -1,4 +1,6 @@
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";

CREATE TABLE `checks` (
Expand Down Expand Up @@ -81,7 +83,8 @@ CREATE TABLE `status_pages` (

CREATE TABLE `threads` (
`THREAD_ID` varchar(11) NOT NULL,
`THREAD_LOCK` int(1) NOT NULL DEFAULT 0
`THREAD_LOCK` int(1) NOT NULL DEFAULT 0,
`THREAD_LOCK_TIME` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `users` (
Expand Down Expand Up @@ -161,25 +164,37 @@ ALTER TABLE `webhooks`

ALTER TABLE `checks`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `emails`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `groups`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `groups_checks`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `groups_emails`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `history`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `login_blacklist`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `register_blacklist`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `remote`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `status_pages`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `users`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `webhooks`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
189 changes: 0 additions & 189 deletions content/sql/travis.sql

This file was deleted.

4 changes: 4 additions & 0 deletions content/tests/TestsMain.php
Expand Up @@ -23,7 +23,11 @@ function dat_loader($class) {
//Init DB
$this->DB = new Database;
$this->DB->InitDB();
$this->Lake = new Lake(_db_host,_db_user,_db_password,_db_database);
$this->CleanUP();
//Insert Remotes
$this->Lake->INSERT('remote')->INTO(array('Location' => 'Travis01','IP' => 'travis.x8e.net','Port' => '443','Online' => 1))->VAR('ssii')->DONE();
$this->Lake->INSERT('remote')->INTO(array('Location' => 'Travis02','IP' => 'travis.x8e.net','Port' => '443','Online' => 1))->VAR('ssii')->DONE();
}

public function testComponents() {
Expand Down
4 changes: 2 additions & 2 deletions cron/Runner.php
Expand Up @@ -10,8 +10,8 @@ function dat_loader($class) {

spl_autoload_register('dat_loader');

$Runner = new Runner($options);
$Runner->run();
$Runner = new Runner();
$Runner->run($options);

}

Expand Down

0 comments on commit c493258

Please sign in to comment.