aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/main.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2011-08-18 01:23:51 +0200
committerKevin Chabowski <kevin@kch42.de>2011-08-18 01:23:51 +0200
commit27db8a06b3228e900f1987d54c18bb1e64e14e8a (patch)
tree301f29b94c989d1560840800c6823964f096e545 /ratatoeskr/main.php
parent35e5be8ac9aaa7a409c7f70b1b882b809c0bb2e1 (diff)
downloadratatoeskr-cms-27db8a06b3228e900f1987d54c18bb1e64e14e8a.tar.gz
ratatoeskr-cms-27db8a06b3228e900f1987d54c18bb1e64e14e8a.tar.bz2
ratatoeskr-cms-27db8a06b3228e900f1987d54c18bb1e64e14e8a.zip
Started main.php that later will bootstrap Ratatöskr.
Diffstat (limited to 'ratatoeskr/main.php')
-rw-r--r--ratatoeskr/main.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/ratatoeskr/main.php b/ratatoeskr/main.php
new file mode 100644
index 0000000..93cefe5
--- /dev/null
+++ b/ratatoeskr/main.php
@@ -0,0 +1,43 @@
+<?php
+/*
+ * File: main.php
+ * Initialize and launch Ratatöskr
+ *
+ * This file is part of Ratatöskr.
+ * Ratatöskr is licensed unter the MIT / X11 License.
+ * See "ratatoeskr/licenses/ratatoeskr" for more information.
+ */
+
+require_once(dirname(__FILE__) . "/sys/db.php");
+require_once(dirname(__FILE__) . "/sys/plugin_api.php");
+require_once(dirname(__FILE__) . "/sys/models.php");
+require_once(dirname(__FILE__) . "/sys/urlprocess.php");
+require_once(dirname(__FILE__) . "/frontend.php");
+require_once(dirname(__FILE__) . "/backend.php");
+
+function ratatoeskr()
+{
+ global $backend_subactions;
+
+ if(!CONFIG_FILLED_OUT)
+ return setup();
+
+ db_connect();
+
+ $activeplugins = array_filter(PluginDB::all(), function($plugin) { return $plugin->active; });
+ $plugin_objs = array();
+ foreach($activeplugins as $plugin)
+ {
+ eval($plugin->phpcode);
+ $plugin_obj = new $plugin->class;
+ $plugin_obj->init();
+ $plugin_objs[] = $plugin_obj;
+ }
+
+ /* Register URL handlers */
+ register_url_handler("_default", "frontend_url_handler");
+ register_url_handler("backend", $backend_subactions);
+ register_url_handler("_notfound", "e404handler");
+}
+
+?>