Move Item and Conversation from Core to Object

- Move BaseObject from Core\ to Friendica\
This commit is contained in:
Hypolite Petovan 2017-11-19 16:50:49 -05:00
parent 1f38deb77b
commit f43aaf5227
5 changed files with 23 additions and 23 deletions

View file

@ -4,11 +4,11 @@
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\Conversation;
use Friendica\Core\Item;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Object\Conversation;
use Friendica\Object\Item;
require_once "include/bbcode.php";
require_once "include/acl_selectors.php";

View file

@ -9,7 +9,7 @@
*/
use Friendica\App;
use Friendica\Core\BaseObject;
use Friendica\BaseObject;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\Worker;

View file

@ -1,8 +1,8 @@
<?php
/**
* @file src/Core/BaseObject.php
* @file src/BaseObject.php
*/
namespace Friendica\Core;
namespace Friendica;
require_once 'boot.php';
@ -22,13 +22,13 @@ class BaseObject
*
* @return object
*/
public function getApp()
public static function getApp()
{
if (self::$app) {
return self::$app;
}
self::$app = boot::get_app();
self::$app = get_app();
return self::$app;
}

View file

@ -1,11 +1,11 @@
<?php
/**
* @file src/Core/Conversation.php
* @file src/Object/Conversation.php
*/
namespace Friendica\Core;
namespace Friendica\Object;
use Friendica\Core\BaseObject;
use Friendica\Core\Item;
use Friendica\BaseObject;
use Friendica\Object\Item;
require_once 'boot.php';
require_once 'include/text.php';
@ -48,7 +48,7 @@ class Conversation extends BaseObject
return;
}
$a = $this->getApp();
$a = self::getApp();
switch ($mode) {
case 'network':
@ -165,7 +165,7 @@ class Conversation extends BaseObject
*/
public function getTemplateData($conv_responses)
{
$a = get_app();
$a = self::getApp();
$result = array();
$i = 0;

View file

@ -1,14 +1,14 @@
<?php
/**
* @file src/Core/Item.php
* @file src/Object/Item.php
*/
namespace Friendica\Core;
namespace Friendica\Object;
use Friendica\Core\BaseObject;
use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
use Friendica\Object\Contact;
use dba;
require_once 'include/text.php';
@ -46,7 +46,7 @@ class Item extends BaseObject
*/
public function __construct($data)
{
$a = $this->getApp();
$a = self::getApp();
$this->data = $data;
$this->setTemplate('wall');
@ -109,7 +109,7 @@ class Item extends BaseObject
$result = array();
$a = $this->getApp();
$a = self::getApp();
$item = $this->getData();
$edited = false;
@ -186,7 +186,7 @@ class Item extends BaseObject
}
if (!isset($item['author-thumb']) || ($item['author-thumb'] == "")) {
$author_contact = get_contact_details_by_url($item['author-link'], $conv->getProfileOwner());
$author_contact = Contact::getDetailsByURL($item['author-link'], $conv->getProfileOwner());
if ($author_contact["thumb"]) {
$item['author-thumb'] = $author_contact["thumb"];
} else {
@ -195,7 +195,7 @@ class Item extends BaseObject
}
if (!isset($item['owner-thumb']) || ($item['owner-thumb'] == "")) {
$owner_contact = get_contact_details_by_url($item['owner-link'], $conv->getProfileOwner());
$owner_contact = Contact::getDetailsByURL($item['owner-link'], $conv->getProfileOwner());
if ($owner_contact["thumb"]) {
$item['owner-thumb'] = $owner_contact["thumb"];
} else {
@ -752,7 +752,7 @@ class Item extends BaseObject
*/
private function getCommentBox($indent)
{
$a = $this->getApp();
$a = self::getApp();
if (!$this->isToplevel() && !(Config::get('system', 'thread_allow') && $a->theme_thread_allow)) {
return '';
}
@ -828,7 +828,7 @@ class Item extends BaseObject
*/
protected function checkWallToWall()
{
$a = $this->getApp();
$a = self::getApp();
$conv = $this->getConversation();
$this->wall_to_wall = false;