Lib
class Lib
Class Lib
Traits
Trait ObjectManager XELOS Framework
Properties
protected array | $object_cache | Each object created by a success call of |
from ObjectManager |
protected array[] | $registry | The instantiation of a requested object can be processed only if the class of the object is registered with the class name as key and its information as array in this property. The element should have at least the class name or the relative path to "class" folder. |
from ObjectManager |
protected string | $lib_class_dir | This property contains the path to the folder served as root for all requested classes. This folder can contains other folder or classes. All requested and registered classes will be searched in this folder by concating this path with the relative path defined in the registration of the requested class. If the class is not included it will be done on the fly. |
from ObjectManager |
protected string | $lib_class_prefix | An optional possibility to pretend a prefix for all registered classes. |
from ObjectManager |
protected string | $ns_class_prefix | An optional possibility to pretend a namespace prefix for classes have no namespace yet. |
from ObjectManager |
protected bool | $factory_mode | This property effects the object cache. By default it is set to false to enable the object cache for all requested objects. If this property is set true, the object cache will be disabled. |
from ObjectManager |
protected array | $injection_objects | This is an assoc array and contains objects that will be injected into each requested object. Each containing object will be injected by the name of the key. E.g. ['mod' => $object] this would inject the property named mod with the value of $object. |
from ObjectManager |
protected bool | $auto_init | This property controls if the init method of requested objects is called by this trait or not. |
from ObjectManager |
Mail read-only | |||
Export read-only | $export | ||
Import read-only | $import | ||
Format read-only | $format | ||
Date read-only | $date | ||
Connect read-only | $connect | ||
Link read-only | $link | ||
Thumbnail read-only | $thumbnail | ||
Text read-only | $text | ||
Ajax read-only | $ajax | ||
Browser read-only | $browser | ||
Debug read-only | $debug | ||
Doclink read-only | $doclink | ||
Error read-only | $error | ||
File read-only | $file | ||
Filehandler read-only | $filehandler | ||
Convert read-only | $convert | ||
I18n read-only | $i18n | ||
Session read-only | $session | ||
Request read-only | $request | ||
Shell read-only | $shell | ||
Cache read-only | $cache | ||
Sec read-only | $sec | ||
Scripting read-only | $scripting | ||
Ssl read-only | $ssl | ||
Yaml read-only | $yaml | ||
Modsetup read-only | $modsetup | ||
Validate read-only | $validate | ||
Stats read-only | $stats | ||
Navigation read-only | $navigation | ||
Foaf read-only | $foaf | ||
Notification read-only | $notification | ||
Privacy read-only | $privacy | ||
GroupSecurity read-only | $group_security | ||
Policy read-only | $policy | ||
Sort read-only | $sort | ||
SqlNestedSet read-only | $sql_nested_set | ||
Threading read-only | $threading | ||
UserImport read-only | $user_import | ||
Hierarchy read-only | $hierarchy | ||
Html read-only | $html |
Methods
Lib constructor.
This method will return an object without killing the whole process by triggering a fatal error You can use this method if its possible that the object is not available, e.g. due to user configurations
No description
Used by Template System to publish certain functions to template usage
Add given objects to injection object list that will be inject into object by magic call. The array should consists of property name as key and object as value.
trait constructor This method have to be called from constructor of each class that uses this trait.
Details
in
ObjectManager at line 249
mixed
__call($class, $args)
Magic method.
Returns the requested object. If the object is not cached, it will be instantiated with given arguments.
This method calls xf_trait::get_object
.
at line 107
__construct()
Lib constructor.
in
ObjectManager at line 231
mixed
__get($class)
Magic method.
First it checks if the requested property is defined and returns it if null. If not defined of null, it calls
xf_trait::get_object
and returns its return value.
in
ObjectManager at line 199
bool
__isset($property)
Magic method.
This method checks whether the property is defined or injected by __set
. If not
injected or defined, it will check the registry for an entry of requested property.
in
ObjectManager at line 219
__set($name, $value)
Magic method.
Sets the given value by $name
in
ObjectManager at line 266
object|null
getObjectIfAvailable(string $class)
This method will return an object without killing the whole process by triggering a fatal error You can use this method if its possible that the object is not available, e.g. due to user configurations
in
ObjectManager at line 167
string
get_lib_class_dir()
Returns the path to class directory.
in
ObjectManager at line 177
string
get_lib_class_prefix()
Returns the defined prefix for all classes.
in
ObjectManager at line 187
array
get_object_cache()
Returns an array containing all objects were requested.
at line 100
Filehandler
new_filehandler()
No description
at line 100
Quota
new_quota(int $size, int $used, mixed $unit)
No description
at line 122
string
render_xtag(string $tag, array $parameters)
Used by Template System to publish certain functions to template usage
at line 100
Session
session(mixed $db)
No description
in
ObjectManager at line 125
set_injection_objects(array $objects)
Add given objects to injection object list that will be inject into object by magic call. The array should consists of property name as key and object as value.
in
ObjectManager at line 141
set_lib_class_dir($lib_class_dir)
Sets the directory where classes are stored.
This folder can contains other folder or classes. All requested and registered classes will be searched in this folder by concating this path with the relative path defined in the registration of the requested class. If the class is not included it will be done on the fly.
in
ObjectManager at line 156
set_lib_class_prefix($lib_class_prefix)
Sets the class name prefix.
An optional possibility to pretend a prefix for all registered classes. This prefix is only required in the class name of the requested object. The registered class name should not contains this prefix. E.g. a class called xf_foobar should be registered as foobar.
in
ObjectManager at line 103
xelos_object_manager_init(bool $lib_class_dir, string $lib_class_prefix = '', string $ns_prefix = '')
trait constructor This method have to be called from constructor of each class that uses this trait.
It sets the defaults and all necessary properties.