Wismas  1.1
BTS SN-IR La Salle Avignon 2017
Fonctions membres publiques statiques | Attributs publics statiques
Référence de la classe Smarty_Autoloader

Liste de tous les membres

Fonctions membres publiques statiques

static registerBC ($prepend=false)
static register ($prepend=false)
static autoload ($class)

Attributs publics statiques

static $SMARTY_DIR = ''
static $SMARTY_SYSPLUGINS_DIR = ''
static $rootClasses = array('smarty' => 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',)

Documentation des fonctions membres

static Smarty_Autoloader::autoload ( class) [static]

Handles auto loading of classes.

Paramètres:
string$classA class name.
    {
        $_class = strtolower($class);
        $file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';
        if (strpos($_class, 'smarty_internal_') === 0) {
            if (strpos($_class, 'smarty_internal_compile_') === 0) {
                if (is_file($file)) {
                    require $file;
                }
                return;
            }
            @include $file;
            return;
        }
        if (preg_match('/^(smarty_(((template_(source|config|cache|compiled|resource_base))|((cached|compiled)?resource)|(variable|security)))|(smarty(bc)?)$)/',
                       $_class, $match)) {
            if (!empty($match[3])) {
                @include $file;
                return;
            } elseif (!empty($match[9]) && isset(self::$rootClasses[$_class])) {
                $file = self::$rootClasses[$_class];
                require $file;
                return;
            }
        }
        if (0 !== strpos($_class, 'smarty')) {
            return;
        }
        if (is_file($file)) {
            require $file;
            return;
        }
        return;
    }
static Smarty_Autoloader::register ( prepend = false) [static]

Registers Smarty_Autoloader as an SPL autoloader.

Paramètres:
bool$prependWhether to prepend the autoloader or not.

Référencé par registerBC().

    {
        self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR;
        self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR :
            self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR;
        if (version_compare(phpversion(), '5.3.0', '>=')) {
            spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
        } else {
            spl_autoload_register(array(__CLASS__, 'autoload'));
        }
    }
static Smarty_Autoloader::registerBC ( prepend = false) [static]

Registers Smarty_Autoloader backward compatible to older installations.

Paramètres:
bool$prependWhether to prepend the autoloader or not.

register the class autoloader

Références register().

    {
        if (!defined('SMARTY_SPL_AUTOLOAD')) {
            define('SMARTY_SPL_AUTOLOAD', 0);
        }
        if (SMARTY_SPL_AUTOLOAD &&
            set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false
        ) {
            $registeredAutoLoadFunctions = spl_autoload_functions();
            if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {
                spl_autoload_register();
            }
        } else {
            self::register($prepend);
        }
    }

Documentation des données membres

Smarty_Autoloader::$rootClasses = array('smarty' => 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',) [static]
Smarty_Autoloader::$SMARTY_DIR = '' [static]
Smarty_Autoloader::$SMARTY_SYSPLUGINS_DIR = '' [static]

La documentation de cette classe a été générée à partir du fichier suivant :
 Tout Classes Fichiers Fonctions Variables Définitions de type Macros