| Server IP : 85.158.181.41 / Your IP : 216.73.217.12 Web Server : Apache System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64 User : moncbefd ( 1024) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/moncbefd/www.moneta.at/GXMainComponents/Controllers/Api/v2/ |
Upload File : |
<?php
/* --------------------------------------------------------------
CronjobsApiV2Controller.inc.php 2018-08-28
Gambio GmbH
http://www.gambio.de
Copyright (c) 2018 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
MainFactory::load_class('HttpApiV2Controller');
/**
* Class CronjobsApiV2Controller
*
* Provides a gateway to cronjob specific tasks.
*
* @category System
* @package ApiV2Controllers
*/
class CronjobsApiV2Controller extends HttpApiV2Controller
{
/**
* @throws \HttpApiV2Exception
* @api {post} /cronjobs/ Do cronjob specific tasks
* @apiVersion 2.7.0
* @apiName SetImageProcessingTrigger
* @apiGroup Cronjobs
*
* @apiDescription
* Set trigger for ImageProcessing cronjob. This method will always return success.
*
* @apiExample {curl} Set image processing trigger
* curl -X POST --user admin@shop.de:12345 http://shop.de/api.php/v2/cronjobs/image_processing
*
* @apiSuccessExample {json} Success-Response
* {
* "code": 200,
* "status": "success",
* "action": "setImageProcessingTrigger"
* }
*
*/
public function post()
{
// Check if task was provided.
if (!isset($this->uri[1]) || !is_string($this->uri[1])) {
throw new HttpApiV2Exception('Task name was not provided in the resource URL.', 400);
}
if (isset($this->uri[1]) && $this->uri[1] === 'image_processing') {
ImageProcessingService::setTrigger();
$response = [
'code' => 200,
'status' => 'success',
'action' => 'setImageProcessingTrigger'
];
$this->_writeResponse($response);
}
}
}