Add use Friendica\App to addons #412

Closed
MrPetovan wants to merge 3 commits from improvement/move-app-to-src into master
MrPetovan commented 2017-05-01 01:42:20 +02:00 (Migrated from github.com)

Paired with https://github.com/friendica/friendica/pull/3413, this PR has to be merged on the 3.5.2 release day.

Paired with https://github.com/friendica/friendica/pull/3413, this PR has to be merged on the 3.5.2 release day.
annando commented 2017-05-01 09:35:25 +02:00 (Migrated from github.com)

Hmm ... this is a problem for all users on the develop branch. Can this code line be wrapped in an "if" that checks for the version?

Hmm ... this is a problem for all users on the develop branch. Can this code line be wrapped in an "if" that checks for the version?
MrPetovan commented 2017-05-01 14:14:10 +02:00 (Migrated from github.com)

No, and even if it was possible, the App class wouldn't be available because it's not included by default anymore.

We probably need a develop branch for addons as well then.

No, and even if it was possible, the `App` class wouldn't be available because it's not included by default anymore. We probably need a develop branch for addons as well then.
annando commented 2017-05-01 16:33:08 +02:00 (Migrated from github.com)

I guess there is a simple solution that will work with both branches: We don't change anything.

I guess the problem exists only when the line $a = new App; is executed in these two files, am I right?

This line may be executed on a master branch - but never on the develop branch.

On the develop branch we already removed the old background execution.

Normally you will not find these lines on a background script in the develop branch anymore:

        if (is_null($a)) {
                $a = new App;
        }

        if (is_null($db)) {
                @include(".htconfig.php");
                require_once("include/dba.php");
                $db = new dba($db_host, $db_user, $db_pass, $db_data);
                unset($db_host, $db_user, $db_pass, $db_data);
        };
I guess there is a simple solution that will work with both branches: We don't change anything. I guess the problem exists only when the line ```$a = new App;``` is executed in these two files, am I right? This line may be executed on a master branch - but **never** on the develop branch. On the develop branch we already removed the old background execution. Normally you will not find these lines on a background script in the develop branch anymore: ``` if (is_null($a)) { $a = new App; } if (is_null($db)) { @include(".htconfig.php"); require_once("include/dba.php"); $db = new dba($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data); }; ```
MrPetovan commented 2017-05-01 16:54:05 +02:00 (Migrated from github.com)

I trust you with this, we can always reopen this if somebody complains about pump.io or Twitter.

I trust you with this, we can always reopen this if somebody complains about pump.io or Twitter.

Pull request closed

Sign in to join this conversation.
No description provided.