Ver código fonte

BaseObject moved to src/Core

BaseObject moved to Friendica\Core namespace. References and function calls updated.
tags/3.6
Adam Magness 2 anos atrás
pai
commit
ecd9e3e07e
6 arquivos alterados com 76 adições e 58 exclusões
  1. +3
    -10
      index.php
  2. +0
    -35
      object/BaseObject.php
  3. +10
    -5
      object/Conversation.php
  4. +8
    -4
      object/Item.php
  5. +8
    -4
      object/TemplateEngine.php
  6. +47
    -0
      src/Core/BaseObject.php

+ 3
- 10
index.php Ver arquivo

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


+ 0
- 35
object/BaseObject.php Ver arquivo

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

+ 10
- 5
object/Conversation.php Ver arquivo

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


+ 8
- 4
object/Item.php Ver arquivo

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


+ 8
- 4
object/TemplateEngine.php Ver arquivo

@@ -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
- 0
src/Core/BaseObject.php Ver arquivo

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

Carregando…
Cancelar
Salvar