ÌìÃÀ´«Ã½
← Back
Editing: autoloader.php
<?php /** * ====================================================================== * LICENSE: This file is subject to the terms and conditions defined in * * file 'license.txt', which is part of this source code package. * * ====================================================================== */ namespace AAM\AddOn\CompletePackage; /** * Project auto-loader * * @package AAM */ class Autoloader { /** * Auto-loader * * @param string $class_name * * @return void * * @access public */ public static function load($class_name) { if (strpos($class_name, 'AAM\AddOn\CompletePackage') === 0) { $file_path = str_replace( [ 'AAM\AddOn\CompletePackage\\', '\\' ], [ '', '/' ], $class_name ); $base_path = __DIR__ . '/application'; $filename = $base_path . '/' . $file_path . '.php'; if (file_exists($filename)) { require($filename); } } } /** * Register auto-loader * * @return void * * @access public */ public static function register() { spl_autoload_register(__NAMESPACE__ . '\Autoloader::load'); } } if (defined('AAM_COMPLETE_PACKAGE')) { Autoloader::register(); }
Save File
Cancel