Files
PHPExcel
chart
classes
config
datepicker
html2pdf_v4.03
language
lib
smarty
demo
lexer
libs
internals
plugins
sysplugins
Autoloader.php
Config_File.class.php
Smarty.class.php
SmartyBC.class.php
Smarty_Compiler.class.php
debug.tpl
.gitattributes
.gitignore
.travis.yml
BUGS
COMPOSER_RELEASE_NOTES.txt
COPYING.lib
ChangeLog
FAQ
INHERITANCE_RELEASE_NOTES.txt
INSTALL
NEWS
NEW_FEATURES.txt
QUICK_START
README
README.md
RELEASE_NOTES
SMARTY_2_BC_NOTES.txt
SMARTY_3.0_BC_NOTES.txt
SMARTY_3.1_NOTES.txt
TODO
change_log.txt
composer.json
smarty2
smarty_3
Smarty-2.6.28.zip
smarty-3.1.29.zip
overlib
progress
templates
templates_c
admin_bearbeiten.php
config.inc.php
detail_prof.php
detail_prof_pdf.php
erf_besausg.php
erf_besschnitt.php
erf_deltas.php
erf_grundgehalt.php
erf_lb_bz.php
erf_lb_einmal.php
erf_lb_fz.php
erf_lz.php
erf_vza.php
func_LB_BZ.php
func_LB_BZ_fiktiv.php
func_LB_FZ.php
func_LB_FZ_alt.php
func_LB_LZ.php
func_LB_einmal.php
func_LB_obergrenze.php
func_LB_obergrenze_Limit.php
func_LB_obergrenze_Limit_stufe1.php
func_LB_obergrenze_Limit_stufe2.php
func_agent.php
func_besschnitt.php
func_doz_nachbes.php
func_doz_synopse.php
func_genUser.php
func_gesamtberechnung.php
func_grundgehalt.php
func_rollenrechte.php
func_zusammenstellung.php
funktionen_bearbeiten.php
graph_einzeljahr.php
graph_jahre.php
hauptframe.php
index.php
indexframe.php
jahrgang.php
korr_verg.php
load.php
login_log.php
logout.php
lzb_excel.php
menuframe.php
parameter.php
pdf_jahr.php
prof_anlegen.php
prof_bearbeiten.php
prof_bearbeiten.php_20180314
prognose.sql
rollen.php
topframe.php
ubersicht_jahr.php
ubersicht_jahr.php_20180829
user_anlegen.php
user_bearbeiten.php
useronline.php
prognose_kehl/lib/smarty/libs/Autoloader.php
2023-01-30 08:01:11 +01:00

125 lines
3.7 KiB
PHP
Executable File

<?php
/**
* Smarty Autoloader
*
* @package Smarty
*/
/**
* Smarty Autoloader
*
* @package Smarty
* @author Uwe Tews
* Usage:
* require_once '...path/Autoloader.php';
* Smarty_Autoloader::register();
* $smarty = new Smarty();
* Note: This autoloader is not needed if you use Composer.
* Composer will automatically add the classes of the Smarty package to it common autoloader.
*/
class Smarty_Autoloader
{
/**
* Filepath to Smarty root
*
* @var string
*/
public static $SMARTY_DIR = '';
/**
* Filepath to Smarty internal plugins
*
* @var string
*/
public static $SMARTY_SYSPLUGINS_DIR = '';
/**
* Array with Smarty core classes and their filename
*
* @var array
*/
public static $rootClasses = array('smarty' => 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',);
/**
* Registers Smarty_Autoloader backward compatible to older installations.
*
* @param bool $prepend Whether to prepend the autoloader or not.
*/
public static function registerBC($prepend = false)
{
/**
* register the class autoloader
*/
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);
}
}
/**
* Registers Smarty_Autoloader as an SPL autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not.
*/
public static function register($prepend = false)
{
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'));
}
}
/**
* Handles auto loading of classes.
*
* @param string $class A class name.
*/
public static function autoload($class)
{
$_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;
}
}