Jelix 1.7.18

jAutoloader
in package

Tags
subpackage

core

Table of Contents

$classPaths  : mixed
$includePaths  : mixed
$nsPaths  : mixed
$regClassPaths  : mixed
loadClass()  : mixed
the method that should be called by the autoload system.
registerClass()  : mixed
register a simple class name associated to a file.
registerClassPattern()  : mixed
register a regular expression associated to a path. If the class name match the given regular expression, then it will load the file $includePath.'/'.$className.$extension.
registerIncludePath()  : mixed
registerNamespace()  : mixed
register a namespace associated to a path. The full class path will be resolved following psr0 rules.
registerNamespacePathMap()  : mixed
register a namespace associated to a path. The full class path will be resolved as: - the part of the namespace of the class that match $namespace, is removed - the other part is then transformed following psr0 rules - the resulting path is then added to $includePath.
getPath()  : string

Properties

Methods

loadClass()

the method that should be called by the autoload system.

public loadClass(mixed $className) : mixed
Parameters
$className : mixed
Return values
mixed

registerClass()

register a simple class name associated to a file.

public registerClass(mixed $className, mixed $includeFile) : mixed
Parameters
$className : mixed
$includeFile : mixed
Tags
parameter

string $className the class name. It can contain a namespace

parameter

string $includeFile the full path to the file we have to include

Return values
mixed

registerClassPattern()

register a regular expression associated to a path. If the class name match the given regular expression, then it will load the file $includePath.'/'.$className.$extension.

public registerClassPattern(mixed $regExp, mixed $includePath[, mixed $extension = '.php' ]) : mixed
Parameters
$regExp : mixed
$includePath : mixed
$extension : mixed = '.php'
Return values
mixed

registerIncludePath()

public registerIncludePath(mixed $includePath[, mixed $extension = '.php' ]) : mixed
Parameters
$includePath : mixed
$extension : mixed = '.php'
Return values
mixed

registerNamespace()

register a namespace associated to a path. The full class path will be resolved following psr0 rules.

public registerNamespace(mixed $namespace, mixed $includePath[, mixed $extension = '.php' ]) : mixed

example: registerNamespace('foo\bar','/my/path', '.php') the resulting path for the class \foo\bar\baz\myclass is /my/path/foo/bar/baz/myclass.php

Parameters
$namespace : mixed
$includePath : mixed
$extension : mixed = '.php'
Return values
mixed

registerNamespacePathMap()

register a namespace associated to a path. The full class path will be resolved as: - the part of the namespace of the class that match $namespace, is removed - the other part is then transformed following psr0 rules - the resulting path is then added to $includePath.

public registerNamespacePathMap(mixed $namespace, mixed $includePath[, mixed $extension = '.php' ]) : mixed

registerNamespacePathMap('foo\bar','/my/path', '.php'); the resulting path for the class \foo\bar\baz\myclass is /my/path/baz/myclass.php

Parameters
$namespace : mixed
$includePath : mixed
$extension : mixed = '.php'
Return values
mixed

getPath()

protected getPath(mixed $className) : string
Parameters
$className : mixed
Return values
string

the full path of the file declaring the given class

Search results