Detailed Description
Class for event processing.
- Author
- Dodonov A.A.
Definition at line 26 of file event_manager.php.
Constructor & Destructor Documentation
Constructor.
- Author
- Dodonov A.A.
Definition at line 54 of file event_manager.php.
{
try
{
$this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
$this->
register_events( dirname( __FILE__ ).
'/conf/cf_event_manager_binded_events' );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| register_event |
( |
|
$Event, |
|
|
|
$PackageName, |
|
|
|
$PackageVersion, |
|
|
|
$Handler = false |
|
) |
| |
Function registers event handler.
- Parameters
-
| $Event | - Event's name. |
| $PackageName | - Package's name. |
| $PackageVersion | - Package's version. |
| $Handler | - Event's handler. |
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 99 of file event_manager.php.
{
try
{
if( isset( $this->LoadedBindings[ $Event ] ) === false )
{
$this->LoadedBindings[ $Event ] = array();
}
if( isset( $this->LoadedBindings[ $Event ][ $PackageName ] ) === false )
{
$this->LoadedBindings[ $Event ][ $PackageName ] = array();
}
if( isset( $this->LoadedBindings[ $Event ][ $PackageName ][ $PackageVersion ] ) === false )
{
$this->LoadedBindings[ $Event ][ $PackageName ][ $PackageVersion ] = array();
}
$this->LoadedBindings[ $Event ][ $PackageName ][ $PackageVersion ] [] = $Handler;
}
catch( Exception $e )
{
}
}
| register_events |
( |
|
$ConfigPath | ) |
|
Function registers event handlers.
- Parameters
-
| $ConfigPath | - Path to the config with event bindings. |
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 144 of file event_manager.php.
{
try
{
$Bindings = $this->CachedMultyFS->file_get_contents( $ConfigPath , 'cleaned' );
if( $Bindings != '' )
{
$Bindings = explode( "\n" , $Bindings );
foreach( $Bindings as $k => $v )
{
$this->Settings->load_settings( $v );
$this->Settings->get_setting( 'package_name' ) ,
$this->Settings->get_setting( 'package_version' ) ,
$this->Settings->get_setting( 'handler' , false ) );
}
}
}
catch( Exception $e )
{
}
}
| trigger_event |
( |
|
$Event, |
|
|
|
$Parameters |
|
) |
| |
Function runs event handler.
- Parameters
-
| $Event | - Event's name. |
| $Parameters | - Event's parameters. |
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 194 of file event_manager.php.
{
try
{
$Return = array();
if( isset( $this->LoadedBindings[ $Event ] ) )
{
foreach( $this->LoadedBindings[ $Event ] as $PackageName => $PackageVersions )
{
foreach( $PackageVersions as $PackageVersion => $FunctionNames )
{
foreach( $FunctionNames as $k => $FunctionName )
{
$Object =
get_package( $PackageName , $PackageVersion , __FILE__ );
$Return [] = call_user_func( array( $Object , $FunctionName ) , $Parameters );
}
}
}
}
return( $Return );
}
catch( Exception $e )
{
}
}
Field Documentation
| $LoadedBindings = array() |
The documentation for this class was generated from the following file: