Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_BackgroundProcess class

• Introduction

Class AMI_BackgroundProcess.

• Class synopsis

AMI_BackgroundProcess {
/* Properties */
// Instance
protected static AMI_BackgroundProcess $oInstance;
/* Methods */
// Constructor.
public __construct ( ) returns AMI_BackgroundProcess;
// Register background handler.
public registerHandler ( string $handler ) returns void;
// Unregister background handler.
public unregisterHandler ( string $handler ) returns void;
}

• Class Details

Allows to manage "background" processes.
  Example:
  •  $AMI_ENV_SETTINGS array('mode' => 'full''disable_cache' => true);
  •  require 'ami_env.php';
  •  
  •  $oResponse AMI::getSingleton('response');
  •  $oResponse->start();
  •  
  •  // Create AMI_BackgroundProcess object
  •  $oBackgroundProcess new AMI_BackgroundProcess();
  •  
  •  // Add background process into the queue
  •  // The method "process" of class "User_BackgroundProcess" will be performed and should exist
  •  $oBackgroundProcess->registerHandler("User_BackgroundProcess::process");
  •  
  •  $oResponse->write('The background process was added into the queue.');
  •  $oResponse->send();
Tags:
since 6.0.6

• Class Properies

protected static AMI_BackgroundProcess $oInstance

Instance

• Class Methods

// Constructor.
public __construct ( ) returns AMI_BackgroundProcess;
// Register background handler.
public registerHandler ( string $handler ) returns void;
  • string $handler
    Handler name like "className::methodName".
// Unregister background handler.
public unregisterHandler ( string $handler ) returns void;
  • string $handler
    Handler name like "className::methodName".