shopPath($cfg['Path']['admin'].$classPath); if (!file_exists($fullClassPath)) { // look to bundles admin $fullClassPath = loadBundlesAdmin($classPath); if (!file_exists($fullClassPath)) { // look to engine $fullClassPath = $cfg['Path']['shared_version'].'admin/'.$classPath; } } return $fullClassPath; } public function createClass($classPath, $className = null) { // Nech to tady, je to treba v includnutejch souborech global $cfg; $fqcn = include $classPath; if (is_string($fqcn)) { $instance = new $fqcn(); } elseif (!empty($main_class)) { $instance = new $main_class(); } elseif (!empty($className)) { $instance = new $className(); } else { throw new \InvalidArgumentException('Add missing return fqcn or define main_class in target file. Alternatively pass className parameter too: '.$classPath); } return $instance; } }