RSI helpers  0.1
RSI helpers
Dump Class Reference
Inheritance diagram for Dump:
Thing

Public Member Functions

 __construct ($config=null)
 
 head ()
 Head for dumps (style and script tags). More...
 
 source ($filename, $line_no=null, $line_to=null, $type=null, $header=null)
 Dump source code. More...
 
 var ($name, $value, $docs=null)
 Dump a variable. More...
 
 trace ($trace=null)
 Dump a (back-) trace. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Static Public Member Functions

static die ($value=null)
 Dump and die. More...
 

Data Fields

 $styleFile = __DIR__ . '/dump.css'
 Stylsheet filename. More...
 
 $styleNamespace = 'dump'
 
 $scriptFile = __DIR__ . '/dump.js'
 Javascript filename. More...
 
 $scriptNamespace = 'dump'
 
 $extraBefore = 10
 Extra lines to show before focus in source code dump. More...
 
 $extraAfter = 5
 Extra lines to show after focus line in source code dump. More...
 
 $sourceFormat
 
 $memoryLimit = null
 Maximum memory usage (empty = 20% of script memory limit). More...
 
 $maxDepth = 16
 Maximum recursion depth. More...
 
 $maxLength = 128
 Maximum single line length (chop+expand if longer). More...
 
 $timeWindow = 315360000
 Window (seconds) for integer to time conversion (default = 10 years). More...
 
 $timeFormat = 'Y-m-d H:i:s'
 
 $validFilename = '/^([A-Z]:[\\/\\\\]|\\/|\\\\\\\\)[^\\*\\?\\:\\|\<\>\\&\\r\\n]*\\.\\w+$/'
 Regex to determine if a string might be a filename (empty = do not check). More...
 
 $groupProperties = true
 Group properties by (parent) class. More...
 
 $sortProperties = true
 Sort properties by name (ignoring leading underscores). More...
 
 $remoteDocs = 'https://php.net/manual/en/'
 Remote location for PHP documentation. More...
 
 $localDocs = null
 Local location for PHP documentation (https://www.php.net/download-docs.php, "Many HTML files"). More...
 
 $paramConstsFile = __DIR__ . '/../../data/consts.php'
 File with const data for parameters. More...
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 valueAsTime ($value)
 
 escapeDoc ($doc)
 
 propertyDoc ($filename, $property)
 
 reflectVisibility ($reflect)
 
 varConstTable ($constants)
 
 varTypeArray ($value, &$size, &$sub, $depth, $hashes)
 
 varTypeBoolean ($value, &$size, &$sub, $depth, $hashes)
 
 varTypeDouble ($value, &$size, &$sub, $depth, $hashes)
 
 varTypeInteger ($value, &$size, &$sub, $depth, $hashes)
 
 varTypeNull ($value, &$size, &$sub, $depth, $hashes)
 
 varTypeObject ($value, &$size, &$sub, $depth, $hashes)
 
 varTypeResource ($value, &$size, &$sub, $depth, $hashes)
 
 varTypeString ($value, &$size, &$sub, $depth, $hashes)
 
 varTypeUnknown ($value, &$size, &$sub, $depth, $hashes)
 
 varValue ($value, &$size=null, &$sub=null, $depth=0, $hashes=[])
 
 varRow ($name, $visibility, $value, $depth=0, $hashes=[], $docs=null)
 
 traceTabs ($step, $reflect)
 
 traceShowTab ($tabs, $index, $key)
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Protected Attributes

 $_index = 0
 
 $_propertyDocs = []
 
 $_paramConsts = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 

Detailed Description

Definition at line 5 of file Dump.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $config = null)

Definition at line 54 of file Dump.php.

Member Function Documentation

◆ die()

static die (   $value = null)
static

Dump and die.

Parameters
mixed$valueTrace when empty.

Definition at line 525 of file Dump.php.

◆ escapeDoc()

escapeDoc (   $doc)
protected

Definition at line 112 of file Dump.php.

◆ head()

head ( )

Head for dumps (style and script tags).

Returns
string

Definition at line 62 of file Dump.php.

◆ propertyDoc()

propertyDoc (   $filename,
  $property 
)
protected

Definition at line 122 of file Dump.php.

◆ reflectVisibility()

reflectVisibility (   $reflect)
protected

Definition at line 148 of file Dump.php.

◆ source()

source (   $filename,
  $line_no = null,
  $line_to = null,
  $type = null,
  $header = null 
)

Dump source code.

Parameters
string | array$filenameFilename or array with lines.
int$line_noLine to focus (empty = complete file, no focus).
int$line_toShow source from $line_no to $line_to (no focus).
string$typeFormatting type (empty = use filename extension).
string$headerHeader (defaults to filename; may contain HTML / no escaping).
Returns
string Returns false if the file is not readable.

Definition at line 76 of file Dump.php.

◆ trace()

trace (   $trace = null)

Dump a (back-) trace.

Parameters
array$traceCurrent trace when empty.
Returns
string

