[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/phpbb/ -> class_loader.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 164 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

class_loader:: (6 methods):
  __construct()
  set_cache()
  register()
  unregister()
  resolve_path()
  load_class()


Class: class_loader  - X-Ref

The class loader resolves class names to file system paths and loads them if
necessary.

Classes have to be of the form phpbb_(dir_)*(classpart_)*, so directory names
must never contain underscores. Example: phpbb_dir_subdir_class_name is a
valid class name, while phpbb_dir_sub_dir_class_name is not.

If every part of the class name is a directory, the last directory name is
also used as the filename, e.g. phpbb_dir would resolve to dir/dir.php.
__construct($namespace, $path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null)   X-Ref
Creates a new \phpbb\class_loader, which loads files with the given
file extension from the given path.

param: string $namespace Required namespace for files to be loaded
param: string $path    Directory to load files from
param: string $php_ext The file extension for PHP files
param: \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface.

set_cache(\phpbb\cache\driver\driver_interface $cache = null)   X-Ref
Provide the class loader with a cache to store paths. If set to null, the
the class loader will resolve paths by checking for the existance of every
directory in the class name every time.

param: \phpbb\cache\driver\driver_interface $cache An implementation of the phpBB cache interface.

register()   X-Ref
Registers the class loader as an autoloader using SPL.


unregister()   X-Ref
Removes the class loader from the SPL autoloader stack.


resolve_path($class)   X-Ref
Resolves a phpBB class name to a relative path which can be included.

param: string       $class The class name to resolve, must be in the
return: string|bool        A relative path to the file containing the

load_class($class)   X-Ref
Resolves a class name to a path and then includes it.

param: string $class The class name which is being loaded.



Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1