Constants

RUNTIME_VERSION

RUNTIME_VERSION

CRC_CHECK

CRC_CHECK

Mount flag - If set, force a CRC check when creating the PHK instance

NO_MOUNT_SCRIPT

NO_MOUNT_SCRIPT

Mount flag - If set, don't call mount/umount scripts

IS_CREATOR

IS_CREATOR

Mount flag - If set, create a \PHK\Build\Creator object, instead of a PHK object

Properties

$mnt

$mnt : string

Type

string — Current mount point

$parentMnt

$parentMnt : string

Type

string — Parent mount point (for a subpackage) or null

$options

$options : array

Type

array — Package options

$buildInfo

$buildInfo : array

Type

array — Build-time information

$flags

$flags : integer

Type

integer — Mount flags

$automapID

$automapID : string|null

Type

string|null — Automap load ID (if a map is present)

$path

$path : integer

Type

integer — Package path (URI when subpackage)

$plugin

$plugin : Object|null

Type

Object|null — Plugin object, if defined

$caching

$caching : boolean|null

Type

boolean|null — Allows to temporarily enable/disable caching

$mtime

$mtime : integer

Type

integer — The modification time for every subfiles

$backend

$backend : \PHK\Backend

Type

\PHK\Backend — The slow backend object (created only when needed)

$mimeTable

$mimeTable : array

Type

array — File extension to mime type (constant) Would be cleaner if PHP class constants could contain arrays

$valid

$valid : boolean

Type

boolean — Whether instance is valid or not (unmounted)

Methods

mnt()

mnt() 

flags()

flags() 

path()

path() 

mtime()

mtime() 

automapID()

automapID() 

options()

options() 

parentMnt()

parentMnt() 

plugin()

plugin() 

__construct()

__construct(  $parentMnt,   $mnt,   $path,   $flags,   $mtime) 

Parameters

$parentMnt
$mnt
$path
$flags
$mtime

validate()

validate() 

init()

init(  $options,   $buildInfo) 

Parameters

$options
$buildInfo

mapDefined()

mapDefined() 

setCache()

setCache(  $toggle) 

Parameters

$toggle

fileIsPackage()

fileIsPackage(string  $path) : boolean

Check if a given path contains a PHK package

Parameters

string $path

path to check (can be virtual)

Returns

boolean

dataIsPackage()

dataIsPackage(string  $data) : boolean

Check if a data buffer contains a PHK package

Parameters

string $data

data buffer to check

Returns

boolean

cacheEnabled()

cacheEnabled(  $command,   $params,   $path) 

Parameters

$command
$params
$path

umount()

umount() 

uri()

uri(  $path) 

Parameters

$path

sectionURI()

sectionURI(  $section) 

Parameters

$section

commandURI()

commandURI(  $command) 

Parameters

$command

baseURI()

baseURI() 

automapURI()

automapURI() : string

Returns the URI of the map

Returns

string

option()

option(string  $key) : \PHK\any|null

Returns an option

If the option is not set, returns null.

The 'OPTIONS' section is mandatory in a package.

Parameters

string $key

The option name

Returns

\PHK\any|null —

Option value or null if the requested option is not set

webAccessAllowed()

webAccessAllowed(  $path) 

Parameters

$path

webTunnel()

webTunnel(  $path = null,   $webinfo = false) 

Parameters

$path
$webinfo

mimeHeader()

mimeHeader(string  $path) : void

Sends a mime header corresponding to a path

Actually, we use only the file suffix (the path can correspond to an existing node or not).

If the suffix does not correspond to anything we know, nothing is sent (defaults to text/html on Apache, don't know if it can change on another SAPI).

Parameters

string $path

mimeType()

mimeType(string  $path) : string|null

Returns the mime-type corresponding to a given path, or null if the suffix does not correspond to anything we know

Searches :

  1. The 'mime-types' option
  2. The built-in mime table
  3. If the suffix contains 'php', sets the type to 'application/x-httpd-php'

Parameters

string $path

Returns

string|null —

The mime type or null if file suffix is unknown

isPHPSourcePath()

isPHPSourcePath(string  $path) : boolean

Should we consider this path as a PHP source file ?

In order to be identified as PHP source, a path must be associated with Mime type 'application/x-httpd-php'.

Parameters

string $path

Returns

boolean

proxy()

proxy() 

crcCheck()

crcCheck() : void

Checks the CRC of the PHK archive file

Generates an exception if the check fails

Throws

\Exception

acceleratorIsPresent()

acceleratorIsPresent() : boolean

Is the PHK accelerator in use or not ?

Returns

boolean

buildInfo()

buildInfo(string|null  $name = null) : array|string|null

Returns a build-time information field or the whole array

Unlike options, an unknown key throws an error

Parameters

string|null $name

Field name

Returns

array|string|null —

The field's content or null if it does not exist

subpathURL()

subpathURL(  $path) 

Parameters

$path

setSubpath()

setSubpath() 

__call()

__call(  $method,   $args) 

Parameters

$method
$args

prolog()

prolog(  $file,   $cmd,   $ret) 

Parameters

$file
$cmd
$ret

needPhpRuntime()

needPhpRuntime() 

gotoMain()

gotoMain(  $web_run_script) 

Parameters

$web_run_script

supportsPhpVersion()

supportsPhpVersion() 

backend()

backend()