*/
use Friendica\App;
-use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Util\ExAuth;
require_once "include/dba.php";
$a = new App(dirname(__DIR__));
-BaseObject::setApp($a);
@include ".htconfig.php";
dba::connect($db_host, $db_user, $db_pass, $db_data);
$oAuth = new ExAuth();
-$oAuth->readStdin();
+$oAuth->readStdin();
\ No newline at end of file
*/
use Friendica\App;
-use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\Worker;
require_once "include/dba.php";
$a = new App(dirname(__DIR__));
-BaseObject::setApp($a);
require_once ".htconfig.php";
dba::connect($db_host, $db_user, $db_pass, $db_data);
require_once "include/dba.php";
$a = new App(dirname(__DIR__));
-BaseObject::setApp($a);
require_once ".htconfig.php";
dba::connect($db_host, $db_user, $db_pass, $db_data);
*/
function get_app()
{
- global $a;
-
- if (empty($a)) {
- $a = new App(dirname(__DIR__));
- BaseObject::setApp($a);
- }
-
- return $a;
+ return BaseObject::getApp();
}
/**
*/
use Friendica\App;
-use Friendica\BaseObject;
use Friendica\Content\Nav;
use Friendica\Core\Addon;
use Friendica\Core\Config;
require_once 'boot.php';
$a = new App(__DIR__);
-BaseObject::setApp($a);
// We assume that the index.php is called by a frontend process
// The value is set to "true" by default in boot.php
throw new Exception('Basepath ' . $basepath . ' isn\'t usable.');
}
+ BaseObject::setApp($this);
+
$this->basepath = rtrim($basepath, DIRECTORY_SEPARATOR);
$this->determineUrlPath();
*/
public static function getApp()
{
- if (self::$app) {
- return self::$app;
+ if (empty(self::$app)) {
+ self::$app = new App(dirname(__DIR__));
}
- self::$app = get_app();
-
return self::$app;
}
*
* @return void
*/
- public static function setApp($app)
+ public static function setApp(App $app)
{
self::$app = $app;
}