X7ROOT File Manager
Current Path:
/home/cbholdings/pasukulu/lib/mustache/src/Mustache
home
/
cbholdings
/
pasukulu
/
lib
/
mustache
/
src
/
Mustache
/
📁
..
📄
Autoloader.php
(2.02 KB)
📁
Cache
📄
Cache.php
(930 B)
📄
Compiler.php
(22.98 KB)
📄
Context.php
(6.74 KB)
📄
Engine.php
(25.7 KB)
📁
Exception
📄
Exception.php
(338 B)
📄
HelperCollection.php
(3.66 KB)
📄
LambdaHelper.php
(1.96 KB)
📁
Loader
📄
Loader.php
(578 B)
📁
Logger
📄
Logger.php
(3.29 KB)
📄
Parser.php
(10.65 KB)
📁
Source
📄
Source.php
(1.03 KB)
📄
Template.php
(4.89 KB)
📄
Tokenizer.php
(12.28 KB)
Editing: Autoloader.php
<?php /* * This file is part of Mustache.php. * * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Mustache class autoloader. */ class Mustache_Autoloader { private $baseDir; /** * An array where the key is the baseDir and the key is an instance of this * class. * * @var array */ private static $instances; /** * Autoloader constructor. * * @param string $baseDir Mustache library base directory (default: dirname(__FILE__).'/..') */ public function __construct($baseDir = null) { if ($baseDir === null) { $baseDir = dirname(__FILE__) . '/..'; } // realpath doesn't always work, for example, with stream URIs $realDir = realpath($baseDir); if (is_dir($realDir)) { $this->baseDir = $realDir; } else { $this->baseDir = $baseDir; } } /** * Register a new instance as an SPL autoloader. * * @param string $baseDir Mustache library base directory (default: dirname(__FILE__).'/..') * * @return Mustache_Autoloader Registered Autoloader instance */ public static function register($baseDir = null) { $key = $baseDir ? $baseDir : 0; if (!isset(self::$instances[$key])) { self::$instances[$key] = new self($baseDir); } $loader = self::$instances[$key]; spl_autoload_register(array($loader, 'autoload')); return $loader; } /** * Autoload Mustache classes. * * @param string $class */ public function autoload($class) { if ($class[0] === '\\') { $class = substr($class, 1); } if (strpos($class, 'Mustache') !== 0) { return; } $file = sprintf('%s/%s.php', $this->baseDir, str_replace('_', '/', $class)); if (is_file($file)) { require $file; } } }
Upload File
Create Folder