PHP Classes

File: public/status-task.php

Recommend this page to a friend!
  Classes of Joseluis Laso   Asynchronous Long Server Tasks   public/status-task.php   Download  
File: public/status-task.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Asynchronous Long Server Tasks
Start background tasks and query progress status
Author: By
Last change:
Date: 9 years ago
Size: 357 bytes
 

Contents

Class file image Download
<?php

require_once __DIR__.'/../vendor/autoload.php';

use
JLaso\ToolsLib\Json;
use
JLaso\ToolsLib\Status;

$id = $_REQUEST["id"];
$task = $_REQUEST["_task"];

if (!
$id) {

   
Json::error('The id is mandatory in order to process your request!');

}else{

   
$status = new Status($task);
   
Json::ok(array('id'=>$id, 'status'=>$status->getInfo($id)));

}