Use a global style scheme
Controllers: underscores Models: CamelCase
This commit is contained in:
@@ -57,7 +57,7 @@ class Jobs extends CI_Controller {
|
|||||||
* @todo not yet verified
|
* @todo not yet verified
|
||||||
*/
|
*/
|
||||||
public function get_unseen_results() {
|
public function get_unseen_results() {
|
||||||
$results = $this->job->get_unseen_results();
|
$results = $this->job->getUnseenResults();
|
||||||
$this->output
|
$this->output
|
||||||
->set_content_type('application/json')
|
->set_content_type('application/json')
|
||||||
->set_output(json_encode(
|
->set_output(json_encode(
|
||||||
|
|||||||
@@ -44,6 +44,6 @@ class Statusrpc extends CI_Controller {
|
|||||||
die("Unauthorized access.");
|
die("Unauthorized access.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->server->update_workload($secret, $workload);
|
$this->server->updateWorkload($secret, $workload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ class Job extends CI_Model {
|
|||||||
/**
|
/**
|
||||||
* Get a list of results that the owner has not yet seen.
|
* Get a list of results that the owner has not yet seen.
|
||||||
*/
|
*/
|
||||||
public function get_unseen_results() {
|
public function getUnseenResults() {
|
||||||
$query = $this->db->order_by('started_at', 'asc')
|
$query = $this->db->order_by('started_at', 'asc')
|
||||||
->get_where('jobs', array('started_by' => $this->session->userdata('user_id'), 'seen' => '0'));
|
->get_where('jobs', array('started_by' => $this->session->userdata('user_id'), 'seen' => '0'));
|
||||||
$jobs = $query->result_array();
|
$jobs = $query->result_array();
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class Project extends CI_Model {
|
|||||||
*
|
*
|
||||||
* @param array $project_id The project to get the configuration from.
|
* @param array $project_id The project to get the configuration from.
|
||||||
*/
|
*/
|
||||||
public function get_configurations($project_id) {
|
public function getConfigurations($project_id) {
|
||||||
$query = $this->db->get_where('configurations', array('project_id' => $project_id));
|
$query = $this->db->get_where('configurations', array('project_id' => $project_id));
|
||||||
|
|
||||||
$configurations = $query->result_array();
|
$configurations = $query->result_array();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Server extends CI_Model {
|
|||||||
*
|
*
|
||||||
* @return array List of all available servers.
|
* @return array List of all available servers.
|
||||||
*/
|
*/
|
||||||
public function get_all() {
|
public function getAll() {
|
||||||
return $this->db->get('servers')->result_array();
|
return $this->db->get('servers')->result_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ class Server extends CI_Model {
|
|||||||
*
|
*
|
||||||
* @return array List of servers that could handle another job.
|
* @return array List of servers that could handle another job.
|
||||||
*/
|
*/
|
||||||
public function get_idle() {
|
public function getIdle() {
|
||||||
return $this->db->get_where('servers', 'workload <= 2')->result_array();
|
return $this->db->get_where('servers', 'workload <= 2')->result_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ class Server extends CI_Model {
|
|||||||
* @param type $secret The server's secret for basic authentication.
|
* @param type $secret The server's secret for basic authentication.
|
||||||
* @param type $workload The server's workload.
|
* @param type $workload The server's workload.
|
||||||
*/
|
*/
|
||||||
public function update_workload($secret, $workload) {
|
public function updateWorkload($secret, $workload) {
|
||||||
$this->db->query("UPDATE `servers` SET `workload`=".$this->db->escape($workload)
|
$this->db->query("UPDATE `servers` SET `workload`=".$this->db->escape($workload)
|
||||||
. ", `last_update`=NOW()"
|
. ", `last_update`=NOW()"
|
||||||
. " WHERE `secret`=".$this->db->escape($secret));
|
. " WHERE `secret`=".$this->db->escape($secret));
|
||||||
@@ -43,7 +43,7 @@ class Server extends CI_Model {
|
|||||||
*
|
*
|
||||||
* @todo not yet verified.
|
* @todo not yet verified.
|
||||||
*/
|
*/
|
||||||
public function get_best_server() {
|
public function getBestServer() {
|
||||||
return $this->db->limit(1)->order_by('last_update', 'desc')->
|
return $this->db->limit(1)->order_by('last_update', 'desc')->
|
||||||
get_where('servers', 'workload <= 2')->row_array();
|
get_where('servers', 'workload <= 2')->row_array();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user