\PHKBackend

This class contains the non-accelerated runtime code. This code must never be accessed during 'fast path' scenarios.

Each \PHK\Backend instance is associated with a 'front-end' PHK instance (accelerated or not).

Summary

Methods
Properties
Constants
__construct()
__get()
__call()
test()
envinfo()
showfiles()
showmap()
infoSection()
showInfoLine()
startInfoTable()
endInfoTable()
info()
techinfo()
autoFile()
autoOption()
isCallablePluginMethod()
callPluginMethod()
pathList()
sectionList()
check()
subpathURL()
builtinProlog()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
pluginInfo()
showOption()
cmdUsage()
$front
N/A

Properties

$front

$front : 

Type

Methods

__construct()

__construct(  $front) 

Parameters

$front

__get()

__get(  $name) 

Parameters

$name

__call()

__call(  $method,   $args) 

Parameters

$method
$args

test()

test() 

envinfo()

envinfo() 

showfiles()

showfiles() 

showmap()

showmap(  $subfile_to_url_function = null) 

Parameters

$subfile_to_url_function

infoSection()

infoSection(boolean  $html, string  $title) : void

<Info> Start a new information section

Parameters

boolean $html

Whether to display in html or raw text

string $title

The title to display

showInfoLine()

showInfoLine(boolean  $html, string  $string, string|boolean  $value, string|null  $url = null, boolean  $newwin = true) : void

<Info> Displays an information line

In html mode, the information is displayed in a table. This table must have been opened by a previous call to \PHK::startInfoTable().

Note: The URLs starting with a '/' char are internal (generated by \PHK\Web\Info ) and, so, are displayed in html mode only.

Parameters

boolean $html

Whether to display in html or raw text

string $string

The left side (without ':')

string|boolean $value

The value to display. If boolean, displays 'Yes' or 'No'.

string|null $url

An URL to associate with this value. Null if no URL.

boolean $newwin

Used in html mode only. Whether the URL link opens a new window when clicked.

startInfoTable()

startInfoTable(boolean  $html) : void

<Info> Starts an HTML table

In text mode, does nothing.

This function is public because it can be called from the plugin's _webinfo method.

Parameters

boolean $html

Whether to display in html or raw text

endInfoTable()

endInfoTable(  $html) 

Parameters

$html

info()

info() 

techinfo()

techinfo() 

autoFile()

autoFile(string  $prefix) : string|null

Returns a subfile content for a multi-type metafile

File name : . - Type is 'txt' or 'htm'.

A text file can be transformed to html, but the opposite is not possible.

Type is determined by the SAPI type (CLI => txt, else => htm).

Parameters

string $prefix

Prefix to search for

Returns

string|null —

The requested content or null if not found

autoOption()

autoOption(string  $name) : string

Returns a multi-type content from an option name

Option ($name.'_prefix') gives the prefix to send to autoFile()

Parameters

string $name

Option prefix

Returns

string —

Requested content or an informative error string.

isCallablePluginMethod()

isCallablePluginMethod(string  $method) : boolean

Checks if the plugin class is defined and contains a given method

Parameters

string $method

Returns

boolean

callPluginMethod()

callPluginMethod(  $method) : \PHK\*

Calls a given method in the plugin object

Parameters

$method

Throws

\Exception

if the plugin or the method does not exist

Returns

\PHK\* —

the method's return value

pathList()

pathList() 

sectionList()

sectionList() 

check()

check() : array

Check a package

TODO: There's a lot more to check...

Returns

array —

of error messages

subpathURL()

subpathURL(  $path) 

Parameters

$path

builtinProlog()

builtinProlog(  $file) 

Parameters

$file

pluginInfo()

pluginInfo(boolean  $html) : void

<Info> Displays information about the plugin

If the plugin object defines a method name '_webinfo', this method is called with the $html parameter.

If the plugin is not defined, just displays a small informative message

Parameters

boolean $html

Whether to display in html or raw text

showOption()

showOption(boolean  $html, string  $opt,   $default = null) : void

<Info> Displays an option and its value

An URL can be set in an option. Syntax: 'text to display ' In HTML mode, only the text is displayed and an hyperlink is generated In text mode, it is displayed as-is. URLs starting with 'http://' are automatically recognized

Parameters

boolean $html

Whether to display in html or raw text

string $opt

Option name

$default

cmdUsage()

cmdUsage(  $msg = null) 

Parameters

$msg