ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
trace_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| add_trace_string ($Str, $Type=COMMON)
| start_group ($Str)
| end_group ($Count=1)
| add_action ($ActionName, $ActionDescription)
| compile_trace ()
| __toString ()

## Data Fields
| $StoreTrace = true
| $TraceStrings = array()
| $Templates = array()
| $CachedMultyFS = false
| $String = false

## Detailed Description

Trace class.

Author
  Dodonov A.A.

Definition at line 31 of file trace.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Author
  Dodonov A.A.

Definition at line 92 of file trace.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$Data = array(
ERROR => 'trace_line_error.tpl' , COMMON => 'trace_line_common.tpl' ,
NOTIFICATION => 'trace_line_notification.tpl' , QUERY => 'trace_line_query.tpl' ,
'start_group' => 'trace_start_group.tpl' , 'end_group' => 'trace_end_group.tpl'
);
foreach( $Data as $Key => $Value )
{
$this->Templates[ $Key ] = $this->CachedMultyFS->get_template( __FILE__ , $Value );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Member Function Documentation

__toString | ( |  | ) |

Function converts object to string.

Returns
  String with the object's description.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 438 of file trace.php.

{
try
{
return( "" );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

add_action | ( |  | $ActionName,
|  |  | $ActionDescription
| ) |  |

Method adds record to log.

Parameters

  $ActionName | - Action's title.
  $ActionDescription | - Action's description.

Author
  Dodonov A.A.

Definition at line 247 of file trace.php.

{
try
{
if( $this->StoreTrace )
{
$Database = get_package( 'database' );
$Database->insert(
'umx_action' , "action_name , time , info" ,
"'".htmlspecialchars( $ActionName , ENT_QUOTES )."', NOW() ,'".
htmlspecialchars( $ActionDescription , ENT_QUOTES )."'"
);
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

add_trace_string | ( |  | $Str,
|  |  | $Type = `COMMON`
| ) |  |

Method adds tracing string.

Parameters

  $Str | - Trace string.
  $Type | - String type.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 138 of file trace.php.

{
try
{
if( $this->StoreTrace )
{
$Template = str_replace( '{string}' , $Str , $this->Templates[ $Type ] );
$this->TraceStrings [] = array( 'name' => 'string' , 'content' => $Template );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

compile_trace | ( |  | ) |

Method compiles trace.

Returns
  HTML code.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 396 of file trace.php.

{
try
{
if( $this->StoreTrace )
{
$Output = $this->compile_trace_items();
$TraceBlock = $this->CachedMultyFS->get_template( __FILE__ , 'trace_block.tpl' );
$TraceBlock = str_replace( '{output}' , $Output , $TraceBlock );
return( $TraceBlock );
}
else
{
return( '{lang:trace_switched_off}' );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

end_group | ( |  | $Count = `1` | ) |

Method ends group.

Parameters

  $Count | - Count of the ending groups.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 209 of file trace.php.

{
try
{
if( $this->StoreTrace )
{
for( $i = 0 ; $i < $Count ; $i++ )
{
$this->TraceStrings [] = array(
'name' => 'end_group' , 'content' => $this->Templates[ 'end_group' ]
);
}
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

start_group | ( |  | $Str | ) |

Method adds group.

Parameters

  $Str | - Group title.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 173 of file trace.php.

{
try
{
if( $this->StoreTrace )
{
$Template = str_replace( '{string}' , $Str , $this->Templates[ 'start_group' ] );
$Template = str_replace( '{i}' , count( $this->TraceStrings ) , $Template );
$this->TraceStrings [] = array( 'name' => 'start_group' , 'content' => $Template );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$CachedMultyFS = false

Cached objects.

Author
  Dodonov A.A.

Definition at line 79 of file trace.php.

$StoreTrace = true

Tracing strings.

Author
  Dodonov A.A.

Definition at line 43 of file trace.php.

$String = false

Definition at line 80 of file trace.php.

$Templates = array()

Templates.

Author
  Dodonov A.A.

Definition at line 67 of file trace.php.

$TraceStrings = array()

Tracing strings.

Author
  Dodonov A.A.

Definition at line 55 of file trace.php.

The documentation for this class was generated from the following file:

- packages/trace/trace.php