Renamed the codebase to RippingCluster

Since the new design is engine agnostic, removed HandBrake from the
class names.
This commit is contained in:
2010-08-25 21:46:50 +01:00
parent 8c5e8f82c1
commit 89ddcba363
46 changed files with 266 additions and 266 deletions

View File

@@ -1,6 +1,6 @@
<?php
$main = HandBrakeCluster_Main::instance();
$main = RippingCluster_Main::instance();
$req = $main->request();
$this->smarty->assign('requested_page', htmlspecialchars($req->request_string()));

View File

@@ -1,6 +1,6 @@
<?php
$main = HandBrakeCluster_Main::instance();
$main = RippingCluster_Main::instance();
$config = $main->config();
$this->smarty->assign('display_exceptions', $config->get('debug.display_exceptions'));

View File

@@ -1,8 +1,8 @@
<?php
$running_jobs = HandBrakeCluster_Job::allWithStatus(HandBrakeCluster_JobStatus::RUNNING, 5);
$completed_jobs = HandBrakeCluster_Job::allWithStatus(HandBrakeCluster_JobStatus::COMPLETE, 5);
$failed_jobs = HandBrakeCluster_Job::allWithStatus(HandBrakeCluster_JobStatus::FAILED, 5);
$running_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::RUNNING, 5);
$completed_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::COMPLETE, 5);
$failed_jobs = RippingCluster_Job::allWithStatus(RippingCluster_JobStatus::FAILED, 5);
$this->smarty->assign('running_jobs', $running_jobs);
$this->smarty->assign('completed_jobs', $completed_jobs);

View File

@@ -1,11 +1,11 @@
<?php
$job_id = $this->request->get('id');
$job = HandBrakeCluster_Job::fromId($job_id);
$job = RippingCluster_Job::fromId($job_id);
$this->smarty->assign('job', $job);
$client_log_entries = HandBrakeCluster_ClientLogEntry::recentForJob($job_id, 30);
$worker_log_entries = HandBrakeCluster_WorkerLogEntry::recentForJob($job_id, 30);
$client_log_entries = RippingCluster_ClientLogEntry::recentForJob($job_id, 30);
$worker_log_entries = RippingCluster_WorkerLogEntry::recentForJob($job_id, 30);
$this->smarty->assign('client_log_entries', $client_log_entries);
$this->smarty->assign('worker_log_entries', $worker_log_entries);

View File

