芝麻web文件管理V1.00
编辑当前文件:/home/asmplong/www/ancien-site-2019/site/libraries/loader.php
read())) { // Only load for php files. if (file_exists($parentPath.'/'.$entry) && (substr($entry, strrpos($entry, '.') + 1) == 'php')) { // Get the class name and full path for each file. $class = strtolower($classPrefix.preg_replace('#\.[^.]*$#', '', $entry)); $path = $parentPath.'/'.$entry; // Register the class with the autoloader if not already registered or the force flag is set. if (empty(self::$_classes[$class]) || $force) { JLoader::register($class, $path); } } } // Close the folder. $d->close(); } } /** * Method to get the list of registered classes and their respective file paths for the autoloader. * * @return array The array of class => path values for the autoloader. * * @since 11.1 */ public static function getClassList() { return self::$_classes; } /** * Directly register a class to the autoload list. * * @param string $class The class name to register. * @param string $path Full path to the file that holds the class to register. * @param bool $force True to overwrite the autoload path value for the class if it already exists. * * @return void * * @since 11.1 */ public static function register($class, $path, $force = true) { // Sanitize class name. $class = strtolower($class); // Only attempt to register the class if the name and file exist. if (!empty($class) && is_file($path)) { // Register the class with the autoloader if not already registered or the force flag is set. if (empty(self::$_classes[$class]) || $force) { self::$_classes[$class] = $path; } } } /** * Load the file for a class. * * @param string $class The class to be loaded. * * @return boolean True on success * * @since 11.1 */ public static function load($class) { // Sanitize class name. $class = strtolower($class); // If the class already exists do nothing. if (class_exists($class)) { return; } // If the class is registered include the file. if (isset(self::$_classes[$class])) { include_once self::$_classes[$class] ; return true; } return false; } } /** * Global application exit. * * This function provides a single exit point for the platform. * * @param mixed $message Exit code or string. Defaults to zero. * * @return void * * @since 11.1 */ function jexit($message = 0) { exit($message); } /** * Intelligent file importer. * * @param string $path A dot syntax path. * * @return boolean True on success. * * @since 11.1 */ function jimport($path) { return JLoader::import($path); }