Definition at line 475 of file Dump.php.

◆ traceShowTab()

traceShowTab (   $tabs,
  $index,
  $key 
)
protected

Definition at line 467 of file Dump.php.

◆ traceTabs()

traceTabs (   $step,
  $reflect 
)
protected

Definition at line 406 of file Dump.php.

◆ valueAsTime()

valueAsTime (   $value)
protected

Definition at line 108 of file Dump.php.

◆ var()

var (   $name,
  $value,
  $docs = null 
)

Dump a variable.

Parameters
string$nameName of the variable.
mixed$value
string$docsDocumentation for the variable.
Returns
string

Definition at line 402 of file Dump.php.

◆ varConstTable()

varConstTable (   $constants)
protected

Definition at line 157 of file Dump.php.

◆ varRow()

varRow (   $name,
  $visibility,
  $value,
  $depth = 0,
  $hashes = [],
  $docs = null 
)
protected

Definition at line 369 of file Dump.php.

◆ varTypeArray()

varTypeArray (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 172 of file Dump.php.

◆ varTypeBoolean()

varTypeBoolean (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 242 of file Dump.php.

◆ varTypeDouble()

varTypeDouble (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 246 of file Dump.php.

◆ varTypeInteger()

varTypeInteger (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 251 of file Dump.php.

◆ varTypeNull()

varTypeNull (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 256 of file Dump.php.

◆ varTypeObject()

varTypeObject (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 260 of file Dump.php.

◆ varTypeResource()

varTypeResource (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 327 of file Dump.php.

◆ varTypeString()

varTypeString (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 342 of file Dump.php.

◆ varTypeUnknown()

varTypeUnknown (   $value,
$size,
$sub,
  $depth,
  $hashes 
)
protected

Definition at line 357 of file Dump.php.

◆ varValue()

varValue (   $value,
$size = null,
$sub = null,
  $depth = 0,
  $hashes = [] 
)
protected

Definition at line 361 of file Dump.php.

Field Documentation

◆ $_index

$_index = 0
protected

Definition at line 50 of file Dump.php.

◆ $_paramConsts

$_paramConsts = null
protected

Definition at line 52 of file Dump.php.

◆ $_propertyDocs

$_propertyDocs = []
protected

Definition at line 51 of file Dump.php.

◆ $extraAfter

$extraAfter = 5

Extra lines to show after focus line in source code dump.

Definition at line 12 of file Dump.php.

◆ $extraBefore

$extraBefore = 10

Extra lines to show before focus in source code dump.

Definition at line 11 of file Dump.php.

◆ $groupProperties

$groupProperties = true

Group properties by (parent) class.

Definition at line 44 of file Dump.php.

◆ $localDocs

$localDocs = null

Local location for PHP documentation (https://www.php.net/download-docs.php, "Many HTML files").

Definition at line 47 of file Dump.php.

◆ $maxDepth

$maxDepth = 16

Maximum recursion depth.

Definition at line 39 of file Dump.php.

◆ $maxLength

$maxLength = 128

Maximum single line length (chop+expand if longer).

Definition at line 40 of file Dump.php.

◆ $memoryLimit

$memoryLimit = null

Maximum memory usage (empty = 20% of script memory limit).

Definition at line 38 of file Dump.php.

◆ $paramConstsFile

$paramConstsFile = __DIR__ . '/../../data/consts.php'

File with const data for parameters.

Definition at line 48 of file Dump.php.

◆ $remoteDocs

$remoteDocs = 'https://php.net/manual/en/'

Remote location for PHP documentation.

Definition at line 46 of file Dump.php.

◆ $scriptFile

$scriptFile = __DIR__ . '/dump.js'

Javascript filename.

Definition at line 9 of file Dump.php.

◆ $scriptNamespace

$scriptNamespace = 'dump'

Definition at line 10 of file Dump.php.

◆ $sortProperties

$sortProperties = true

Sort properties by name (ignoring leading underscores).

Definition at line 45 of file Dump.php.

◆ $sourceFormat

$sourceFormat
Initial value:
= [
'php' => [
'/\\$\\w+/' => '<i>$0</i>'

Definition at line 13 of file Dump.php.

◆ $styleFile

$styleFile = __DIR__ . '/dump.css'

Stylsheet filename.

Definition at line 7 of file Dump.php.

◆ $styleNamespace

$styleNamespace = 'dump'

Definition at line 8 of file Dump.php.

◆ $timeFormat

$timeFormat = 'Y-m-d H:i:s'

Definition at line 42 of file Dump.php.

◆ $timeWindow

$timeWindow = 315360000

Window (seconds) for integer to time conversion (default = 10 years).

Definition at line 41 of file Dump.php.

◆ $validFilename

$validFilename = '/^([A-Z]:[\\/\\\\]|\\/|\\\\\\\\)[^\\*\\?\\:\\|\<\>\\&\\r\\n]*\\.\\w+$/'

Regex to determine if a string might be a filename (empty = do not check).

Definition at line 43 of file Dump.php.


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