CMS  Version 3.9
test_background_process.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("process", "developer_tools");
3 
4 if (!checkRole("admin"))
5 {
6  throw new FakoliException("Permission Denied");
7 }
8 
9 if (!$process)
10 {
11  // We are in a user request - spawn the background process and return the ID
12 
13  $process = new ProcessManager();
14 
15  echo $process->run("/action/developer_tools/test_background_process");
16 }
17 else
18 {
19  for($i = 0; $i < 100; $i += 10)
20  {
21  $process->setProgress("Running", "Testing", $i);
22  sleep(3);
23  }
24 
25  $process->setProgress("Completed", "Test Completed", 100);
26 }
27 ?>
FakoliException is the base exception class for all Fakoli errors.
Definition: core.inc:53
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
Provides a central management class for event handlers and common functionality for the process compo...
$process
Definition: run.php:54