Constants

VERSION

VERSION

Runtime API version

MIN_MAP_VERSION

MIN_MAP_VERSION

We cannot load maps older than this version

MAGIC

MAGIC

Map files start with this string

Properties

$path

$path : 

The absolute path of the map file

Type

$symbols

$symbols : \Automap\array(<key>

Type

\Automap\array( — => <target>) The symbol table (filled from slots)

$slots

$slots : \Automap\array(<ns>

Type

\Automap\array( — => <slot data>) The symbols not loaded in the symbol table yet

$symcount

$symcount : integer

Type

integer — Symbol count of this map

$options

$options : \Automap\array(<name>

Type

\Automap\array( — => <value>) The map options

$version

$version : string

Type

string — The version of \Automap\Build\Creator that created the map file

$minVersion

$minVersion : string

Type

string — The minimum runtime version needed to understand the map file

$flags

$flags : integer

Type

integer — Load flags

$basePath

$basePath : string

Type

string — Absolute base path

Methods

__construct()

__construct(string  $path, integer  $flags,   $_bp = null) 

Construct a map object from an existing map file (real or virtual)

Parameters

string $path

Path of the map file to read

integer $flags

Combination of Automap load flags (@see Automap)

$_bp

isMapFile()

isMapFile(  $path) 

Parameters

$path

key()

key(string  $type, string  $name) : string

Combines a type and a symbol in a 'key'

Starting with version 3.0, Automap is fully case-sensitive. This allows for higher performance and cleaner code.

Do not use this method (reserved for use by other Automap classes)

Parameters

string $type

one of the 'T_' constants

string $name

The symbol value (case sensitive)

Returns

string —

Symbol key

nsKey()

nsKey(string  $name) : string

Extracts the namespace from a symbol name

The returned value has no leading/trailing separator.

Do not use: access reserved for Automap classes

Parameters

string $name

The symbol value (case sensitive)

Returns

string —

Namespace. If no namespace, returns an empty string.

path()

path() 

flags()

flags() 

options()

options() 

version()

version() 

minVersion()

minVersion() 

basePath()

basePath() 

option()

option(  $opt) 

Parameters

$opt

symbolCount()

symbolCount() 

getSymbol()

getSymbol(  $type,   $symbol) 

Parameters

$type
$symbol

resolve()

resolve(string  $type,   $name, integer  $id) : \Automap\exported

Try to resolve a symbol using this map

For performance reasons, we trust the map and don't check if the symbol is defined after loading the script/extension/package.

Parameters

string $type

One of the \Automap\Mgr::T_xxx symbol types

$name
integer $id

Used to return the ID of the map where the symbol was found

Returns

\Automap\exported —

entry if found, false if not found

symbols()

symbols() 

show()

show(  $format = null,   $subfile_to_url_function = null) 

Parameters

$format
$subfile_to_url_function

check()

check() 

export()

export(  $path = null) 

Parameters

$path

_peclGetMap()

_peclGetMap(string  $version) : array

Transmits map elements to the PECL extension

Reserved for internal use

The first time a given map file is loaded, it is read by Automap\Map and transmitted to the extension. On subsequent requests, it is retrieved from persistent memory. This allows to code complex features in PHP and maintain the code in a single location without impacting performance.

Parameters

string $version

The version of data to transmit (reserved for future use)

Returns

array

loadSlot()

loadSlot(string  $ns) : null

Load a slot into the symbol table

Parameters

string $ns

Normalized namespace. Must correspond to an existing slot (no check)

Returns

null

exportEntry()

exportEntry(  $key) 

Parameters

$key

combinePath()

combinePath(string  $base, string|null  $path, boolean  $separ = false) : string

Combines a base path with another path

The base path can be relative or absolute.

The 2nd path can also be relative or absolute. If absolute, it is returned as-is. If it is a relative path, it is combined to the base path.

Uses '/' as separator (to be compatible with stream-wrapper URIs).

Parameters

string $base

The base path

string|null $path

The path to combine

boolean $separ

true: add trailing sep, false: remove it

Returns

string —

The resulting path

trailingSepar()

trailingSepar(string  $path,   $separ) : boolean

Adds or removes a trailing separator in a path

Parameters

string $path

Input

$separ

Returns

boolean —

The result path

isAbsolutePath()

isAbsolutePath(string  $path) : boolean

Determines if a given path is absolute or relative

Parameters

string $path

The path to check

Returns

boolean —

True if the path is absolute, false if relative

mkAbsolutePath()

mkAbsolutePath(string  $path, boolean  $separ = false) : string

Build an absolute path from a given (absolute or relative) path

If the input path is relative, it is combined with the current working directory.

Parameters

string $path

The path to make absolute

boolean $separ

True if the resulting path must contain a trailing separator

Returns

string —

The resulting absolute path