\phpWTL\ToolsSALT

S.A.L.T. - [S]tatic [A]sset [L]ogging [T]ool Allows for proper (webserver like) logging sequence of static assets included in a page

Summary

Methods
Properties
Constants
__construct()
logAssetType()
logAssetCustom()
finalize()
getLogbuffer()
buildTag()
includeImg()
includeCss()
includeJs()
includeIframe()
includeEmbed()
No public properties found
No constants found
No protected methods found
$_logbuffer
N/A
logAsset()
No private properties found
N/A

Properties

$_logbuffer

$_logbuffer : 

LogBuffer

Type

Methods

__construct()

__construct(object  $logger, object  $writer, array  $buffercallbacks = null, array  $bufferparams = null) 

Parameters

object $logger

Provide the logger to use.

object $writer

Provide the log writer to use.

array $buffercallbacks

Provide array of callback functions for LogBuffer.

array $bufferparams

Provide parameters for the internal LogBuffer.

logAssetType()

logAssetType(integer  $type, string  $src, array  $attr = null) 

Log asset of preset type to buffer and write corr. tag

Parameters

integer $type

Type of resource to log (see SALTHelper for constant def.).

string $src

Path and filename of resource.

array $attr

Assoc. array of key-value-pairs of attributes for a tag (optional, * = set $src as value).

logAssetCustom()

logAssetCustom(string  $name, string  $src, array  $attr = null) 

Log asset of custom type to buffer and write corr. tag

Parameters

string $name

Name of tag to create.

string $src

Path and filename of resource.

array $attr

Assoc. array of key-value-pairs of attributes for a tag (optional, * = set $src as value).

finalize()

finalize() 

Flush logbuffer to writer

getLogbuffer()

getLogbuffer() : object

Returns

object —

Get the logbuffer object.

buildTag()

buildTag(string  $name, string  $src = null, array  $attr = null) : String

Construct an arbitrary HTML tag

Parameters

string $name

Name of tag to create.

string $src

Path and filename of resource (optional).

array $attr

Assoc. array of key-value-pairs of attributes for the tag (optional, * = set $src as value).

Returns

String —

containing tag created

includeImg()

includeImg(string  $src, array  $attr = null) : String

Wrapper to create img tag.

Parameters

string $src

Path and filename of resource (optional).

array $attr

Assoc. array of key-value-pairs of additional attributes for a tag (optional, * = set $src as value).

Returns

String —

containing tag created

includeCss()

includeCss(string  $src, array  $attr = null) : String

Wrapper to inlude CSS stylesheet.

Parameters

string $src

Path and filename of resource (optional).

array $attr

Assoc. array of key-value-pairs of additional attributes for a tag (optional, * = set $src as value).

Returns

String —

containing tag created

includeJs()

includeJs(string  $src, array  $attr = null) : String

Wrapper to inlude JS script file.

Parameters

string $src

Path and filename of resource (optional).

array $attr

Assoc. array of key-value-pairs of additional attributes for a tag (optional, * = set $src as value).

Returns

String —

containing tag created

includeIframe()

includeIframe(string  $src, array  $attr = null) : String

Wrapper to inlude iFrame.

Parameters

string $src

Path and filename of resource (optional).

array $attr

Assoc. array of key-value-pairs of additional attributes for a tag (optional, * = set $src as value).

Returns

String —

containing tag created

includeEmbed()

includeEmbed(string  $src, array  $attr = null) : String

Wrapper to inlude embed tag.

Parameters

string $src

Path and filename of resource (optional).

array $attr

Assoc. array of key-value-pairs of additional attributes for a tag (optional, * = set $src as value).

Returns

String —

containing tag created

logAsset()

logAsset(string  $src) 

Log asset

Parameters

string $src

Path and filename of resource.