Index: branches/5.2.x/core/kernel/application.php =================================================================== --- branches/5.2.x/core/kernel/application.php +++ branches/5.2.x/core/kernel/application.php @@ -2148,6 +2148,18 @@ } /** + * Finds the absolute path to the file where the class is defined. + * + * @param string $class The name of the class. + * + * @return string|false + */ + public function findClassFile($class) + { + return $this->Factory->findClassFile($class); + } + + /** * Add new scheduled task * * @param string $short_name name to be used to store last maintenance run info Index: branches/5.2.x/core/kernel/utility/factory.php =================================================================== --- branches/5.2.x/core/kernel/utility/factory.php +++ branches/5.2.x/core/kernel/utility/factory.php @@ -85,6 +85,24 @@ } /** + * Finds the absolute path to the file where the class is defined. + * + * @param string $class The name of the class. + * + * @return string|false + */ + public function findClassFile($class) + { + $file = $this->findFile($class); + + if ( $file ) { + return FULL_PATH . $file; + } + + return false; + } + + /** * Finds the path to the file where the class is defined. * * @param string $class The name of the class @@ -344,4 +362,4 @@ class kFactoryException extends Exception { -} \ No newline at end of file +} Index: branches/5.2.x/core/units/structure/structure_config.php =================================================================== --- branches/5.2.x/core/units/structure/structure_config.php +++ branches/5.2.x/core/units/structure/structure_config.php @@ -15,11 +15,11 @@ defined('FULL_PATH') or die('restricted access!'); $config = Array ( - 'Prefix' => 'st', - 'ItemClass' => Array('class'=>'CategoriesItem','file'=>'structure_item.php', 'build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'CategoriesEventHandler','file'=>'structure_eh.php', 'build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'CategoriesTagProcessor','file'=>'structure_tp.php', 'build_event'=>'OnBuild'), + 'Prefix' => 'st', + 'ItemClass' => array('class' => 'CategoriesItem', 'file' => '../categories/categories_item.php', 'build_event' => 'OnItemBuild'), + 'ListClass' => array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), + 'EventHandlerClass' => array('class' => 'CategoriesEventHandler', 'file' => '../categories/categories_event_handler.php', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => array('class' => 'CategoriesTagProcessor', 'file' => '../categories/categories_tag_processor.php', 'build_event' => 'OnBuild'), 'AutoLoad' => true, @@ -273,4 +273,4 @@ 'DefaultSorting1Dir' => 'Category_Sortorder', 'DefaultSorting2Dir' => 'Category_Sortorder2', ), - ); \ No newline at end of file + ); Index: branches/5.2.x/core/units/structure/structure_eh.php =================================================================== --- branches/5.2.x/core/units/structure/structure_eh.php +++ branches/5.2.x/core/units/structure/structure_eh.php @@ -1,15 +0,0 @@ -Init(); + +/** @var \Composer\Autoload\ClassLoader $composer_class_loader */ +$composer_class_loader = require FULL_PATH . '/vendor/autoload.php'; + +return function ($class) use ($application, $composer_class_loader) { + $file = $application->findClassFile($class); + + if ( $file !== false ) { + return $file; + } + + return $composer_class_loader->findFile($class); +};