aboutsummaryrefslogtreecommitdiffstats
path: root/include/BaseObject.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/BaseObject.php')
-rw-r--r--include/BaseObject.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/BaseObject.php b/include/BaseObject.php
new file mode 100644
index 000000000..14f0d8fd0
--- /dev/null
+++ b/include/BaseObject.php
@@ -0,0 +1,37 @@
+<?php
+if(class_exists('BaseObject'))
+ return;
+
+require_once('boot.php');
+
+/**
+ * Basic object
+ *
+ * Contains what is usefull to any object
+ */
+class BaseObject {
+ private static $app = null;
+
+ /**
+ * Get the app
+ *
+ * Same as get_app from boot.php
+ */
+ public function get_app() {
+ if(self::$app)
+ return self::$app;
+
+ global $a;
+ self::$app = $a;
+
+ return self::$app;
+ }
+
+ /**
+ * Set the app
+ */
+ public static function set_app($app) {
+ self::$app = $app;
+ }
+}
+?>