ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Twig_Autoloader Class Reference

Autoloads Twig classes. More...

+ Collaboration diagram for Twig_Autoloader:

Static Public Member Functions

static register ($prepend=false)
 Registers Twig_Autoloader as an SPL autoloader. More...
 
static autoload ($class)
 Handles autoloading of classes. More...
 

Detailed Description

Autoloads Twig classes.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Deprecated:
since 1.21 and will be removed in 2.0. Use Composer instead. 2.0.

Definition at line 21 of file Autoloader.php.

Member Function Documentation

◆ autoload()

static Twig_Autoloader::autoload (   $class)
static

Handles autoloading of classes.

Parameters
string$classa class name

Definition at line 44 of file Autoloader.php.

References $file, and array.

45  {
46  if (0 !== strpos($class, 'Twig')) {
47  return;
48  }
49 
50  if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) {
51  require $file;
52  }
53  }
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file

◆ register()

static Twig_Autoloader::register (   $prepend = false)
static

Registers Twig_Autoloader as an SPL autoloader.

Parameters
bool$prependwhether to prepend the autoloader or not

Definition at line 28 of file Autoloader.php.

References array.

29  {
30  @trigger_error('Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.', E_USER_DEPRECATED);
31 
32  if (PHP_VERSION_ID < 50300) {
33  spl_autoload_register(array(__CLASS__, 'autoload'));
34  } else {
35  spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
36  }
37  }
Create styles array
The data for the language used.

The documentation for this class was generated from the following file: