mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-01 10:48:53 +00:00
Remove unused scripts from update folder.
This commit is contained in:
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
|
||||
|
||||
use newznab\Groups;
|
||||
|
||||
|
||||
$groups = new Groups;
|
||||
$groupList = $groups->getActive();
|
||||
unset($groups);
|
||||
|
||||
$ps = new PowerProcess;
|
||||
$ps->RegisterCallback('psUpdateComplete');
|
||||
$ps->maxThreads = 10;
|
||||
$ps->tickCount = 10000; // value in usecs. change this to 1000000 (one second) to reduce cpu use
|
||||
$ps->threadTimeLimit = 0; // Disable child timeout
|
||||
|
||||
echo "Starting threaded backfill process\n";
|
||||
|
||||
while ($ps->RunControlCode())
|
||||
{
|
||||
// Start the parent loop
|
||||
if (count($groupList))
|
||||
{
|
||||
// We still have groups to process
|
||||
if ($ps->SpawnReady())
|
||||
{
|
||||
// Spawn another thread
|
||||
$ps->threadData = array_pop($groupList);
|
||||
echo "[Thread-MASTER] Spawning new thread. Still have " . count($groupList) ." group(s) to update after this\n";
|
||||
$ps->spawnThread();
|
||||
}
|
||||
else
|
||||
{
|
||||
// There are no more slots available to run
|
||||
//$ps->tick();
|
||||
//echo ".\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No more groups to process
|
||||
echo "No more groups to process - Initiating shutdown\n";
|
||||
$ps->Shutdown();
|
||||
echo "Shutdown complete\n";
|
||||
}
|
||||
}
|
||||
|
||||
unset($groupList);
|
||||
|
||||
if ($ps->RunThreadCode())
|
||||
{
|
||||
$group = $ps->threadData;
|
||||
|
||||
$thread = sprintf("%05d",$ps->GetPID());
|
||||
|
||||
echo "[Thread-{$thread}] Begining backfill processing for group {$group['name']}\n";
|
||||
|
||||
$param = $group['name'];
|
||||
|
||||
$dir = dirname(__FILE__);
|
||||
$file = 'backfill.php';
|
||||
|
||||
$output = shell_exec("php {$dir}/{$file} {$param}");
|
||||
//$output = shell_exec("/usr/bin/php -c /etc/php5/cli/php.ini {$dir}/{$file} {$param}");
|
||||
|
||||
echo "[Thread-{$thread}] Completed update for group {$group['name']}\n";
|
||||
}
|
||||
|
||||
// Exit to call back to parent - Let know that child has completed
|
||||
exit(0);
|
||||
|
||||
// Create callback function
|
||||
function psUpdateComplete()
|
||||
{
|
||||
echo "[Thread-MASTER] Threaded backfill process complete\n";
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
|
||||
|
||||
$groups = new Groups;
|
||||
$groupList = $groups->getActive();
|
||||
unset($groups);
|
||||
|
||||
$ps = new PowerProcess;
|
||||
$ps->RegisterCallback('psUpdateComplete');
|
||||
$ps->maxThreads = 10;
|
||||
$ps->tickCount = 10000; // value in usecs. change this to 1000000 (one second) to reduce cpu use
|
||||
$ps->threadTimeLimit = 0; // Disable child timeout
|
||||
|
||||
echo "Starting threaded binary update process\n";
|
||||
|
||||
//while ($ps->runParentCode())
|
||||
while ($ps->RunControlCode())
|
||||
{
|
||||
// Start the parent loop
|
||||
if (count($groupList))
|
||||
{
|
||||
// We still have groups to process
|
||||
if ($ps->SpawnReady())
|
||||
{
|
||||
// Spawn another thread
|
||||
$ps->threadData = array_pop($groupList);
|
||||
echo "[Thread-MASTER] Spawning new thread. Still have " . count($groupList) ." group(s) to update after this\n";
|
||||
$ps->spawnThread();
|
||||
}
|
||||
else
|
||||
{
|
||||
// There are no more slots available to run
|
||||
//$ps->tick();
|
||||
//echo "- \n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No more groups to process
|
||||
echo "No more groups to process - Initiating shutdown\n";
|
||||
$ps->Shutdown();
|
||||
echo "Shutdown complete\n";
|
||||
}
|
||||
}
|
||||
|
||||
unset($groupList);
|
||||
|
||||
if ($ps->RunThreadCode())
|
||||
{
|
||||
$group = $ps->threadData;
|
||||
|
||||
$thread = sprintf("%05d",$ps->GetPID());
|
||||
|
||||
echo "[Thread-{$thread}] Begining processing for group {$group['name']}\n";
|
||||
|
||||
$param = $group['name'];
|
||||
|
||||
$dir = dirname(__FILE__);
|
||||
$file = 'update_binaries.php';
|
||||
|
||||
$output = shell_exec("php {$dir}/{$file} {$param}");
|
||||
//$output = shell_exec("/usr/bin/php -c /etc/php5/cli/php.ini {$dir}/{$file} {$param}");
|
||||
|
||||
echo "[Thread-{$thread}] Completed update for group {$group['name']}\n";
|
||||
}
|
||||
|
||||
// Exit to call back to parent - Let know that child has completed
|
||||
exit(0);
|
||||
|
||||
|
||||
|
||||
// Create callback function
|
||||
function psUpdateComplete()
|
||||
{
|
||||
echo "Threaded update process complete\n";
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
|
||||
|
||||
use newznab\db\Settings;
|
||||
|
||||
$s = new Sites();
|
||||
$site = $s->get();
|
||||
$patches = $s->getUnappliedPatches($site);
|
||||
|
||||
if (count($patches) == 0)
|
||||
echo "Patchn : No patches required applying. At version ".$site->dbversion."\n";
|
||||
else
|
||||
{
|
||||
echo "Patchn : Database at version ".$site->dbversion."\n";
|
||||
|
||||
foreach ($patches as $patch)
|
||||
{
|
||||
echo "Patchn : Executing patch ".basename($patch)."\n";
|
||||
|
||||
$db = new Settings();
|
||||
$rows = $db->query("select * from settings");
|
||||
|
||||
$dbData = file_get_contents($patch);
|
||||
//fix to remove BOM in UTF8 files
|
||||
$bom = pack("CCC", 0xef, 0xbb, 0xbf);
|
||||
if (0 == strncmp($dbData, $bom, 3)) {
|
||||
$dbData = substr($dbData, 3);
|
||||
}
|
||||
$queries = explode(";", $dbData);
|
||||
$queries = array_map("trim", $queries);
|
||||
foreach($queries as $q) {
|
||||
if (strlen($q) > 0)
|
||||
$db->exec($q);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Run this once per day.
|
||||
require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
|
||||
|
||||
use newznab\TvRage;
|
||||
|
||||
(new TvRage(['Echo' => true]))->updateSchedule();
|
||||
Reference in New Issue
Block a user