aboutsummaryrefslogtreecommitdiffstats
path: root/library/Smarty/libs/Autoloader.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-12-18 15:48:49 +0100
committerMario Vavti <mario@mariovavti.com>2017-12-18 15:48:49 +0100
commit439d41b194073285ab97be94253b3f4cb4395e43 (patch)
tree272d4c64ea2d766235ecb41009117b5269f8cdfd /library/Smarty/libs/Autoloader.php
parent08a8f195e749a120642f6c486c1dad62a73924d1 (diff)
downloadvolse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.gz
volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.tar.bz2
volse-hubzilla-439d41b194073285ab97be94253b3f4cb4395e43.zip
install smarty via composer and update other php libs
Diffstat (limited to 'library/Smarty/libs/Autoloader.php')
-rw-r--r--library/Smarty/libs/Autoloader.php124
1 files changed, 0 insertions, 124 deletions
diff --git a/library/Smarty/libs/Autoloader.php b/library/Smarty/libs/Autoloader.php
deleted file mode 100644
index 7d0c388a6..000000000
--- a/library/Smarty/libs/Autoloader.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?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;
- }
-}