/** * Include the class mapping and run the init script of the given package * @param string $package */ public static function boot($package) { $tmpPath = self::$tmp . str_replace(DIRECTORY_SEPARATOR, "_", realpath($package)); //load the class mapping try { include $tmpPath . ".classes.php"; } catch (FrameEx $ex) { self::rebuildDirectory($package . "/"); } //boot try { include_once realpath($package . DIRECTORY_SEPARATOR . "init.php"); } catch (FrameEx $ex) { $ex->setMessage("Unable to boot package: {$package}: " . $ex->getMessage()); throw $ex; } //load the class mapping try { include $tmpPath . ".request-map.php"; } catch (FrameEx $ex) { RequestMapGenerator::build($package); include $tmpPath . ".request-map.php"; } if (self::$autoloader) { self::$autoloader->addPath(realpath($package . DIRECTORY_SEPARATOR)); } self::$loadedPackages[] = $package; }