<?php

(PHP_SAPI !== "cli" || isset($_SERVER["HTTP_USER_AGENT"])) && die;
include "../api/include/Database.php";
$db = new Database();
$db->simpleQuery("TRUNCATE TABLE minions");
foreach (Config::$minions as $minion) {
    $db->simpleQuery("INSERT INTO minions (`minionRoot`,`load`) VALUES ('{$minion}',0)");
}
<?php

(PHP_SAPI !== "cli" || isset($_SERVER["HTTP_USER_AGENT"])) && die;
include "../api/include/Database.php";
$db = new Database();
// minion tables
$db->simpleQuery("CREATE TABLE `minions` (\n`minionId` int(11) unsigned NOT NULL AUTO_INCREMENT,\n`minionRoot` tinyblob NOT NULL,\n`load` int(11) NOT NULL,\nPRIMARY KEY (`minionId`)\n) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;");
// 8tracks tables
$db->simpleQuery("CREATE TABLE `8tracks_playlists` (\n`mixId` int(11) NOT NULL,\n`totalTracks` int(11) NOT NULL,\n`playToken` int(11) DEFAULT NULL,\n`lastUpdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n`minionId` int(11) DEFAULT NULL,\nPRIMARY KEY (`mixId`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
$db->simpleQuery("CREATE TABLE `8tracks_songs` (\n`songId` int(11) NOT NULL,\n`title` tinyblob NOT NULL,\n`artist` tinyblob,\n`album` tinyblob,\n`duration` int(11) NOT NULL,\n`songUrl` varchar(2083) NOT NULL DEFAULT '',\nPRIMARY KEY (`songId`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
$db->simpleQuery("CREATE TABLE `8tracks_playlists_songs` (\n`mixId` int(11) NOT NULL,\n`songId` int(11) NOT NULL,\n`trackNumber` int(11) NOT NULL,\nKEY `mixId` (`mixId`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
Example #3
0
<?php

(PHP_SAPI !== "cli" || isset($_SERVER["HTTP_USER_AGENT"])) && die;
include "../api/include/Database.php";
$db = new Database();
$db->simpleQuery("TRUNCATE TABLE slaves");
foreach (Config::$slaves as $slave) {
    $db->simpleQuery("INSERT INTO slaves (`slaveRoot`,`load`) VALUES ('{$slave}',0)");
}