]> git.mxchange.org Git - friendica.git/commitdiff
BaseObject moved to src/Core
authorAdam Magness <adam.magness@gmail.com>
Thu, 16 Nov 2017 18:05:41 +0000 (13:05 -0500)
committerAdam Magness <adam.magness@gmail.com>
Thu, 16 Nov 2017 18:05:41 +0000 (13:05 -0500)
BaseObject moved to Friendica\Core namespace. References and function calls updated.

index.php
object/BaseObject.php [deleted file]
object/Conversation.php
object/Item.php
object/TemplateEngine.php
src/Core/BaseObject.php [new file with mode: 0644]

index 5915498904d477720ee2313cee02674470b30dea..c31b1adc0fd4ca75ce5f9382f6d8d20068bb6a3d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,26 +1,21 @@
 <?php
-
-
 /**
- *
+ * @file index.php
  * Friendica
- *
  */
 
 /**
- *
- * bootstrap the application
- *
+ * Bootstrap the application
  */
 
 use Friendica\App;
+use Friendica\Core\BaseObject;
 use Friendica\Core\System;
 use Friendica\Core\Config;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
 
 require_once 'boot.php';
-require_once 'object/BaseObject.php';
 
 if (empty($a)) {
        $a = new App(__DIR__);
@@ -32,11 +27,9 @@ BaseObject::set_app($a);
 $a->backend = false;
 
 /**
- *
  * Load the configuration file which contains our DB credentials.
  * Ignore errors. If the file doesn't exist or is empty, we are running in
  * installation mode.
- *
  */
 
 $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true);
diff --git a/object/BaseObject.php b/object/BaseObject.php
deleted file mode 100644 (file)
index 15c7d8d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?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;
-
-               self::$app = get_app();
-
-               return self::$app;
-       }
-
-       /**
-        * Set the app
-        */
-       public static function set_app($app) {
-               self::$app = $app;
-       }
-}
index f03b3b1c1bc00cfbada58c7f0a93495d3394bd78..3b3560f1406ac71f665b019cc05dfc4c11d7c330 100644 (file)
@@ -1,11 +1,16 @@
 <?php
-if(class_exists('Conversation'))
+/**
+ * @file object/Conversation.php
+ */
+if (class_exists('Conversation')) {
        return;
+}
+
+use Friendica\Core\BaseObject;
 
-require_once('boot.php');
-require_once('object/BaseObject.php');
-require_once('object/Item.php');
-require_once('include/text.php');
+require_once 'boot.php';
+require_once 'object/Item.php';
+require_once 'include/text.php';
 
 /**
  * A list of threads
index 80bbf255dd8eae6a7b43efc95775ea13e359941d..0dab971d1bcd3eda485571034b6c2479fc9deaa6 100644 (file)
@@ -1,15 +1,19 @@
 <?php
-if(class_exists('Item'))
+/**
+ * @file object/Item.php
+ */
+if (class_exists('Item')) {
        return;
+}
 
+use Friendica\Core\BaseObject;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Database\DBM;
 use Friendica\Protocol\Diaspora;
 
-require_once('object/BaseObject.php');
-require_once('include/text.php');
-require_once('boot.php');
+require_once 'include/text.php';
+require_once 'boot.php';
 
 /**
  * An item
index cbd74aaec9312d029aa9f2008f926f4b2e97fb25..61ccb01dcf8340e9765a05d6ae00bde3265de29b 100644 (file)
@@ -1,11 +1,15 @@
 <?php\r
-require_once 'boot.php';\r
+/**\r
+ * @file object/TemplateEngine.php\r
+ */\r
 \r
+require_once 'boot.php';\r
 \r
 /**\r
  * Interface for template engines\r
  */\r
-interface ITemplateEngine {\r
-       public function replace_macros($s,$v);\r
-       public function get_template_file($file, $root='');\r
+interface ITemplateEngine\r
+{\r
+       public function replace_macros($s, $v);\r
+       public function get_template_file($file, $root = '');\r
 }\r
diff --git a/src/Core/BaseObject.php b/src/Core/BaseObject.php
new file mode 100644 (file)
index 0000000..6037f59
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * @file src/Core/BaseObject.php
+ */
+namespace Friendica\Core;
+
+if (class_exists('BaseObject')) {
+       return;
+}
+
+require_once 'boot.php';
+
+/**
+ * Basic object
+ *
+ * Contains what is useful 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;
+               }
+
+               self::$app = boot::get_app();
+
+               return self::$app;
+       }
+
+       /**
+        * Set the app
+        *
+        * @param object $app App
+        */
+       public static function set_app($app)
+       {
+               self::$app = $app;
+       }
+}