PHP Class PAGI\Application\PAGIApplication

PHP Version 5
Author: Marcelo Gornstein ([email protected])
显示文件 Open project: marcelog/pagi

Protected Properties

Property Type Description
$logger Logger PSR-3 logger.

Public Methods

Method Description
__construct ( array $properties = [] ) : void Constructor. Will call set_error_handler() and pcntl_signal() to setup your errorHandler() and signalHandler(). Also will call register_shutdown_function() to register your shutdown() function.
errorHandler ( integer $type, string $message, string $file, integer $line ) : boolean Your error handler. Be careful when implementing this one.
init ( ) : void Called to initialize the application
run ( ) : void Called to run the application, after calling init().
setLogger ( Psr\Log\LoggerInterface $logger ) : void Sets the logger implementation.
shutdown ( ) : void Called when PHPvm is shutting down.
signalHandler ( integer $signal ) : void Your signal handler. Be careful when implementing this one.

Protected Methods

Method Description
getAgi ( ) : PAGI\Client\IClient Returns AGI Client.

Method Details

__construct() public method

Constructor. Will call set_error_handler() and pcntl_signal() to setup your errorHandler() and signalHandler(). Also will call register_shutdown_function() to register your shutdown() function.
public __construct ( array $properties = [] ) : void
$properties array Optional additional properties.
return void

errorHandler() abstract public method

Your error handler. Be careful when implementing this one.
abstract public errorHandler ( integer $type, string $message, string $file, integer $line ) : boolean
$type integer PHP Error type constant.
$message string Human readable error message string.
$file string File that triggered the error.
$line integer Line that triggered the error.
return boolean

getAgi() protected method

Returns AGI Client.
protected getAgi ( ) : PAGI\Client\IClient
return PAGI\Client\IClient

init() abstract public method

Called to initialize the application
abstract public init ( ) : void
return void

run() abstract public method

Called to run the application, after calling init().
abstract public run ( ) : void
return void

setLogger() public method

Sets the logger implementation.
public setLogger ( Psr\Log\LoggerInterface $logger ) : void
$logger Psr\Log\LoggerInterface The PSR3-Logger
return void

shutdown() abstract public method

Called when PHPvm is shutting down.
abstract public shutdown ( ) : void
return void

signalHandler() abstract public method

Your signal handler. Be careful when implementing this one.
abstract public signalHandler ( integer $signal ) : void
$signal integer Signal catched.
return void

Property Details

$logger protected_oe property

PSR-3 logger.
protected Logger $logger
return Logger