mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 19:13:26 +00:00
renames to camelcase
This commit is contained in:
@@ -107,16 +107,16 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
|
||||
$appbox = \appbox::get_instance($app['Core']);
|
||||
$taskManager = new \task_manager($appbox);
|
||||
$tasks = $taskManager->get_tasks();
|
||||
$tasks = $taskManager->getTasks();
|
||||
|
||||
$ret = array();
|
||||
foreach ($tasks as $task) {
|
||||
$ret[$task->get_task_id()] = array(
|
||||
'id' => $task->get_task_id(),
|
||||
'state' => $task->get_status(),
|
||||
'pid' => $task->get_pid(),
|
||||
'title' => $task->get_title(),
|
||||
'last_exec_time' => $task->get_last_exec_time()
|
||||
$ret[$task->getID()] = array(
|
||||
'id' => $task->getID(),
|
||||
'state' => $task->getState(),
|
||||
'pid' => $task->getPID(),
|
||||
'title' => $task->getTitle(),
|
||||
'last_exec_time' => $task->getLastExecTime()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -140,12 +140,12 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
$taskManager = new task_manager($appbox);
|
||||
$ret = array();
|
||||
try {
|
||||
$task = $taskManager->get_task($taskId);
|
||||
$ret['id'] = $task->get_task_id();
|
||||
$ret['state'] = $task->get_status();
|
||||
$ret['pid'] = $task->get_pid();
|
||||
$ret['title'] = $task->get_title();
|
||||
$ret['last_exec_time'] = $task->get_last_exec_time();
|
||||
$task = $taskManager->getTask($taskId);
|
||||
$ret['id'] = $task->getID();
|
||||
$ret['state'] = $task->getState();
|
||||
$ret['pid'] = $task->getPID();
|
||||
$ret['title'] = $task->getTitle();
|
||||
$ret['last_exec_time'] = $task->getLastExecTime();
|
||||
} catch (\Exception_NotFound $e) {
|
||||
$result->set_error_code(404);
|
||||
$ret = array('success' => false);
|
||||
@@ -176,8 +176,8 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
$taskManager = new \task_manager($appbox);
|
||||
$ret = array('success' => true);
|
||||
try {
|
||||
$task = $taskManager->get_task($taskId);
|
||||
$task->set_status(\task_abstract::STATUS_TOSTART);
|
||||
$task = $taskManager->getTask($taskId);
|
||||
$task->setState(\task_abstract::STATUS_TOSTART);
|
||||
} catch (\Exception_NotFound $e) {
|
||||
$result->set_error_code(404);
|
||||
$ret = array('success' => false);
|
||||
@@ -208,8 +208,8 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
$taskManager = new \task_manager($appbox);
|
||||
$ret = array();
|
||||
try {
|
||||
$task = $taskManager->get_task($taskId);
|
||||
$task->set_status(\task_abstract::STATUS_TOSTOP);
|
||||
$task = $taskManager->getTask($taskId);
|
||||
$task->setState(\task_abstract::STATUS_TOSTOP);
|
||||
} catch (\Exception_NotFound $e) {
|
||||
$result->set_error_code(404);
|
||||
$ret = array('success' => false);
|
||||
@@ -253,14 +253,14 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
|
||||
$taskManager = new \task_manager($appbox);
|
||||
|
||||
$task = $taskManager->get_task($taskId);
|
||||
$task = $taskManager->getTask($taskId);
|
||||
|
||||
if ($name) {
|
||||
$task->set_title($name);
|
||||
$task->setTitle($name);
|
||||
}
|
||||
|
||||
if ($autostart) {
|
||||
$task->set_active( ! ! $autostart);
|
||||
$task->setActive( ! ! $autostart);
|
||||
}
|
||||
|
||||
$ret = array('success' => true);
|
||||
|
@@ -364,12 +364,12 @@ abstract class task_abstract
|
||||
* Return the last time the task was executed
|
||||
* @return string
|
||||
*/
|
||||
public function get_last_exec_time()
|
||||
public function getLastExecTime()
|
||||
{
|
||||
$conn = connection::getPDOConnection();
|
||||
$sql = 'SELECT last_exec_time FROM task2 WHERE task_id = :taskid';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute(array(':taskid' => $this->get_task_id()));
|
||||
$stmt->execute(array(':taskid' => $this->getID()));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
|
@@ -203,7 +203,7 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
|
||||
/**
|
||||
* Route GET /API/V1/monitor/task
|
||||
* @cover API_V1_adapter::get_task_list
|
||||
* @cover API_V1_adapter::getTask_list
|
||||
*/
|
||||
public function testGetMonitorTasks()
|
||||
{
|
||||
@@ -219,19 +219,19 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
$this->evaluateMetaJson200($content);
|
||||
$response = $content->response;
|
||||
$task_manager = new \task_manager($appbox);
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
$this->assertEquals(count($tasks), count(get_object_vars($response)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Route GET /API/V1/monitor/task{idTask}
|
||||
* @cover API_V1_adapter::get_task
|
||||
* @cover API_V1_adapter::getTask
|
||||
*/
|
||||
public function testGetMonitorTaskById()
|
||||
{
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new \task_manager($appbox);
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
if (null === self::$adminToken) {
|
||||
$this->markTestSkipped('there is no user with admin rights');
|
||||
@@ -252,7 +252,7 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
|
||||
/**
|
||||
* Route GET /API/V1/monitor/task/{idTask}
|
||||
* @cover API_V1_adapter::get_task
|
||||
* @cover API_V1_adapter::getTask
|
||||
*/
|
||||
public function testUnknowGetMonitorTaskById()
|
||||
{
|
||||
@@ -278,7 +278,7 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new \task_manager($appbox);
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
if ( ! count($tasks)) {
|
||||
$this->markTestSkipped('no tasks created for the current instance');
|
||||
@@ -291,9 +291,9 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
$content = json_decode($this->client->getResponse()->getContent());
|
||||
$this->evaluateResponse200($this->client->getResponse());
|
||||
$this->evaluateMetaJson200($content);
|
||||
$task_manager->get_tasks(true);
|
||||
$task = $task_manager->get_task($idTask);
|
||||
$this->assertEquals(\task_abstract::STATUS_TOSTART, $task->get_status());
|
||||
$task_manager->getTasks(true);
|
||||
$task = $task_manager->getTask($idTask);
|
||||
$this->assertEquals(\task_abstract::STATUS_TOSTART, $task->getState());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,7 +305,7 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new \task_manager($appbox);
|
||||
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
if (null === self::$adminToken) {
|
||||
$this->markTestSkipped('there is no user with admin rights');
|
||||
@@ -322,9 +322,9 @@ class ApiJsonApplication extends PhraseanetWebTestCaseAbstract
|
||||
$content = json_decode($this->client->getResponse()->getContent());
|
||||
$this->evaluateResponse200($this->client->getResponse());
|
||||
$this->evaluateMetaJson200($content);
|
||||
$task_manager->get_tasks(true);
|
||||
$task = $task_manager->get_task($idTask);
|
||||
$this->assertEquals(\task_abstract::STATUS_TOSTOP, $task->get_status());
|
||||
$task_manager->getTasks(true);
|
||||
$task = $task_manager->getTask($idTask);
|
||||
$this->assertEquals(\task_abstract::STATUS_TOSTOP, $task->getState());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -220,7 +220,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
||||
$this->evaluateResponse200($this->client->getResponse());
|
||||
$this->evaluateMetaYaml200($content);
|
||||
$task_manager = new \task_manager($appbox);
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
$this->assertEquals(count($tasks), count($content['response']));
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
||||
{
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new \task_manager($appbox);
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
if (null === self::$adminToken) {
|
||||
$this->markTestSkipped('there is no user with admin rights');
|
||||
@@ -279,7 +279,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
||||
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new \task_manager($appbox);
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
if ( ! count($tasks)) {
|
||||
$this->markTestSkipped('no tasks created for the current instance');
|
||||
@@ -292,9 +292,9 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
||||
$content = self::$yaml->parse($this->client->getResponse()->getContent());
|
||||
$this->evaluateResponse200($this->client->getResponse());
|
||||
$this->evaluateMetaYaml200($content);
|
||||
$task_manager->get_tasks(true);
|
||||
$task = $task_manager->get_task($idTask);
|
||||
$this->assertEquals(\task_abstract::STATUS_TOSTART, $task->get_status());
|
||||
$task_manager->getTasks(true);
|
||||
$task = $task_manager->getTask($idTask);
|
||||
$this->assertEquals(\task_abstract::STATUS_TOSTART, $task->getState());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,7 +306,7 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new \task_manager($appbox);
|
||||
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
if (null === self::$adminToken) {
|
||||
$this->markTestSkipped('there is no user with admin rights');
|
||||
@@ -323,9 +323,9 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
|
||||
$content = self::$yaml->parse($this->client->getResponse()->getContent());
|
||||
$this->evaluateResponse200($this->client->getResponse());
|
||||
$this->evaluateMetaYaml200($content);
|
||||
$task_manager->get_tasks(true);
|
||||
$task = $task_manager->get_task($idTask);
|
||||
$this->assertEquals(\task_abstract::STATUS_TOSTOP, $task->get_status());
|
||||
$task_manager->getTasks(true);
|
||||
$task = $task_manager->getTask($idTask);
|
||||
$this->assertEquals(\task_abstract::STATUS_TOSTOP, $task->getState());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user