Browse Source

BaseObject moved to src/Core

BaseObject moved to Friendica\Core namespace. References and function calls updated.
pull/3909/head
Adam Magness 4 years ago
parent
commit
ecd9e3e07e
  1. 13
      index.php
  2. 35
      object/BaseObject.php
  3. 15
      object/Conversation.php
  4. 12
      object/Item.php
  5. 12
      object/TemplateEngine.php
  6. 47
      src/Core/BaseObject.php

13
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);

35
object/BaseObject.php

@ -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;
}
}

15
object/Conversation.php

@ -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

12
object/Item.php

@ -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

12
object/TemplateEngine.php

@ -1,11 +1,15 @@
<?php
require_once 'boot.php';
/**
* @file object/TemplateEngine.php
*/
require_once 'boot.php';
/**
* Interface for template engines
*/
interface ITemplateEngine {
public function replace_macros($s,$v);
public function get_template_file($file, $root='');
interface ITemplateEngine
{
public function replace_macros($s, $v);
public function get_template_file($file, $root = '');
}

47
src/Core/BaseObject.php

@ -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;
}
}
Loading…
Cancel
Save