xplo.re Medusa Core Framework 3.1
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Authentication
  • Authentication_Token
  • Autoloader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Iterator
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • String
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • UseVersion
  • Version

Functions

  • ns_expand
  • ns_file_exists
  • ns_get_version
  • ns_resolve

Class Fault

Global error handling (triggered errors and uncaught exceptions) and backtrace formatting.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Fault
Namespace: Core
Package: Core
Since: 3.0
Requires: PHP 5.3
Version: 1.0
Used by: xc_dump_bt()
Located at Fault.inc.php

Methods summary

protected
# __construct( )

Configures environment for error handling.

Configures environment for error handling.

Since

3.0
protected boolean
# _guessHTMLFlag( )

Returns

boolean

Since

3.1
protected
# _handle( mixed $errorOrException, string $message = null, boolean $plainFormat = false )

Prints out error and stops script execution if error is fatal or error threshold was reached.

Prints out error and stops script execution if error is fatal or error threshold was reached.

Parameters

$errorOrException
Error code for triggered errors or exception instance.
$message
Error message.
$plainFormat
Forces plain output (non-formatted) if set to true.

Since

3.0
protected string
# _formatFile( boolean $formatHTML, string $filename, Core\URI|string $fileURI, integer $line )

Formats a file.

Formats a file.

Parameters

$formatHTML
If set to true, a link is formatted if a file URI is passed.
$filename
Name of file.
$fileURI
URI to point to file or file path.
$line
Line number.

Returns

string
Formatted filename.

Since

3.1
protected Core\URI|string
# _formatFileLinkage( string $filename, integer $line )

Formats the path or URI of a file.

Formats the path or URI of a file.

Parameters

$filename
Name of file.
$line
Line number.

Returns

Core\URI|string

URI instance if file is a known module, otherwise relative file name to application root.

Since

3.1
protected string
# _formatFileLinkageFormat( string $filename, integer $line )

Formats the display name of a file.

Formats the display name of a file.

Parameters

$filename
Name of file.
$line
Line number.

Returns

string

Since

3.1
public boolean
# catchError( integer $errorCode, string $message = null, string $filename = null, integer $line = null, mixed $context = null, boolean $silentError = null )

Handler for triggered errors.

Handler for triggered errors.

Parameters

$errorCode
Error code.
$message
Error message.
$filename
Name of file in which the error was triggered.
$line
Line number.
$context
Additional context information.
$silentError
true, if error output is suppressed using the at operator.

Returns

boolean
true, if standard PHP error handler should be bypassed.

Since

3.0
public
# catchException( Core\Exception $exception )

Handler for uncaught exceptions. Processes exception and all chained previous exceptions (if any) and stops script execution.

Handler for uncaught exceptions. Processes exception and all chained previous exceptions (if any) and stops script execution.

Parameters

$exception
Uncaught exception instance.

Since

3.0
public
# catchShutdown( )

Handler on shutdown to catch fatal errors by checking the last error.

Handler on shutdown to catch fatal errors by checking the last error.

Since

3.0
public array[]
# backtrace( array $source = null, string & $filename = null, integer & $line = null )

Fetches and pre-processes a backtrace.

Fetches and pre-processes a backtrace.

Parameters

$source

Backtrace to process. If null, the default debug backtrace is used instead.

$filename
Receives the filename of the most recent backtrace entry.
$line
Receives the line number of the most recent backtrace entry.

Returns

array[]

Pre-processes backtrace. Each entry is an array with with the following fields:

  • file

    Source file of backtrace entry.

  • line

    Line number of backtrace entry.

  • name

    Name of called function or method.

  • args

    Formatted array of call arguments.

  • uri

    File URI based on configured linkage format.

Since

3.0
public string
# format( integer|Exception $errorOrException, string $errorMessage = null, boolean $formatHTML = false )

Formats an error or exception message with backtrace.

Formats an error or exception message with backtrace.

Parameters

$errorOrException

Error code of exception instance to format. If an error code is given, the backtrace for the error is retrieved via Core\Fault::backtrace().

$errorMessage
Error message text. Ignored for exceptions.
$formatHTML

If set to true, the error message and backtrace are HTML-formatted. HTML-formatted output is wrapped in a DIV container.

Returns

string

Since

3.0
public string
# formatBacktrace( array $backtrace, boolean $formatHTML )

Formats a backtrace.

Formats a backtrace.

Parameters

$backtrace
Backtrace to format.
$formatHTML

If set to true, the error message and backtrace are HTML-formatted. HTML-formatted output is wrapped in a DIV container.

Returns

string

Since

3.0
public static static
# instance( )

Returns the singleton instance. The fault handler can be configured using the Core\Configuration\FaultHandler constant.

Returns the singleton instance. The fault handler can be configured using the Core\Configuration\FaultHandler constant.

Returns

static
Singleton instance.

See

Core\Configuration\FaultHandler

Since

3.0
public boolean
# isErrorDeadly( integer $errorType )

Determines whether the error type causes the script to stop execution.

Determines whether the error type causes the script to stop execution.

Parameters

$errorType
Error type.

Returns

boolean

true, if the fault handler will stop script execution if an error of the given type is encountered, otherwise false.

Since

3.0

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected integer $_v_errorCount

Number of incidents handled so far.

Number of incidents handled so far.

Since

3.0
# 0
protected Core\Module\Linkage $_v_linkage

The Linkage system instance used in backtraces and to render module URLs.

The Linkage system instance used in backtraces and to render module URLs.

Since

3.1
#
protected Core\Module\Linkage $_v_linkageFormat

The Linkage system instance used in backtraces to display module names.

The Linkage system instance used in backtraces to display module names.

Since

3.1
#
protected static Core\Fault $_instance

Singleton instance.

Singleton instance.

Since

3.0
#

Magic properties

public read-only array $backtrace

Current backtrace (includes KVC property access calls).

public read-only integer $errorCount

Number of incidents handled so far.

public read-only Core\Module\Linkage $linkage

Linkage instance used in backtraces and to render module URLs.

public read-only Core\Module\Linkage $linkageFormat

Linkage instance used in backtraces to display module names.

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.1 API documentation generated by ApiGen