Пример #1
0
new Cody();
/**
 * Build a phar file of the project
 */
Ruth::addRoute(RUTH_GET, "/build", function () {
    //call Phoebe with the name of the phar file, by default phoebe will build the web_root folder
    new Phoebe(TINA4_SESSION);
});
/**
 * Include all the relevant paths
 */
Ruth::autoLoad($_TINA4_LOAD_PATHS . TINA4_INCLUDES, false);
if (strpos(Ruth::getREQUEST_URI(), "/cody") !== false) {
    Ruth::addRoute(RUTH_GET, "/cody", function () {
        echo (new Cody())->codeBuilder();
    });
    Ruth::addRoute(RUTH_POST, "/cody/{action}", function ($action) {
        echo (new Cody())->codeHandler($action);
    });
}
//We should check to see if we have a kim.db file to load routes from before parsing
if (file_exists("kim.db")) {
    (new Kim())->loadDefines();
    //these come from global settings
    (new Kim())->loadRoutes();
}
/**
 * Parse all the routes, never delete this code below, you can pass a single variable through to fake the route for testing.
 */
Ruth::parseRoutes();