@@ -1,11 +1,11 @@
<?php
$main = HandBrakeCluster_Main::instance();
$main = RippingCluster_Main::instance();
$req = $main->request();
$config = $main->config();
if ($req->get('submit')) {
$action = HandBrakeCluster_Main::issetelse($_POST['action'], HandBrakeCluster_Exception_InvalidParameters);
$action = RippingCluster_Main::issetelse($_POST['action'], RippingCluster_Exception_InvalidParameters);
# If a bulk action was selected, the action will be a single term, otherwise it will also contain
# the id of the single item to act upon. Work out which was used now.
@@ -20,9 +20,9 @@ if ($req->get('submit')) {
$jobs = array();
foreach ($job_ids as $job_id) {
$job = HandBrakeCluster_Job::fromId($job_id);
$job = RippingCluster_Job::fromId($job_id);
if (!$job) {
throw new HandBrakeCluster_Exception_InvalidParameters('job_id');
throw new RippingCluster_Exception_InvalidParameters('job_id');
}
$jobs[] = $job;
}
@@ -30,7 +30,7 @@ if ($req->get('submit')) {
switch ($action) {
case 'mark-failed': {
foreach ($jobs as $job) {
$job->updateStatus(HandBrakeCluster_JobStatus::FAILED);
$job->updateStatus(RippingCluster_JobStatus::FAILED);
}
} break;
@@ -41,10 +41,10 @@ if ($req->get('submit')) {
}
# Dispatch all the jobs in one run
HandBrakeCluster_Job::runAllJobs();
RippingCluster_Job::runAllJobs();
# Redirect to the job queued page to show the jobs were successfully dispatched
HandBrakeCluster_Page::redirect('rips/setup-rip/queued');
RippingCluster_Page::redirect('rips/setup-rip/queued');
} break;
case 'delete': {
@@ -54,34 +54,34 @@ if ($req->get('submit')) {
} break;
default: {
throw new HandBrakeCluster_Exception_InvalidParameters('action');
throw new RippingCluster_Exception_InvalidParameters('action');
}
}
HandBrakeCluster_Page::redirect('jobs');
RippingCluster_Page::redirect('jobs');
} else {
if (isset($_POST['view'])) {
$statusName = urlencode($_POST['view']);
HandBrakeCluster_Page::redirect("jobs/view/{$statusName}");
RippingCluster_Page::redirect("jobs/view/{$statusName}");
}
$statusName = $req->get('view', 'any');
switch ($statusName) {
case 'any': $status = null; break;
case 'queued': $status = HandBrakeCluster_JobStatus::QUEUED; break;
case 'running': $status = HandBrakeCluster_JobStatus::RUNNING; break;
case 'complete': $status = HandBrakeCluster_JobStatus::COMPLETE; break;
case 'failed': $status = HandBrakeCluster_JobStatus::FAILED; break;
default: throw new HandBrakeCluster_Exception_InvalidParameters('view');
case 'queued': $status = RippingCluster_JobStatus::QUEUED; break;
case 'running': $status = RippingCluster_JobStatus::RUNNING; break;
case 'complete': $status = RippingCluster_JobStatus::COMPLETE; break;
case 'failed': $status = RippingCluster_JobStatus::FAILED; break;
default: throw new RippingCluster_Exception_InvalidParameters('view');
}
$jobs = array();
if ($status) {
$jobs = HandBrakeCluster_Job::allWithStatus($status);
$jobs = RippingCluster_Job::allWithStatus($status);
} else {
$jobs = HandBrakeCluster_Job::all();
$jobs = RippingCluster_Job::all();
}
$this->smarty->assign('jobs', $jobs);

View File

@@ -1,7 +1,7 @@
<?php
$client_log_entries = HandBrakeCluster_ClientLogEntry::recent(30);
$worker_log_entries = HandBrakeCluster_WorkerLogEntry::recent(30);
$client_log_entries = RippingCluster_ClientLogEntry::recent(30);
$worker_log_entries = RippingCluster_WorkerLogEntry::recent(30);
$this->smarty->assign('client_log_entries', $client_log_entries);
$this->smarty->assign('worker_log_entries', $worker_log_entries);

View File

@@ -1,30 +1,30 @@
<?php
$main = HandBrakeCluster_Main::instance();
$main = RippingCluster_Main::instance();
$req = $main->request();
$config = $main->config();
// Grab the name of this source
$encoded_filename = null;
if ($req->get('submit')) {
$encoded_filename = HandBrakeCluster_Main::issetelse($_POST['id'], HandBrakeCluster_Exception_InvalidParameters);
$encoded_filename = RippingCluster_Main::issetelse($_POST['id'], RippingCluster_Exception_InvalidParameters);
// Create the jobs from the request
$jobs = HandBrakeCluster_Job::fromPostRequest($_POST['id'], $_POST['rip-options'], $_POST['rips']);
$jobs = RippingCluster_Job::fromPostRequest($_POST['id'], $_POST['rip-options'], $_POST['rips']);
// Spawn the background client process to run all the jobs
HandBrakeCluster_Job::runAllJobs();
RippingCluster_Job::runAllJobs();
HandBrakeCluster_Page::redirect('rips/setup-rip/queued');
RippingCluster_Page::redirect('rips/setup-rip/queued');
} elseif ($req->get('queued')) {
$this->smarty->assign('rips_submitted', true);
} else {
$this->smarty->assign('rips_submitted', false);
$encoded_filename = $req->get('id', HandBrakeCluster_Exception_InvalidParameters);
$encoded_filename = $req->get('id', RippingCluster_Exception_InvalidParameters);
$source = HandBrakeCluster_Rips_Source::loadEncoded($encoded_filename);
$source = RippingCluster_Rips_Source::loadEncoded($encoded_filename);
$this->smarty->assign('source', $source);
$this->smarty->assign('titles', $source->titles());

View File

@@ -1,10 +1,10 @@
<?php
$main = HandBrakeCluster_Main::instance();
$main = RippingCluster_Main::instance();
$req = $main->request();
$config = $main->config();
$source = HandBrakeCluster_Rips_Source::loadEncoded($req->get('id', HandBrakeCluster_Exception_InvalidParameters));
$source = RippingCluster_Rips_Source::loadEncoded($req->get('id', RippingCluster_Exception_InvalidParameters));
$this->smarty->assign('source', $source);
$this->smarty->assign('titles', $source->titles());

View File

@@ -1,14 +1,14 @@
<?php
$main = HandBrakeCluster_Main::instance();
$main = RippingCluster_Main::instance();
$config = $main->config();
$lister = new HandBrakeCluster_Rips_SourceLister($config->get('rips.source_dir'));
$lister = new RippingCluster_Rips_SourceLister($config->get('rips.source_dir'));
$sources = $lister->sources();
$sources_cached = array();
foreach ($sources as $source) {
$sources_cached[$source->filename()] = HandBrakeCluster_Rips_Source::isCached($source->filename());
$sources_cached[$source->filename()] = RippingCluster_Rips_Source::isCached($source->filename());
}
$this->smarty->assign('sources', $sources);