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