Compare commits

...

1344 commits

Author SHA1 Message Date
Philipp
e3a00dfa8d
Merge pull request #14913 from Art4/rework-addon-class
Some checks failed
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Has been cancelled
Code Quality / PHPStan (PHP 8.4) (push) Has been cancelled
Code Quality / PHPStan in addons (PHP 8.4) (push) Has been cancelled
Code Quality / PHPMD (PHP 8.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 7.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.0) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.1) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.2) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.3) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.5) (push) Has been cancelled
CI tests / Database-Tests (PHP 7.4) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.0) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.1) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.2) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.3) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.4) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.5) (push) Has been cancelled
Deprecate `Friendica\Core\Addon` class
2025-06-06 08:20:32 +02:00
Art4
8083fb6f8e recreate lang 2025-06-04 10:40:04 +00:00
Art4
bec89a822a Remove debug statement 2025-06-04 09:27:29 +00:00
Art4
f1143105d2 Let AddonHelper::getAddonInfo() throw exception on invalid addons 2025-06-04 09:26:38 +00:00
Art4
ab3e54f0e1 check type for matches 2025-06-04 06:51:35 +00:00
Art4
1723417f43 Merge branch 'develop' into rework-addon-class 2025-06-04 06:27:08 +00:00
Michael Vogel
fce04bfa5c
Merge pull request #14955 from mf-fx/new_contact_placeholder_text
Some checks failed
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Has been cancelled
Code Quality / PHPStan (PHP 8.4) (push) Has been cancelled
Code Quality / PHPStan in addons (PHP 8.4) (push) Has been cancelled
Code Quality / PHPMD (PHP 8.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.2) (push) Has been cancelled
CI tests / Unit-Tests (PHP 7.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.0) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.1) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.3) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.5) (push) Has been cancelled
CI tests / Database-Tests (PHP 7.4) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.0) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.1) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.2) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.3) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.4) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.5) (push) Has been cancelled
Shorten placeholder text for adding a new contact
2025-06-03 20:51:53 +02:00
Marcus Funch
02f6bb1256 Shorten placeholder text for adding a new contact
...so it actually fits the size of the search box
2025-06-03 20:17:48 +02:00
Michael Vogel
2e9e5715cc
Merge pull request #14953 from mf-fx/main_menu_user_vertical_alignment
Some checks are pending
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Waiting to run
Code Quality / PHPStan (PHP 8.4) (push) Waiting to run
Code Quality / PHPStan in addons (PHP 8.4) (push) Waiting to run
Code Quality / PHPMD (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 7.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.0) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.1) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.2) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.3) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.5) (push) Waiting to run
CI tests / Database-Tests (PHP 7.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.0) (push) Waiting to run
CI tests / Database-Tests (PHP 8.1) (push) Waiting to run
CI tests / Database-Tests (PHP 8.2) (push) Waiting to run
CI tests / Database-Tests (PHP 8.3) (push) Waiting to run
CI tests / Database-Tests (PHP 8.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.5) (push) Waiting to run
Frio (Bookface): Fix vertical alignment in the main menu (user menu)
2025-06-03 10:07:01 +02:00
Michael Vogel
f6333d38e1
Merge pull request #14963 from mf-fx/replace_no_messages_notification_by_text
Some checks are pending
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Waiting to run
Code Quality / PHPStan (PHP 8.4) (push) Waiting to run
Code Quality / PHPStan in addons (PHP 8.4) (push) Waiting to run
Code Quality / PHPMD (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 7.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.0) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.1) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.2) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.3) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.5) (push) Waiting to run
CI tests / Database-Tests (PHP 7.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.0) (push) Waiting to run
CI tests / Database-Tests (PHP 8.1) (push) Waiting to run
CI tests / Database-Tests (PHP 8.2) (push) Waiting to run
CI tests / Database-Tests (PHP 8.3) (push) Waiting to run
CI tests / Database-Tests (PHP 8.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.5) (push) Waiting to run
Replace fleeting 'No messages' notification with regular text
2025-06-03 05:45:15 +02:00
Marcus Funch
69dd232ee8 Make PHPCS happy 2025-06-02 21:35:32 +02:00
Marcus Funch
3e8080d67d Replace fleeting 'No messages' notification with regular text 2025-06-02 19:23:07 +02:00
Michael Vogel
f32cb5c0dc
Merge pull request #14956 from mf-fx/page_specific_title_before_sitename
Some checks failed
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Has been cancelled
Code Quality / PHPStan (PHP 8.4) (push) Has been cancelled
Code Quality / PHPStan in addons (PHP 8.4) (push) Has been cancelled
Code Quality / PHPMD (PHP 8.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 7.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.0) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.1) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.2) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.3) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.5) (push) Has been cancelled
CI tests / Database-Tests (PHP 7.4) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.0) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.1) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.2) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.3) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.4) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.5) (push) Has been cancelled
Show page-specific title before site name
2025-06-01 12:48:22 +02:00
Michael Vogel
dfe86ee677
Merge pull request #14954 from mf-fx/search_button_alignment
Frio: Fix vertical alignment of overlayed submit buttons
2025-06-01 12:41:27 +02:00
Philipp
3e3f49219d
Merge pull request #14945 from annando/jetstream
Some checks are pending
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Waiting to run
Code Quality / PHPStan (PHP 8.4) (push) Waiting to run
Code Quality / PHPStan in addons (PHP 8.4) (push) Waiting to run
Code Quality / PHPMD (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 7.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.0) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.1) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.2) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.3) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.5) (push) Waiting to run
CI tests / Database-Tests (PHP 7.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.0) (push) Waiting to run
CI tests / Database-Tests (PHP 8.1) (push) Waiting to run
CI tests / Database-Tests (PHP 8.2) (push) Waiting to run
CI tests / Database-Tests (PHP 8.3) (push) Waiting to run
CI tests / Database-Tests (PHP 8.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.5) (push) Waiting to run
Avoid warnings in the Jetstream process
2025-06-01 11:17:51 +02:00
Michael
497798b455 Warning handler removed 2025-06-01 04:27:52 +00:00
Marcus Funch
441584b0d1 Show page-specific title before site name 2025-05-31 21:01:15 +02:00
Marcus Funch
130ae2d773 Fix vertical alignment of search button 2025-05-31 19:29:25 +02:00
Marcus Funch
9a1470d2a4 Frio bookface: Fix vertical alignment in the main menu (user menu) 2025-05-31 18:37:09 +02:00
Michael
3883bdf96f Updated PHP package 2025-05-30 05:55:18 +00:00
Philipp
544b926c9e
Merge pull request #14946 from haheute/youtube-links-mobile
Some checks failed
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Has been cancelled
Code Quality / PHPStan (PHP 8.4) (push) Has been cancelled
Code Quality / PHPStan in addons (PHP 8.4) (push) Has been cancelled
Code Quality / PHPMD (PHP 8.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 7.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.0) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.1) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.2) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.3) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.4) (push) Has been cancelled
CI tests / Unit-Tests (PHP 8.5) (push) Has been cancelled
CI tests / Database-Tests (PHP 7.4) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.0) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.1) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.2) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.3) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.4) (push) Has been cancelled
CI tests / Database-Tests (PHP 8.5) (push) Has been cancelled
Support YouTube mobile links
2025-05-29 20:54:16 +02:00
Hannes Heute
3c4ae5a124 fix tests.. again 2025-05-29 20:48:22 +02:00
Philipp
167ac1ec0f
Merge pull request #14908 from randompenguin1/develop
Some checks are pending
Code Quality / PHP-CS-Fixer (PHP 8.3) (push) Waiting to run
Code Quality / PHPStan (PHP 8.4) (push) Waiting to run
Code Quality / PHPStan in addons (PHP 8.4) (push) Waiting to run
Code Quality / PHPMD (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 7.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.0) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.1) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.2) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.3) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.4) (push) Waiting to run
CI tests / Unit-Tests (PHP 8.5) (push) Waiting to run
CI tests / Database-Tests (PHP 7.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.0) (push) Waiting to run
CI tests / Database-Tests (PHP 8.1) (push) Waiting to run
CI tests / Database-Tests (PHP 8.2) (push) Waiting to run
CI tests / Database-Tests (PHP 8.3) (push) Waiting to run
CI tests / Database-Tests (PHP 8.4) (push) Waiting to run
CI tests / Database-Tests (PHP 8.5) (push) Waiting to run
Strip HTML tags from content sent as Markdown
2025-05-29 19:27:51 +02:00
Philipp
c1620f9a62
Merge pull request #14941 from cluster15/develop
Added casts to binary for regexp comparison in mysql to solve issue #14914
2025-05-29 19:17:37 +02:00
Philipp
f2ee3602ac
Fix PHP-CS 2025-05-29 19:14:43 +02:00
Philipp
7ca99aa194
Merge remote-tracking branch 'origin/develop' into develop.randompenguin1 2025-05-29 19:11:42 +02:00
Philipp
3bd6335fa6
Add test 2025-05-29 19:11:24 +02:00
Philipp
3def76649b
Fix PHP-CS 2025-05-29 19:06:13 +02:00
Michael
2e701df21a Avoid warnings in the Jetstream process 2025-05-29 04:35:31 +00:00
Hannes Heute
1e818053f6 fix test 2025-05-28 20:53:39 +02:00
Hannes Heute
8be3c2bc99 Support YouTube mobile links 2025-05-28 20:31:36 +02:00
Philipp
dc0dee77d0
Merge pull request #14940 from haheute/support-youtube-without-www
Support YouTube links without www
2025-05-25 22:28:43 +02:00
Philipp
5c6b7d9293
Fix PHP-CS 2025-05-25 22:22:53 +02:00
Philipp
592eede9cd
Merge pull request #14887 from mf-fx/fix_typo
Fix typos
2025-05-25 19:35:20 +02:00
Philipp
69ee39b725
Add tests 2025-05-25 19:17:17 +02:00
Philipp
415e7b5f8b
Merge pull request #14942 from annando/clean-input
Clean input values
2025-05-25 10:10:59 +02:00
Philipp
5e1755dc8f
Merge pull request #14943 from annando/warnings
Fix some warnings
2025-05-25 09:56:46 +02:00
Michael
2335af9bf2 Fix some warnings 2025-05-24 19:13:18 +00:00
Michael
0db3d4a70f Clean input values 2025-05-24 19:08:35 +00:00
cluster15
6e84c0ade7 Added casts to binary for regexp comparison in mysql. mysql rejects comparison of UTF with binary strings.
see https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-22.html#mysqld-8-0-22-feature
The SQL statements also work for mariadb.
2025-05-23 09:56:28 +02:00
Hannes Heute
423ab06010 escape the dots 2025-05-22 02:10:10 +02:00
Hannes Heute
978dda0b4e same order (watch, embed, shorts) 2025-05-20 22:54:00 +02:00
Hannes Heute
70e57b54c3 Support YouTube links without www. 2025-05-20 22:16:18 +02:00
Art4
da413283da Remove function call of global namespace 2025-05-20 12:06:01 +00:00
Philipp
8e0a3d00bb
Merge pull request #14892 from annando/reshare-profile
Use alias for profile link in reshare
2025-05-18 16:07:22 +02:00
Michael
35ae7278f7 Added test 2025-05-18 13:35:25 +00:00
Michael
3af5caa950 Use alias for profile link in reshare 2025-05-18 10:53:14 +00:00
Marcus Funch
78d28ae24b Add translations for fixed typos in Conversation.php, Create.php, Channels.php 2025-05-17 22:03:09 +02:00
Michael Vogel
f49172e9c0
Merge pull request #14927 from nupplaphil/dependabot/composer/guzzlehttp/oauth-subscriber-0.8.1
Bump guzzlehttp/oauth-subscriber from 0.6.0 to 0.8.1
2025-05-17 17:45:27 +02:00
Michael Vogel
6cad772abd
Merge pull request #14928 from nupplaphil/dependabot/composer/smarty/smarty-4.5.3
Bump smarty/smarty from 4.5.1 to 4.5.3
2025-05-17 17:44:24 +02:00
Michael Vogel
777fc8615c
Merge pull request #14926 from nupplaphil/fix/item_html_empy
Fix empty HTML content loading (500)
2025-05-17 17:39:46 +02:00
Art4
0078423b48 Ignore hidden addon folders 2025-05-16 08:46:16 +00:00
Art4
638496e553 Hard deprecate Friendica\Core\Addon class 2025-05-15 07:34:17 +00:00
Art4
7b7d542c8f Remove unused AddonProxy class 2025-05-15 07:33:50 +00:00
Art4
6b71010de6 Remove debug line from #14931 2025-05-15 07:23:37 +00:00
Art4
7f55714296 Replace AddonProxy with AddonManagerHelper 2025-05-15 07:18:34 +00:00
Art4
44c8cd118c Fix code style 2025-05-15 07:15:23 +00:00
Art4
075e9eaaa9 Replace test addon with vfs files 2025-05-15 07:14:11 +00:00
Art4
367f7bd377 Remove unused AddonProxy 2025-05-15 07:00:36 +00:00
Art4
5cf2b7d7bd Implement reloadAddons() 2025-05-15 06:59:37 +00:00
Philipp
0165e22064
Merge pull request #14933 from haheute/fix-photo-tag-remove-redirect
Fix redirect for photo remove tag page and only show the link if tags…
2025-05-14 20:16:44 +02:00
Hannes Heute
58ac3fbb29 Fix redirect for photo remove tag page and only show the link if tags exist. 2025-05-14 18:47:15 +02:00
Art4
33398298d5 Implement uninstallAddon 2025-05-14 14:54:14 +00:00
Art4
a39850871e Implement installAddon 2025-05-14 11:37:47 +00:00
Art4
88dcd755a9 Replace glob() with stream safe alternative scandir() 2025-05-14 09:52:33 +00:00
Art4
5f7de9d028 remove name parameter 2025-05-14 08:20:49 +00:00
Art4
08b60c2558 Merge branch 'develop' into rework-addon-class 2025-05-14 07:53:31 +00:00
Art4
8b40d65e6c Implement getAvailableAddons 2025-05-14 07:52:53 +00:00
Philipp
2475095da0
Merge pull request #14931 from Art4/remove-dependency-from-addon-class
Move contact fetching into module
2025-05-14 09:01:50 +02:00
Philipp
292b55ede6
Merge pull request #14932 from Art4/fix-14930
Add missing EventDispatcher dependency in Profile module
2025-05-13 20:03:10 +02:00
Art4
0599801b37 implement getVisibleEnablesAddons and getEnabledAddonsWithAdminSettings 2025-05-13 14:16:10 +00:00
Art4
93a171765a Implement loading addons in AddonManagerHelper 2025-05-13 14:04:57 +00:00
Art4
20d9855101 Add EventDispatcher dependency in Profile Module 2025-05-13 12:01:51 +00:00
Art4
f97b01a69a move contact fetching into admin module 2025-05-13 11:26:05 +00:00
Art4
e2a2cf5d6e Create AddonManagerHelper 2025-05-13 10:48:41 +00:00
Art4
6a058793f0 Fix warning if author or maintainer is missing in addon info 2025-05-13 08:14:09 +00:00
Art4
d88119139f Merge branch 'develop' into rework-addon-class 2025-05-13 07:06:09 +00:00
Philipp
3481c3ad15
Merge pull request #14853 from Art4/eventdispatcher-part3
Replace Hooks with EventDispatcher Part 3
2025-05-13 08:32:27 +02:00
Art4
02fae146e6 Fix code style 2025-05-13 06:18:41 +00:00
Art4
b2bbcc4965 Fix PHPStan errors 2025-05-13 06:12:16 +00:00
Art4
ea172010f8 Merge branch 'develop' into eventdispatcher-part3 2025-05-12 14:32:53 +00:00
Philipp
054a280d33
Fix PHP-CS 2025-05-11 11:37:09 +02:00
Philipp
3a257b6172
Fix 500 error 2025-05-11 11:23:25 +02:00
dependabot[bot]
09668d5e56
Bump smarty/smarty from 4.5.1 to 4.5.3
Bumps [smarty/smarty](https://github.com/smarty-php/smarty) from 4.5.1 to 4.5.3.
- [Release notes](https://github.com/smarty-php/smarty/releases)
- [Changelog](https://github.com/smarty-php/smarty/blob/v4.5.3/CHANGELOG.md)
- [Commits](https://github.com/smarty-php/smarty/compare/v4.5.1...v4.5.3)

---
updated-dependencies:
- dependency-name: smarty/smarty
  dependency-version: 4.5.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-11 09:21:51 +00:00
dependabot[bot]
2fd374caeb
Bump guzzlehttp/oauth-subscriber from 0.6.0 to 0.8.1
Bumps [guzzlehttp/oauth-subscriber](https://github.com/guzzle/oauth-subscriber) from 0.6.0 to 0.8.1.
- [Release notes](https://github.com/guzzle/oauth-subscriber/releases)
- [Changelog](https://github.com/guzzle/oauth-subscriber/blob/0.8/CHANGELOG.md)
- [Commits](https://github.com/guzzle/oauth-subscriber/compare/0.6.0...0.8.1)

---
updated-dependencies:
- dependency-name: guzzlehttp/oauth-subscriber
  dependency-version: 0.8.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-11 09:21:48 +00:00
Philipp
a4d4e199c1
Merge pull request #14830 from Art4/phpstan-level-3
Phpstan level 3
2025-05-11 01:22:11 +02:00
Art4
dfa1f52ad6 Merge branch 'develop' into eventdispatcher-part3 2025-05-09 06:56:17 +00:00
Art4
19d7d2f345 Merge branch 'develop' into rework-addon-class 2025-05-09 06:50:55 +00:00
Art4
ed5de437be Fix PHPStan errors 2025-05-09 06:40:49 +00:00
Art4
63558f92eb Merge branch 'develop' into phpstan-level-3 2025-05-09 06:29:29 +00:00
Michael Vogel
4d879781c2
Merge pull request #14904 from nupplaphil/feat/stats_caching
Add Caching statistics
2025-05-04 07:41:45 +05:30
Philipp
b38c754446
Merge pull request #14891 from annando/issue-14890
Issue 14890: Translate page titles
2025-05-03 21:57:55 +02:00
Philipp
2b00d1b2d0
Merge pull request #14871 from MrPetovan/task/obsolete-urlpath
Remove remaining references of unused urlpath config key
2025-05-03 21:56:17 +02:00
Philipp
db1f7164b8
Merge remote-tracking branch 'origin/develop' into issue-14890 2025-05-03 21:51:48 +02:00
Philipp
b782ff6e22
Merge remote-tracking branch 'origin/develop' into task/obsolete-urlpath 2025-05-03 21:48:32 +02:00
Philipp
0f7c739470
Update BaseURL.php
Fix PHP-CS
2025-05-03 21:39:58 +02:00
Philipp
024b136cdd
Merge pull request #14915 from haheute/calendar-default-view-mode
Make the calendar use the default view mode
2025-05-03 21:34:29 +02:00
Philipp
38e89b152c
Merge pull request #14909 from Art4/replace-addon-class-with-addonhelper
Replace Addon class with AddonHelper
2025-05-03 21:18:31 +02:00
Philipp
351bc94d06
Merge pull request #14889 from annando/contact-refresh
Bluesky: Update actors regularly
2025-05-03 21:16:09 +02:00
Hannes Heute
581dec10eb indentation 2025-05-02 01:36:37 +02:00
Hannes Heute
a784428f85 make calendar use the default view mode 2025-05-01 22:40:16 +02:00
Philipp
d1b8f31fe8
Merge pull request #14888 from mf-fx/trending_tags_missing_translations
Add missing translations to trending tags
2025-05-01 09:30:58 +02:00
Marcus Funch
42b411788a Add missing translations to trending tags 2025-04-30 20:28:29 +02:00
Art4
4b9a674659 Implement parsing of addon files to AddonInfo 2025-04-29 13:59:58 +00:00
Art4
baaec75bfc fix code style 2025-04-28 14:12:27 +00:00
Art4
362b223c5e Replace Addon class with AddonHelper in vier theme 2025-04-28 14:10:32 +00:00
Art4
f5eee2c334 Replace Addon class with AddonHelper in Post Object 2025-04-28 14:07:20 +00:00
Art4
2ccb62bbd8 Replace Addon class with AddonHelper in Nodeinfo Model 2025-04-28 13:57:21 +00:00
Art4
2e50e93872 Replace Addon class with AddonHelper in stats modules 2025-04-28 13:32:18 +00:00
Art4
d6b072477d Merge branch 'develop' into phpstan-level-3 2025-04-28 11:44:30 +00:00
Art4
ec16994738 Merge branch 'develop' into eventdispatcher-part3 2025-04-28 11:02:09 +00:00
Philipp
c6c6640b81
Fixup woodpecker 2025-04-27 23:20:08 +02:00
Philipp
7b39b3b9c0
Mak PHPCS happy 2025-04-27 21:26:52 +02:00
Philipp
03cfa2d066
Add doc 2025-04-27 21:26:50 +02:00
Philipp
c92d239091
fix test 2025-04-27 21:26:49 +02:00
Philipp
b222aa0c48
Add a bunch of tests for StatsCaching 2025-04-27 21:26:48 +02:00
Philipp
892fa595da
Make PHPCS happy - again 2025-04-27 21:26:47 +02:00
Philipp
5969576585
Add missing license 2025-04-27 21:26:45 +02:00
Philipp
50c720688b
Make PHPCS happy 2025-04-27 21:26:44 +02:00
Philipp
a20828f618
Add Caching stats 2025-04-27 21:26:43 +02:00
Philipp
01296e98f9
Add getStats() method for MemoryCaches 2025-04-27 21:26:28 +02:00
Philipp
ffb621f0e4
Merge pull request #14882 from Art4/refractor-logger-factories
Rework logger factories
2025-04-27 02:15:48 +02:00
Random Penguin
403b0672e6
Strip HTML tags from content sent as Markdown
The "toMarkdown" function prepares content to be sent, primarily, to Diaspora.

The HTML to Markdown converter by default "preserves HTML tags without Markdown equivalents like <span> and <div>." At least according to the README in /friendica/vendor/league/html-to-markdown/ - which also says "To strip HTML tags that don’t have a Markdown equivalent while preserving the content inside them, set strip_tags..."

Diaspora, however, does not appear to know what to DO with the HTML sent to it. It actually appears to encode the HTML and displays the code in the post body rather than rendering it as HTML. In which case it would make more sense to strip out all tags that have no Markdown equivalents.
Example
The post as sent from Friendica mixed BBcode and Markdown:
[class=postbox-ocean]Norddeutscher Bürger ![Noddeutscher Bürger - Bismark Brötchen (Roger Cziwerny - pixapay)](/rscamo/……)[/class]
The BBcode gets converted into an HTML <span> tag. 

It also looks like Diaspora encoded the Markdown for the image rather than parsing it, or at the very least didn't parse it as Markdown. Yet another reason to strip out HTML that has no Markdown equivalents. It looks like it may be encoding the tags and the content inside the tags.

And, yes, I'm aware the [class] BBcode was marked as "deprecated" in the Friendica code, but it's the only way my Bookface scheme for the "Frio" theme could implement both profile "Cover Photos" and "Postboxes." Which won't display to other platforms anyway, so I don't want to see this custom BBcode removed, I just think it needs to be stripped out before content is delivered to other platforms.

(There is a related issue with Hubzilla where the raw BBcode is coming through unparsed because the [class] code apparently does not exist in Hubzilla's BBcodes. But I've no clue where or how to fix that in Friendica or if it can be as it may need to be handled on Hubzilla's end).
2025-04-26 16:44:14 -05:00
Michael Vogel
102db4fca0
Merge pull request #14907 from mf-fx/frio_fix_tooltips_positions_scroll
Frio: Fix bug making navigation tooltips disappear after scroll
2025-04-26 08:23:53 +02:00
Marcus Funch
f840d1f582 Frio: Fix bug making navigation tooltips disappear after scroll 2025-04-26 00:49:55 +02:00
Random Penguin
09c6061810
Strip HTML tags from content sent as Markdown
The "toMarkdown" function prepares content to be sent, primarily, to Diaspora.

The HTML to Markdown converter by default "preserves HTML tags without Markdown equivalents like `<span>` and `<div>.`" At least according to the README in _/friendica/vendor/league/html-to-markdown/_ - which also says "To strip HTML tags that don’t have a Markdown equivalent while preserving the content inside them, set strip_tags..."

Diaspora, however, does not appear to know what to DO with the HTML sent to it. It actually appears to _encode_ the HTML and displays the *code* in the post body rather than rendering it as HTML. In which case it would make more sense to strip out all tags that have no Markdown equivalents.
2025-04-20 12:05:26 -05:00
Michael
85e5dfc8cf Issue 14890: Translate page titles 2025-04-18 03:45:04 +00:00
Michael
cd73f6a27b Bluesky: Update actors regularly 2025-04-17 20:13:03 +00:00
Hypolite Petovan
cd3d412a59
Merge pull request #14885 from annando/bluesky-profile-links
Bluesky: use did based profile links
2025-04-17 00:00:01 -04:00
Hypolite Petovan
7dc681d18c
Merge pull request #14883 from annando/issue-14881
Issue 14881: Fixed language detection for danish
2025-04-16 23:58:58 -04:00
Michael
37d324e63b Bluesky: use did based profile links 2025-04-16 04:13:09 +00:00
Art4
fa58d8b11a Fix compat with PHP 7.4 2025-04-15 06:11:17 +00:00
Michael
cc4ff9584f Fixed codestyle 2025-04-15 02:09:19 +00:00
Michael
e7bd6e7663 Issue 14881: Fixed language detection for danish 2025-04-15 02:03:35 +00:00
Art4
32b657b793 fix code style 2025-04-14 15:06:30 +00:00
Art4
60ad014a6e Hard-deprecation for now unused factory classes 2025-04-14 14:51:52 +00:00
Art4
d410758cdd Remove obsolet LegacyLoggerFactory 2025-04-14 14:40:44 +00:00
Art4
c0065a68b3 Set new factories as internal 2025-04-14 14:39:39 +00:00
Art4
fc1d8e92f3 Fix code style 2025-04-14 14:38:49 +00:00
Art4
af29baf11e deprecate value monolog for config system.logger_config 2025-04-14 14:36:46 +00:00
Art4
6b36d3e87f Replace LegacyLoggerFactory with DelegatingLoggerFactory 2025-04-14 13:54:48 +00:00
Art4
8fb2fae841 Create DelegatingLoggerFactory 2025-04-14 12:58:15 +00:00
Art4
252b3980d0 Deprecate SyslogLogger factory in favour of SyslogLoggerFactory 2025-04-14 10:47:11 +00:00
Art4
0cec451497 Create SyslogLoggerFactory 2025-04-14 10:36:12 +00:00
Art4
0b41eb1528 Deprecate StreamLogger factory in favour of StreamLoggerFactory 2025-04-14 08:05:43 +00:00
Art4
77269f52eb Create StreamLoggerFactory with tests 2025-04-14 08:00:31 +00:00
Art4
65624e2c19 Create FileSystemUtil interface 2025-04-14 07:14:31 +00:00
Art4
2e672414b3 Fix compat with PHP 7.4 2025-04-11 08:38:30 +00:00
Art4
f1abd57356 Fix compat with PHP 7.4 2025-04-11 08:32:05 +00:00
Art4
2a7d329c52 Create event for profile_edit and profile_post hooks 2025-04-11 08:21:29 +00:00
Art4
c436f5249b Create events for enotify hooks 2025-04-11 07:46:48 +00:00
Art4
7531a2fb36 Create event for acl_lookup_end hook 2025-04-11 06:55:51 +00:00
Art4
531a47f7cb Merge branch 'develop' into eventdispatcher-part3 2025-04-10 14:37:40 +00:00
Art4
3ea20e9eee create event for profile_advanced hook 2025-04-10 14:36:57 +00:00
Art4
86ebbecff5 Create event for photo upload hooks 2025-04-10 14:17:20 +00:00
Hypolite Petovan
83f561ea49
Merge pull request #14880 from Art4/log-exceptions-as-critical
Log uncaught exceptions as critical
2025-04-10 10:06:27 -04:00
Art4
7bfd42ac55 log uncaught exceptions as critical 2025-04-10 11:18:38 +00:00
Art4
8ebbe8141a Merge branch 'develop' into eventdispatcher-part3 2025-04-10 11:14:16 +00:00
Art4
39439fe26b Fix missing dependency for EventDispatcher 2025-04-10 11:13:43 +00:00
Art4
ff3c4046e0 Create event for lockview_content hook 2025-04-10 11:04:10 +00:00
Art4
f08aef86f1 set EventDispatcher via constructor injection 2025-04-09 14:38:54 +00:00
Art4
2a7ebc860c Create event for moderation_users_tabs hook 2025-04-09 14:25:00 +00:00
Art4
a34a93c0b9 Create events for networt_tabs and network_content_init hooks 2025-04-02 12:41:22 +00:00
Hypolite Petovan
507897eec1
Merge pull request #14873 from annando/issue-14800-2
Fix blurred images
2025-03-31 17:49:30 -04:00
Michael
6cab9c010d Fix blurred images 2025-03-31 20:38:37 +00:00
Hypolite Petovan
43f67dd2a2
Merge pull request #14870 from annando/issue-14800
Added more logging to track down issue 14800
2025-03-29 16:10:25 -04:00
Hypolite Petovan
fb8cc06ce2 Remove remaining references of unused urlpath config key 2025-03-29 15:45:59 -04:00
Michael
5c1b5bae61 Added more logging to track down issue 14800 2025-03-29 09:07:11 +00:00
Art4
584e7e05b0 Create events for contact_edit and contact_edit_post hooks 2025-03-28 08:31:18 +00:00
Art4
e4cb372760 Create events for register_form and register_post hook 2025-03-26 08:58:23 +00:00
Art4
27e474c83c create event for parse_link hook 2025-03-26 08:30:20 +00:00
Art4
a9b36f55c9 Create event for home_content hook 2025-03-25 15:57:26 +00:00
Art4
a9f02bfef5 Create event for about_hook hook 2025-03-25 12:26:40 +00:00
Art4
88929bb307 Create event for directory_item hook 2025-03-24 13:31:53 +00:00
Art4
20a1d22620 Create event for profile_tabs hook 2025-03-24 12:41:40 +00:00
Art4
f0273a618c Create event for check_item_notification hook 2025-03-24 12:28:22 +00:00
Art4
76c3eeb96e Register hooks as event listener in API tests 2025-03-24 08:54:38 +00:00
Art4
90db7d2e65 Create events for authenticate, register_account and remove_user hooks 2025-03-20 14:59:47 +00:00
Michael Vogel
cf56aa3a64
Merge pull request #14852 from MrPetovan/bug/warnings
Add support for more datetime formats
2025-03-19 04:32:31 +01:00
Hypolite Petovan
fdadf646c4
Merge pull request #14862 from annando/fixcontacts
Add missing public contacts and account-user entries
2025-03-18 19:29:51 -04:00
Hypolite Petovan
dde6722c5b
Merge pull request #14860 from annando/backfill
Improved support for backfilled posts
2025-03-18 19:29:00 -04:00
Hypolite Petovan
47e4bad151 Fix formatting in DateTimeFormatTest 2025-03-18 19:07:25 -04:00
Hypolite Petovan
6f159e69be Add support for more datetime formats
- Unix Timestamp
- RFC 3339 extended + timezone name in square brackets
- Address https://github.com/friendica/friendica/issues/14647#issuecomment-2719430131
2025-03-18 19:01:42 -04:00
Art4
9822dd25d8 Wrap item in INSERT_POST_LOCAL_END into separate array 2025-03-18 14:21:31 +00:00
Michael
fcb8892e2f Add missing public contacts and account-user entries 2025-03-18 05:33:01 +00:00
Art4
1ddd5674e1 Wrap item in INSERT_POST_LOCAL in separate array 2025-03-17 13:08:20 +00:00
Art4
59359f7d9d Create hook for profile_sidebar hooks 2025-03-17 12:20:25 +00:00
Art4
ac8ca35b2b Create event for item_by_link hook 2025-03-17 10:52:37 +00:00
Art4
2276bdcd7e Create event for put_item_in_cache hook 2025-03-17 09:40:27 +00:00
Art4
4a1a1d3ca3 create event for tagged hook 2025-03-17 09:29:49 +00:00
Art4
84148663e2 Create event for detect_languages hook 2025-03-17 09:17:13 +00:00
Art4
d48e491144 Create events for prepare_body hooks 2025-03-17 08:26:45 +00:00
Art4
671eff8884 Merge branch 'develop' into eventdispatcher-part3 2025-03-17 07:41:10 +00:00
Art4
674b6c55de Fix code style 2025-03-17 07:38:53 +00:00
Art4
77e785dd7d Merge branch 'develop' into phpstan-level-3 2025-03-17 07:32:14 +00:00
Michael
2de7034e16 Improved support for backfilled posts 2025-03-15 05:58:58 +00:00
Michael Vogel
0aa350f1c8
Merge pull request #14859 from nupplaphil/feat/woodpecker
[CI] Woodpecker improvements
2025-03-15 06:54:05 +01:00
Philipp
5f70ae9c1e
Avoid deprecated polluting 2025-03-15 00:39:35 +01:00
Philipp
c6fbacd3e8
[CI] avoid safe.directory issues when cloning 2025-03-15 00:18:39 +01:00
Philipp
3121a256e2
Workaround for git.friendi.ca issue -> enforce external access 2025-03-15 00:04:30 +01:00
Philipp
353ad039c8
[CI] Bump PHP versions in woodpecker 2025-03-14 23:53:11 +01:00
Art4
9c6f5f222d Rename events to insert local post 2025-03-14 15:45:36 +00:00
Art4
9aeb68231d Create events for post_remote and post_remote_end hook 2025-03-14 15:35:53 +00:00
Art4
abe35732d8 create event for event_created and event_updated hooks 2025-03-14 14:11:58 +00:00
Art4
68b604812c create event for avatar_lookup hook 2025-03-14 13:31:11 +00:00
Art4
d34861ee96 Create event for contact_photo_menu hook 2025-03-14 13:23:21 +00:00
Art4
9cf0ce0b99 create event for dbview_definition hook 2025-03-14 13:02:39 +00:00
Art4
9e3b0b3c40 Create event for dbstructure_definition hook 2025-03-14 12:24:02 +00:00
Art4
04818781a7 Fix code style 2025-03-14 10:14:23 +00:00
Art4
2c0c87339e add events for storage_config and storage_instance hooks 2025-03-14 10:12:56 +00:00
Art4
8ba652818f let ATProtocol Processor::fetchUriId() return int 2025-03-14 07:50:24 +00:00
Artur Weigandt
b632b1d84e
Update src/Core/Worker/Repository/Process.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-03-13 16:00:34 +01:00
Artur Weigandt
2c87e7e102
Update src/Content/Post/Repository/PostMedia.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-03-13 16:00:25 +01:00
Artur Weigandt
71bef03316
Update src/Content/Conversation/Repository/UserDefinedChannel.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-03-13 16:00:17 +01:00
Artur Weigandt
bdfc87ab0d
Update src/Contact/LocalRelationship/Repository/LocalRelationship.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-03-13 16:00:05 +01:00
Artur Weigandt
cd00a8950f
Update src/Contact/FriendSuggest/Repository/FriendSuggest.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-03-13 15:59:56 +01:00
Art4
2a722b16aa Add event for proc_run hook 2025-03-13 14:50:29 +00:00
Art4
10e4f4bf36 Add events for follow, revoke_follow, block and unblock hooks 2025-03-13 14:02:35 +00:00
Art4
4d96875656 Add event for unfollow hook 2025-03-13 13:42:54 +00:00
Art4
0427812269 Run phpstan in addons with level 3 2025-03-13 12:54:00 +00:00
Art4
b999472ddb Fix possible false return type in PHP 7.4 2025-03-13 12:49:09 +00:00
Art4
bb6a4a3acd fix 14 PHPStan errors in console 2025-03-13 12:37:30 +00:00
Art4
2dfd7c83cf ignore PHPStan error in deprecated code 2025-03-13 12:26:16 +00:00
Art4
a63babc658 Fix 6 PHPStan errors 2025-03-13 12:20:43 +00:00
Art4
441846cfbd Fix return type or UserSession::getUserIDForVisitorContactID() 2025-03-13 11:50:15 +00:00
Art4
7e66b35b46 Fix 10 PHPStan errors 2025-03-13 11:39:02 +00:00
Art4
e1eb6fff83 Deprecate BaseRepository::_selectOne()
set BaseRepository::_selectFirstRowAsArray() as final
2025-03-13 09:18:53 +00:00
Art4
7ce6afd151 Fix 10 PHPStan errors 2025-03-13 09:14:48 +00:00
Art4
9ea4f591c7 Merge branch 'develop' into phpstan-level-3 2025-03-12 15:51:14 +00:00
Art4
268d564930 remove deprecation of BaseCollection::map(), check return type of BaseCollection::map() 2025-03-12 15:50:24 +00:00
Art4
a50383836d Fix 13 PHPStan errors 2025-03-12 15:03:15 +00:00
Art4
bf530a00d7 Fix 2 PHPStan errors 2025-03-12 15:02:50 +00:00
Hypolite Petovan
aeaa488d1b
Merge pull request #14849 from Art4/patch-1
Remove BC promise for extending any non-abstract class
2025-03-12 09:13:48 -04:00
Artur Weigandt
6b7dd7bd12
remove BC for extending any non-abstract class 2025-03-12 11:06:28 +01:00
Michael Vogel
8620b59dcc
Merge pull request #14848 from MrPetovan/bug/warnings
Ward against missing array key in Protocol\Feed
2025-03-11 15:06:59 +01:00
Hypolite Petovan
c1184698ee Ward against missing array key in Protocol\Feed
- Address https://github.com/friendica/friendica/issues/14647#issuecomment-2667306693
2025-03-11 09:15:42 -04:00
Hypolite Petovan
64d85ad86a
Merge pull request #14846 from annando/warning
Add public contact if missing
2025-03-11 09:02:00 -04:00
Michael
24cbfd0953 Fix codestyle 2025-03-11 04:54:16 +00:00
Michael
9e4a69150c Add public contact if missing 2025-03-11 04:51:20 +00:00
Hypolite Petovan
9261b5262c
Merge pull request #14845 from annando/issue-14433
Issue 14433: Display reshared content in feeds
2025-03-10 10:24:49 -04:00
Michael
d990026fb8 Issue 14433: Display reshared content in feeds 2025-03-10 05:15:43 +00:00
Hypolite Petovan
b2f50301f4
Merge pull request #14795 from Art4/deprecate-strategies-via-addons
Deprecate the strategy concept for addons
2025-03-09 20:55:25 -04:00
Hypolite Petovan
ecfb82693d
Merge pull request #14837 from annando/fatal
Fixes fatal error "Return value must be of type Friendica\Object\OEmbed, string returned"
2025-03-08 15:58:37 -05:00
Michael Vogel
f504c9d60a
Merge pull request #14843 from MrPetovan/bug/14828-expireposts-performance
Replace NOT EXIST(SELECT) with LEFT JOIN WHERE IS NULL in ExpirePosts
2025-03-08 17:58:59 +01:00
Hypolite Petovan
4883035f89 Replace NOT EXIST(SELECT) with LEFT JOIN WHERE IS NULL in ExpirePosts
- Improves the query execution plan
2025-03-08 11:23:54 -05:00
Michael
3b5ad05e47 Fixes fatal error "Return value must be of type Friendica\Object\OEmbed, string returned" 2025-03-08 12:11:37 +00:00
Art4
767ac778c9 simplify GServer repository 2025-03-07 13:49:22 +00:00
Art4
38343ee417 Refactor GServer Repository 2025-03-07 13:46:18 +00:00
Art4
eb37bcaa74 Change 500 response to 422 response
see https://github.com/friendica/friendica/pull/14475
2025-03-07 10:50:15 +00:00
Art4
3975491887 Fix upload error handling for media
see https://github.com/friendica/friendica/pull/14475
refs #14475
2025-03-06 11:57:29 +00:00
Art4
77831aaf49 Handle missing attachment with correct response 2025-03-06 09:25:39 +00:00
Michael Vogel
dc3dcb4a36
Merge pull request #14841 from MrPetovan/bug/14801-safari-workaround
[frio] Fix Safari bug where notification icon jumps to next line
2025-03-06 05:02:57 +01:00
Hypolite Petovan
e9dae569cc [frio] Fix Safari bug where notification icon jumps to next line 2025-03-05 19:08:14 -05:00
Art4
6b7dfa34e9 fix 7 PHPStan errors in factoriy and Model 2025-03-05 15:15:18 +00:00
Art4
4ebabd5997 Fix 7 PHPStan errors 2025-03-05 14:27:34 +00:00
Art4
0b162b4429 Merge branch 'develop' into phpstan-level-3 2025-03-05 08:54:57 +00:00
Hypolite Petovan
af17e33d4e
Merge pull request #14835 from annando/api
Improved Mastodon API compatibility
2025-03-04 23:00:06 -05:00
Michael
fc8946cf02 Support for language and publification date 2025-03-02 16:47:21 +00:00
Michael
1ced848827 Fix codestyle 2025-03-01 14:40:50 +00:00
Michael
fb9a20feaa Improved Mastodon API compatibility 2025-03-01 12:38:09 +00:00
Art4
c72d2d44c6 Merge branch 'develop' into phpstan-level-3 2025-02-27 12:48:40 +00:00
Art4
980beb4b1c Use selectToArray() instead of select() and is_iterable() 2025-02-27 12:47:25 +00:00
Artur Weigandt
354d13167e
Update src/Module/Api/Mastodon/Search.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-02-27 12:50:19 +01:00
Hypolite Petovan
afcc5a9205
Merge pull request #14799 from Art4/replace-hooks-with-eventdispatcher
Replace Hooks with EventDispatcher Part 2
2025-02-26 10:42:42 -05:00
Art4
3bc3f5fe4d Fix 2 PHPStan errors 2025-02-26 15:06:57 +00:00
Art4
b6312f1dfc Fix 10 PHPStan errors 2025-02-26 13:00:50 +00:00
Art4
f64660ec25 Deprecate BaseCollection::map() method 2025-02-26 08:15:27 +00:00
Art4
1820bfc2b3 Fix 5 PHPStan errors 2025-02-26 08:11:50 +00:00
Artur Weigandt
21c2c1559b
Update src/Content/OEmbed.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-02-26 08:06:35 +01:00
Art4
35d95b991b Fix 4 PHPStan errors 2025-02-25 15:26:16 +00:00
Art4
8e7676bfd8 Add CI step for PHPStan in addons folder 2025-02-25 14:33:56 +00:00
Art4
fead446624 Split phpstan.neon files for addon checks 2025-02-25 14:29:57 +00:00
Art4
f6ac16d513 Fix 11 PHPStan errors 2025-02-25 14:03:52 +00:00
Art4
cea8cf1f6c Fix 27 PHPStan errors 2025-02-25 13:51:13 +00:00
Art4
c1653877fb fix 17 PHPStan errors 2025-02-25 11:36:32 +00:00
Art4
459ad05137 Refactor DisporaContact Repository, fix PHPStan error 2025-02-25 09:26:08 +00:00
Art4
16cbaf890a Deprecate BaseRepository::_selectOne() 2025-02-25 08:39:31 +00:00
Art4
2254bee74d Refactory PermissionSet Repository, add BaseRepository::_selectFirstRowAsArray() 2025-02-25 08:30:27 +00:00
Art4
83f64b4931 Fix PHPStan error in Security class 2025-02-25 07:59:39 +00:00
Art4
f6d5cd039e Fix 2 PHPStan errors 2025-02-25 07:48:38 +00:00
Art4
ca3d98b9f5 Fix 11 errors 2025-02-24 15:15:26 +00:00
Art4
4546a4af51 Run PHPStan with level 3 2025-02-24 13:17:34 +00:00
Art4
82ea62ba7c Fix code style 2025-02-24 08:42:54 +00:00
Art4
f3a8bcff11 Create Events for protocol support hooks 2025-02-24 08:40:07 +00:00
Art4
f98aee686f Create Event for jot_networks hook 2025-02-22 19:22:23 +00:00
Art4
c66588cc2a Create Event for contact_block_end hook 2025-02-20 08:24:52 +00:00
Art4
27a7735c65 Fix code style 2025-02-17 10:56:04 +00:00
Art4
3d3e34865b Create event for html2bbcode hook 2025-02-17 10:55:05 +00:00
Art4
a94bead5f6 Fix code style 2025-02-17 10:01:25 +00:00
Art4
4f3349f6db Fix Transmitter test 2025-02-17 09:54:33 +00:00
Art4
7366e70a56 Merge branch 'develop' into replace-hooks-with-eventdispatcher 2025-02-17 09:51:21 +00:00
Art4
efd3cb30d1 Fix Mastodon Status tests 2025-02-17 09:49:16 +00:00
Art4
94b47ae4d1 Fix smilies tests 2025-02-17 09:45:04 +00:00
Tobias Diekershoff
3ecae98f86
Merge pull request #14823 from annando/fix-14819
Fixes PR #14819: Add missing index
2025-02-16 16:32:10 +01:00
Michael
c3f2bfaef3 Fixes PR #14819: Add missing index 2025-02-16 10:52:55 +00:00
Tobias Diekershoff
02f693488f
Merge pull request #14820 from annando/exception
Fixes: Uncaught Exception TypeError: "array_merge(): Argument #1 must be of type array, int given"
2025-02-16 10:00:25 +01:00
Michael
48372faec6 Fixes: Uncaught Exception TypeError: "array_merge(): Argument #1 must be of type array, int given" 2025-02-16 05:59:23 +00:00
Hypolite Petovan
c746017cda
Merge pull request #14819 from annando/redirected
Handle redirected servers in server detection.
2025-02-15 19:56:37 -05:00
Michael
1bc2cfa0a1 Fix codestyle 2025-02-15 20:13:21 +00:00
Michael
0025467500 Handle redirected servers in server detection. 2025-02-15 14:43:23 +00:00
Art4
d5f5ebbd8a fix code style 2025-02-14 15:05:12 +00:00
Art4
62d27de3b0 Create events for bbcode hooks 2025-02-14 15:03:29 +00:00
Art4
81b6ed9fc2 fix code style 2025-02-14 13:02:28 +00:00
Art4
a6ab7dd6f1 create event for smilie hook 2025-02-14 13:00:21 +00:00
Art4
0b3915322b Create event for page_info_data hook 2025-02-14 12:26:50 +00:00
Art4
ce4e77fbb6 Fix code style 2025-02-14 12:15:17 +00:00
Art4
b9a401454d Create event for oembed_fetch_url hook 2025-02-14 12:11:17 +00:00
Art4
aff117284b create event for item_photo_menu hook 2025-02-14 10:33:17 +00:00
Art4
b3ef18bed7 create event for render_location hook 2025-02-14 10:19:55 +00:00
Art4
85fceaa16e Remove not needed hook call 2025-02-14 09:47:30 +00:00
Art4
ca3edb866a Create Event for display_item hook 2025-02-14 09:42:57 +00:00
Art4
02976067c3 Fix code style 2025-02-14 08:39:58 +00:00
Art4
d4ba28a997 create event for conversation_start hook 2025-02-14 08:38:59 +00:00
Art4
4bdd5f6bbe Fix code style 2025-02-14 08:14:27 +00:00
Art4
7260f29292 Create Event for jot_tool hook 2025-02-14 08:12:59 +00:00
Art4
674ad96b69 Merge branch 'develop' into replace-hooks-with-eventdispatcher 2025-02-14 07:30:35 +00:00
Art4
134d85b9c1 Fix code style 2025-02-14 07:24:47 +00:00
Art4
3295b9055f Create event for network_to_name hook 2025-02-13 15:29:52 +00:00
Hypolite Petovan
abc38bec75
Merge pull request #14811 from annando/page-language
Set the page language
2025-02-13 10:15:57 -05:00
Michael
cfb9a3a41c Fix codestyle 2025-02-13 06:55:10 +00:00
Michael
23f16df112 Set the page language 2025-02-13 06:47:19 +00:00
Art4
caef97752a Merge branch 'develop' into replace-hooks-with-eventdispatcher 2025-02-12 21:13:24 +00:00
Hypolite Petovan
6e70ad1f0e
Merge pull request #14622 from Art4/introduce-phpmd
Introduce PHPMD
2025-02-12 11:22:26 -05:00
Michael Vogel
912345d469
Merge pull request #14810 from tobiasd/20250212-lng
updated translations
2025-02-12 12:24:59 +01:00
Tobias Diekershoff
22ea08b81b updated translations 2025-02-12 08:10:11 +01:00
Hypolite Petovan
37f09cd0e3
Merge pull request #14808 from MarekBenjamin/patch-1
Added dedicated friendica clients FAQ.md
2025-02-11 11:43:52 -05:00
MarekBenjamin
5f5a98135d
Update doc/FAQ.md
new line for new sentence

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-02-11 17:29:07 +01:00
MarekBenjamin
b2da52fa3b
Added dedicated friendica clients FAQ.md
Added Raccoon for Friendica and Relatic to the list, marked dedicated friendica client in bold
2025-02-11 12:58:58 +01:00
Art4
dd6f479401 Merge branch 'develop' into replace-hooks-with-eventdispatcher 2025-02-11 09:59:13 +00:00
Michael Vogel
8174c36b57
Merge pull request #14807 from Art4/fix-database-structure
Fix database doc
2025-02-11 10:46:10 +01:00
Art4
849cc01e2b Update database doc 2025-02-11 08:58:14 +00:00
Art4
ed467e6eae Add composer script for update db structure 2025-02-11 08:57:56 +00:00
Art4
7d792600b4 Merge branch 'develop' into introduce-phpmd 2025-02-11 07:57:29 +00:00
Hypolite Petovan
4d9b91ac96
Merge pull request #14806 from annando/refresh
Fix refresh after commenting
2025-02-10 22:08:43 -05:00
Michael
98445a14e4 Fix refresh after commenting 2025-02-10 23:46:05 +00:00
Hypolite Petovan
2d2fad981b
Merge pull request #14804 from Art4/fix-deprecation-message
Fix version in deprecation message
2025-02-10 08:54:37 -05:00
Hypolite Petovan
17207dbb67
Merge pull request #14770 from Art4/new-addonproxy
New AddonHelper
2025-02-10 07:53:24 -05:00
Hypolite Petovan
ff342ce5cc
Merge pull request #14805 from Art4/fix-active-tab
Fix active tab
2025-02-10 07:52:22 -05:00
Art4
eeab1144cf Fix active tab 2025-02-10 12:43:16 +00:00
Art4
5aeddcd5e3 Fix version in deprecation message 2025-02-10 07:11:24 +00:00
Hypolite Petovan
6b0a2d1eb9
Merge pull request #14803 from annando/issue-12771
Issue 12771: Fix interrupted video playback
2025-02-09 23:07:32 -05:00
Michael
f3af47ca5b Fix codestyle 2025-02-09 20:24:34 +00:00
Michael
3c3c69dfd8 Issue 12771: Fix interrupted video playback 2025-02-09 20:20:36 +00:00
Art4
23ce65c5d0 Fix code style 2025-02-08 22:00:30 +00:00
Art4
18369854b7 Implement route_collection hook as CollectRoutesEvent 2025-02-08 21:59:28 +00:00
Art4
7298ad29c1 Implement photo_upload_form hook as Event 2025-02-08 21:04:35 +00:00
Art4
f4624b0591 Fix cs 2025-02-08 16:38:01 +00:00
Art4
b1f4184d96 Merge branch 'develop' into replace-hooks-with-eventdispatcher 2025-02-08 16:37:08 +00:00
Art4
742cde89e6 Implement home_init hook as Event 2025-02-08 16:33:07 +00:00
Hypolite Petovan
5e00120465
Merge pull request #14797 from tobiasd/20250208-lng
update translations
2025-02-08 11:24:08 -05:00
Tobias Diekershoff
3439d05fbf update translations 2025-02-08 16:33:37 +01:00
Art4
aabf9a8b01 Replace hooks post_local_start, post_local and post_local_end with EventDispatcher 2025-02-08 08:17:30 +00:00
Art4
649ddf7ab9 Add events for post_local, post_local_start and post_local_end 2025-02-08 07:58:33 +00:00
Art4
c8dd900635 Add deprecation note in docs 2025-02-08 07:01:54 +00:00
Art4
5beeda612a Merge branch 'develop' into deprecate-strategies-via-addons 2025-02-07 15:24:37 +00:00
Art4
1ea2df569e Deprecate strategies via addons 2025-02-07 15:06:11 +00:00
Art4
e5416ca4a9 Deprecate providing LoggerInterface via addon strategies 2025-02-07 14:50:56 +00:00
Hypolite Petovan
10f5f0358a
Merge pull request #14792 from ne20002/issue/288
Followup to #14790
2025-02-06 14:34:37 -05:00
ne20002
6cd92da46c
Fix for PR #14790 2025-02-06 18:23:27 +00:00
ne20002
2ceded19c4
Followup to #14790 - revert to /bin/bash for run_xgettext.sh 2025-02-06 17:53:09 +00:00
Hypolite Petovan
bd65c4d1a8
Merge pull request #14790 from ne20002/issue/288
Downgrade shebang from bin/bash to bin/sh
2025-02-06 12:12:38 -05:00
Hypolite Petovan
87e3d8c790
Merge pull request #14789 from Art4/fix-randomdigits
Fix Crypto::randomDigits()
2025-02-06 11:03:08 -05:00
Hypolite Petovan
5646a8283d
Merge pull request #14788 from Art4/optimize-composer
Add composer script for production installation
2025-02-06 10:59:43 -05:00
ne20002
7812a6d8fe
Downgrade shebang from bin/bash to bin/sh 2025-02-06 09:41:26 +00:00
Art4
006ff7be8f Fix tests 2025-02-06 08:33:18 +00:00
Art4
c7b1961d02 Fix return type of randomDigits 2025-02-06 08:30:05 +00:00
Art4
c6ee2c461c Revert "Refactor Crypto::randomDigits()"
This reverts commit 940884e4bd.
2025-02-06 08:29:14 +00:00
Art4
2cea3203b5 Fix composer path in Vagrant docs 2025-02-06 07:47:51 +00:00
Art4
d71264993d Update docs and scripts to use the correct composer install script 2025-02-06 07:43:52 +00:00
Art4
98f1ae444c Add composer script for install:prod, remove optimization in dev 2025-02-06 07:21:00 +00:00
Tobias Diekershoff
47db6de393
Merge pull request #14787 from annando/issues
Fix notices and missing template variables
2025-02-06 08:02:47 +01:00
Michael
a2e9247936 Fix notices and missing template variables 2025-02-06 05:41:30 +00:00
Hypolite Petovan
91a145106d
Merge pull request #14785 from annando/accessibility-3
Accessibility: Widgets and other menues
2025-02-05 22:38:54 -05:00
Michael
58d1d4c1fb Accessibility: Widgets and other menues 2025-02-05 22:52:39 +00:00
Art4
703024d9b9 Fix namespace in tests 2025-02-05 19:39:35 +00:00
Art4
d086a982f9 Merge branch 'develop' into new-addonproxy 2025-02-05 19:20:27 +00:00
Hypolite Petovan
9e7a527327
Merge pull request #14784 from ne20002/feat/wizard
use env variables in install wizard for values if available
2025-02-05 11:22:31 -05:00
Hypolite Petovan
c77c6140fd
Merge pull request #14779 from annando/issue-14746
Issue 14746: Improved description
2025-02-05 11:08:05 -05:00
Hypolite Petovan
a378a85c04
Merge pull request #14640 from Art4/introduce-eventdispatcher
[EventDispatcher] Proof of concept
2025-02-05 10:42:10 -05:00
ne20002
7f8ac7aaea
use env variables in install wizard for values if available 2025-02-05 14:56:05 +00:00
Michael
22b8be6a8c Fix codestyle 2025-02-05 09:45:46 +00:00
Michael
74bfa7721d Issue 14746: Improved description 2025-02-05 09:38:39 +00:00
Art4
732c32cb0e Fix code style 2025-02-04 19:20:13 +00:00
Art4
9f7774faab Merge branch 'develop' into new-addonproxy 2025-02-04 19:19:16 +00:00
Art4
62f87c13ea Fix test fixture for ConfigFileManager 2025-02-04 19:14:35 +00:00
Art4
f634ec4758 Move HookEventBridge into Friendica\Core\Hooks namespace 2025-02-04 13:23:50 -05:00
Art4
0837ad647a Fix code style 2025-02-04 13:23:50 -05:00
Art4
70a6c6ed01 Change code style 2025-02-04 13:22:55 -05:00
Art4
d9a2d676d2 Replace Hook with EventDispatcher in Feature class 2025-02-04 13:22:55 -05:00
Art4
673fc71c21 Stop calling DI container over and over again 2025-02-04 13:22:54 -05:00
Art4
f3ccd198a4 Replace Hook with EventDispatcher in Feature class 2025-02-04 13:22:54 -05:00
Art4
b9a191f6d8 Replace Hook with EventDispatcher in Content Nav class 2025-02-04 13:22:54 -05:00
Art4
715248d6a2 Add ArrayFilterEvent, replace app_menu hook 2025-02-04 13:22:54 -05:00
Art4
5b28b3d28f Let event classes extending Event 2025-02-04 13:22:53 -05:00
Art4
4cbee618d6 Refactor HookEventBridge 2025-02-04 13:22:53 -05:00
Art4
16fb80be1f Add missing files 2025-02-04 13:22:53 -05:00
Art4
0c406a3696 Create ConfigLoadedEvent 2025-02-04 13:22:53 -05:00
Art4
7e199f034b Create DI::eventDispatcher() where constructor injection is not possible atm 2025-02-04 13:22:53 -05:00
Art4
2a02f58886 Remove unused StaticEventSubscriber interface 2025-02-04 13:22:53 -05:00
Art4
2e660f44f2 Mark new event and eventdispatcher classes as internal 2025-02-04 13:22:52 -05:00
Art4
9e6f77c4b1 EventDispatcher proof of concept 2025-02-04 13:22:52 -05:00
Hypolite Petovan
df17de7ea7
Merge pull request #14749 from MarekBenjamin/bugfix/14748-frio-filer-dialog-colors
Fix filer dialog colors
2025-02-04 13:22:09 -05:00
Hypolite Petovan
23f66d1708 Updated main translation file 2025-02-04 13:20:41 -05:00
Marek Bachmann
01f852a87c Change filer dialog from color box to modal usage 2025-02-04 13:20:33 -05:00
Hypolite Petovan
827541ed86
Merge pull request #14781 from Eduu/covering-index-for-count-queries
Faster count queries when updating the info about current node
2025-02-04 12:54:29 -05:00
Esko Arajärvi
25bb9b12c1 Faster count queries when updating the info about current node
MySQL optimiser seems to prefer a full table scan of `post-user`
table in the count query mentioned in issue #14763. When the origin
and deleted columns are added to the index, the IN-query part of
the query can be done with index-only scan, which is much faster.

Adding the columns in the order

    uri-id, origin, deleted

allows some other queries to also use it when checking
for uri-id and origin.

Fixes #14763
2025-02-04 19:47:31 +02:00
Art4
86516d8b28 Fix code style 2025-02-04 15:21:14 +00:00
Art4
a006aba9d4 Merge branch 'develop' into new-addonproxy 2025-02-04 15:20:01 +00:00
Art4
d8470b68df Replace Addon::DIRECTORY with AddonHelper::getAddonPath() 2025-02-04 15:18:23 +00:00
Art4
4e9276e1c9 Move style logic from Addon class to BaseAdmin module 2025-02-04 14:44:46 +00:00
Art4
8cb48ded4d Remove debug execption 2025-02-04 14:37:29 +00:00
Art4
b0e3f1f64d Fix support for multiple authors and maintainers 2025-02-04 14:35:57 +00:00
Tobias Diekershoff
edbf86449d
Merge pull request #14760 from MrPetovan/bug/warnings
Prioritize coalescing parameters in Moderation\Users\*->processGetActions
2025-02-04 14:59:47 +01:00
Art4
a80bf0ddf1 Simplify AddonHelper::getAvailableAddons(), move style logic into Module class 2025-02-04 13:48:04 +00:00
Art4
af1894504d Merge branch 'develop' into new-addonproxy 2025-02-04 13:17:24 +00:00
Art4
4c71ac643d Deprecate Addon::DIRECTORY in favor of AddonHelper::getAddonPath() 2025-02-04 13:13:57 +00:00
Art4
9f086c40e4 Fix code style 2025-02-04 12:59:21 +00:00
Art4
e596a0b624 Implement AddonHelper::loadAddons() 2025-02-04 12:57:32 +00:00
Hypolite Petovan
0cf1ef397b
Merge pull request #14769 from annando/acessibility
Some more screenreader improvements
2025-02-04 07:40:14 -05:00
Art4
5497fd3559 Use AddonHelper in Cron worker and addon console command 2025-02-04 12:39:54 +00:00
Art4
31f62b807a Replace Addon class with AddonHelper in addon index 2025-02-04 12:27:59 +00:00
Art4
fda70f3fe3 Create AddonHelper::getEnabledAddonsWithAdminSettings() 2025-02-04 12:18:08 +00:00
Art4
a678f41ca7 Fix PHP 7.4 support 2025-02-04 11:45:32 +00:00
Art4
a276337752 Fix code style 2025-02-04 10:50:06 +00:00
Art4
105f848dd7 Use AddonInfo in addon Details 2025-02-04 10:47:57 +00:00
Art4
ecbd0423da Deprecate more Addon methods 2025-02-04 10:47:31 +00:00
Art4
a8249be928 Create AddonInfo class 2025-02-04 09:41:52 +00:00
Art4
61fa36b227 Add install, uninstall and reload in AddonHelper 2025-02-04 08:03:32 +00:00
Art4
db37a93efa Fix code style 2025-02-04 07:00:09 +00:00
Art4
776781e522 Merge branch 'develop' into new-addonproxy 2025-02-04 06:54:59 +00:00
Art4
c50827a803 Replace Addon class with AddonHelper in mod photos.php 2025-02-04 06:54:53 +00:00
Michael
795873b911 Fix code standard 2025-02-04 04:55:05 +00:00
Michael
7bbefae3e6 Skip to content 2025-02-04 04:49:05 +00:00
Michael
b5bff3f758 Codestyle changes 2025-02-04 04:49:05 +00:00
Michael
f3c5855fc1 Some more screenreader improvements 2025-02-04 04:49:05 +00:00
Hypolite Petovan
95d3ce5441
Merge pull request #14775 from waldyrious/normalize-signup-form-labels
Normalize punctuation in signup form field labels
2025-02-03 21:52:51 -05:00
Waldir Pimenta
773f654e99 Normalize punctuation in signup form field labels 2025-02-03 21:53:02 +00:00
Hypolite Petovan
afba22e2cc
Merge pull request #14773 from waldyrious/close-paren
Close paren in message shown at the signup form
2025-02-03 16:42:37 -05:00
Waldir Pimenta
7b5b9c164e Close paren in message shown at the signup form 2025-02-03 21:09:00 +00:00
Waldir Pimenta
2abc7b4986 Update messages.po main translation file 2025-02-03 19:54:15 +00:00
Art4
b84eb33ae2 Add AddonHelper::getAvailableAddons() method 2025-02-03 15:23:44 +00:00
Art4
4ea648475f Replace calls of Addon::getVisibleList() with AddonHelper::getVisibleEnabledAddons() 2025-02-03 14:54:45 +00:00
Art4
04df082d4e Rename method names in AddonHelper 2025-02-03 14:27:23 +00:00
Art4
bc6145c684 Fix code style 2025-02-03 14:23:31 +00:00
Art4
655df1fd8e Use AddonHelper in Router 2025-02-03 14:21:52 +00:00
Art4
9c002a1aa2 Fix code style 2025-02-03 13:59:58 +00:00
Art4
d82483f342 Merge branch 'develop' into new-addonproxy 2025-02-03 13:58:10 +00:00
Hypolite Petovan
9d506071c8
Merge pull request #14764 from haheute/circle-update-wrapper-css
[frio] Small CSS fix for circle-update-wrapper shortmode headings
2025-02-02 14:44:14 -05:00
Hypolite Petovan
5ad82bce23
Merge pull request #14762 from juliend2/add-addon-dir
Create `addon/` folder in the proper order, since it's now mandatory
2025-02-02 14:43:34 -05:00
Art4
c4469cb624 Move getVisibleList() into AddonHelper 2025-02-02 19:32:17 +00:00
Hypolite Petovan
7b0e31714f
Merge pull request #14758 from Art4/hard-deprecate-logger
Hard deprecate `Friendica\Core\Logger`
2025-02-02 13:13:24 -05:00
Art4
5504fdcd06 Move getEnabledList into AddonHelper 2025-02-02 06:55:38 +00:00
Art4
91bd6089b5 Create AddonHelper and proxy to check if addon is enabled 2025-02-01 21:58:59 +00:00
Hannes Heute
410fe15507 [frio] Small CSS fix for circle-update-wrapper shortmode headings 2025-02-01 20:45:15 +01:00
Julien Desrosiers
f1bf64a8ff If we follow the installation doc, it says to clone the addon repo inside this dir
which would fail if said dir exist and is not empty.
2025-02-01 13:21:37 -05:00
Julien Desrosiers
16b268f0ca .gitkeep to allow addon(s) folders to exist by default 2025-02-01 12:08:31 -05:00
Art4
f135e18522 deprecations should be muted trigger_error calls 2025-02-01 09:21:00 +00:00
Julien Desrosiers
3e43b27e83 Making addon/ folder exist since it's now mandatory 2025-02-01 00:36:35 -05:00
Hypolite Petovan
3799f6c69e Fix code style in Moderation\Users classes 2025-01-31 12:15:31 -05:00
Hypolite Petovan
e6f4df3442 Prioritize coalescing parameters in Moderation\Users\*->processGetActions
↪ This was causing missing array index warnings when the casting took precedence
2025-01-31 12:11:59 -05:00
Art4
af96a957cd Log trigger_error() of deprecated code 2025-01-31 15:36:08 +00:00
Art4
02cde27a12 Mute calles of trigger_error() 2025-01-31 15:35:07 +00:00
Art4
c206e60ad4 Hard deprecate DI::workerLogger(), mark DI::loggerManager() as internal 2025-01-31 07:56:30 +00:00
Art4
c363b45e0d Hard deprecate all Logger methods 2025-01-31 07:55:53 +00:00
Hypolite Petovan
f1dfa63764
Merge pull request #14755 from haheute/photo-permission-modal
[frio] Use modal instead of popupbox for permissions on photo edit page
2025-01-29 22:19:12 -05:00
Hannes Heute
e296938dd4 [frio] Don't lose title in photo permission modals 2025-01-29 23:32:18 +01:00
Tobias Diekershoff
db93456027
Merge pull request #14752 from MrPetovan/bug/fatal-errors
Add expected final return in Console\Storage->doMove
2025-01-29 22:57:51 +01:00
Hannes Heute
7980a9e932 [frio] Use modal instead of popupbox for permissions on photo edit page 2025-01-29 21:18:15 +01:00
Hypolite Petovan
af661716a0
Merge pull request #14753 from haheute/drop-area
[frio] Improve dropzone background color
2025-01-29 12:30:28 -05:00
Hannes Heute
f52493f270 improve dropzone background color 2025-01-29 16:59:32 +01:00
Hypolite Petovan
81a9fbb9bd
Merge pull request #14751 from haheute/modal-header
Frio: change modal header border to reflect the current color scheme
2025-01-29 09:58:33 -05:00
Hypolite Petovan
13214843d8 Add expected final return in Console\Storage->doMove
- Address https://github.com/friendica/friendica/issues/14646#issuecomment-2621372228
2025-01-29 09:56:06 -05:00
Hypolite Petovan
3791635143 Fix coding style in Console\Storage 2025-01-29 09:55:42 -05:00
Hannes Heute
c5c8724a04 use class instead of id, to match all occurences 2025-01-29 15:46:37 +01:00
Hannes Heute
b171de3375 Frio: change modal header border to reflect the current color scheme 2025-01-29 15:11:41 +01:00
Hypolite Petovan
0fcef20bb3
Merge pull request #14747 from haheute/notification-word-break
Frio: break too long words in topbar notifications
2025-01-28 16:45:40 -05:00
Hannes Heute
2fb162e391 Frio: break too long words in topbar notifications 2025-01-28 21:36:55 +01:00
Michael Vogel
6e264724f8
Merge pull request #14745 from MrPetovan/bug/14744-mastodon-api-instance
Fix wrong default value for contact_account in Mastodon\Instance
2025-01-28 21:15:14 +01:00
Michael Vogel
a730259d97
Merge pull request #14740 from MrPetovan/bug/14702-filer-callback
Fix itemFiler() callback
2025-01-28 21:09:05 +01:00
Michael Vogel
d5652ade63
Merge pull request #14739 from MrPetovan/bug/14711-log-new-line
Remove potential new lines in reported logger instances
2025-01-28 21:05:59 +01:00
Hypolite Petovan
5d6be39a0c Fix coding style in Repository\Notify and Util\Emailer 2025-01-28 07:50:30 -05:00
Hypolite Petovan
0006d838f5 Remove potential new lines in reported logger instances
- Thanks to @MrKaplan-lw for the investigative work
2025-01-28 07:50:30 -05:00
Hypolite Petovan
1f8ea30735 Fix itemFiler() callback
- Remove page exit alert
- Update filed post display on success
- Reset cursor appearance always
2025-01-28 07:50:16 -05:00
Hypolite Petovan
9e3936b151 Fix code style in itemFiler() 2025-01-28 07:50:16 -05:00
Hypolite Petovan
56e7b05d99 Fix coding style in Object/Api/Mastodon/Instance 2025-01-28 07:35:17 -05:00
Hypolite Petovan
186b82d71d Fix wrong default value for contact_account in Mastodon\Instance 2025-01-27 22:01:40 -05:00
Hypolite Petovan
e4fa1aa418 Add type hints in Mastodon\Instance 2025-01-27 22:01:17 -05:00
Hypolite Petovan
258476e14f
Merge pull request #14742 from haheute/media-heading
fix font-size for .media-heading
2025-01-27 08:10:03 -05:00
Hannes Heute
82c64e6e76 fix font-size for .media-heading 2025-01-27 13:14:46 +01:00
Tobias Diekershoff
73fd2b23a5
Merge pull request #14737 from MrPetovan/bug/14131-dropzone-error
Account for calendar post edition in editpost()
2025-01-27 06:31:10 +01:00
Tobias Diekershoff
80f5856764
Merge pull request #14736 from MrPetovan/bug/fatal-errors
Ward against invalid URLs in Model\Post\Media::isFederatedServer
2025-01-27 06:22:44 +01:00
Tobias Diekershoff
92d8203447
Merge pull request #14735 from MrPetovan/bug/14424-pendign-invite
Exclude invitation register rows from pending-view
2025-01-27 06:17:50 +01:00
Tobias Diekershoff
fe462398ad
Merge pull request #14738 from MrPetovan/bug/14689-community-empty
Return early if system.max_author_posts_community_page isn't set in Conversation\Timeline->getCommunityItems
2025-01-27 06:14:52 +01:00
Hypolite Petovan
b4b7e9a3c7 Avoid matching invalid URLs in Model\Post\Media::insertFromRelevantUrl
- Replace * with + to prevent matching empty domains
2025-01-26 17:54:17 -05:00
Hypolite Petovan
657c04a041 Ward against invalid URLs in Model\Post\Media::isFederatedServer
- Add logger call for exception case
- Address https://github.com/friendica/friendica/issues/14646#issuecomment-2614231345
2025-01-26 17:54:17 -05:00
Hypolite Petovan
e3a2c70ccb Exclude invitation register rows from pending-view
↪ They were wrongly appearing in the moderation screen and in the notifications
2025-01-26 17:53:58 -05:00
Hypolite Petovan
f632acb6c2 Fix coding style in src/Module/Conversation/Timeline.php 2025-01-26 17:53:24 -05:00
Hypolite Petovan
403a4684e5 Return early if system.max_author_posts_community_page isn't set in Conversation\Timeline->getCommunityItems 2025-01-26 17:52:35 -05:00
Hypolite Petovan
8f0a31dc1e Fix code style in src/Util/Temporal 2025-01-26 17:47:23 -05:00
Hypolite Petovan
f3202b0508 Account for calendar post edition in editpost()
- Calendar form doesn't have a dropzone nor link preview capability
2025-01-26 17:45:23 -05:00
Hypolite Petovan
d9c11bb853 Set first_day_of_week config value default correctly
↪ Config value could be empty string and cause a script error
2025-01-26 17:45:23 -05:00
Michael Vogel
5a00a2c441
Merge pull request #14734 from MrPetovan/bug/empty-dom-string
Ward against empty string in Model\Item::replacePlatformIcon
2025-01-26 22:45:43 +01:00
Hypolite Petovan
20ab8de06d Ward against empty string in Model\Item::replacePlatformIcon
- Add logger call to troubleshoot
2025-01-26 14:49:00 -05:00
Hypolite Petovan
c8042e92df
Merge pull request #14730 from annando/accessibility
Several accessibility improvements
2025-01-26 12:20:29 -05:00
Hypolite Petovan
282e3c2f1f
Merge pull request #14733 from MarekBenjamin/bugfix/illegal-whitespace
Refactor view.tpl for admin/logs: Fixed illegal whitespace
2025-01-26 11:47:52 -05:00
Marek Bachmann
aad4dda353 Refactor view.tpl for admin/logs: Fixed illegal whitespace 2025-01-26 16:28:49 +00:00
Michael
b8c33571e7 Hide dots from screenreaders 2025-01-26 14:09:59 +00:00
Michael
c0723e3d48 Fix codestyle 2025-01-26 12:59:59 +00:00
Michael
c978c8e027 Several accessibility improvements 2025-01-26 12:46:18 +00:00
Tobias Diekershoff
0d188d39d5
Merge pull request #14728 from MarekBenjamin/bugfix/log-table-appeareance
Bugfix/log table: Log level not readable in dark and black frio appeareance
2025-01-26 08:21:45 +01:00
Marek Bachmann
dc0d094610 Refactor view.tpl for admin/logs: Assign bootstrap.css text classes only (no bg adjustment) 2025-01-25 23:07:17 +00:00
Marek Bachmann
2e472f84a7 Refactor view.tpl for admin/logs: Assign bootstrap.css bg and text classes dynamically for log rows 2025-01-25 22:53:42 +00:00
Marek Bachmann
f3a160598f Refactor view.tpl for admin/logs: Use class variable for log rows to eliminate whitespace from indentation in tr class attribute" 2025-01-25 22:40:23 +00:00
Hypolite Petovan
eec293191b
Merge pull request #14727 from MrPetovan/bug/14725-restore-group-widget
Remove test code from GroupManager::widget
2025-01-25 12:47:12 -05:00
Hypolite Petovan
5cd6d9a0f1 Remove test code from GroupManager::widget
Oops.
2025-01-25 12:45:47 -05:00
Hypolite Petovan
8bf3d6694a
Merge pull request #14686 from annando/relation
Improves the performance for contact relation discovery
2025-01-24 09:03:25 -05:00
Art4
1e1d917730 Merge branch 'develop' into introduce-phpmd 2025-01-24 10:33:06 +00:00
Michael
80fe8f837e Unneeded check removed 2025-01-24 06:59:38 +00:00
Michael
e5bf1b976a New function "add" 2025-01-24 06:52:20 +00:00
Michael
d45cd93278 Improved performance on relation discovery 2025-01-24 06:52:20 +00:00
Hypolite Petovan
df85a9a63a
Merge pull request #14639 from annando/warning
Fix warning "Trying to access array offset on value of type bool"
2025-01-23 21:51:28 -05:00
Michael
af1e69ea1e messages.po updated 2025-01-23 21:30:07 +00:00
Michael
b915252e7e Fix warning "Trying to access array offset on value of type bool" 2025-01-23 21:24:14 +00:00
Art4
a6ea520224 Add cache in phpmd workflow 2025-01-23 15:11:59 +00:00
Art4
9b9627e4b6 simplify ci job, use image: friendicaci/php8.3:php8.3.3 2025-01-23 14:51:05 +00:00
Art4
379272efa3 Run woodpecker with image: php:8.3 2025-01-23 14:48:16 +00:00
Art4
e364d254ed run phpmd in own woodpecker job 2025-01-23 14:42:51 +00:00
Art4
6aadb63b82 run phpmd before php-cs-fixer 2025-01-23 14:33:41 +00:00
Art4
f3aa937ce2 Check phpmd with woodpecker 2025-01-23 14:28:50 +00:00
Art4
9c7577c5c2 Recreate messages.po 2025-01-23 14:28:10 +00:00
Art4
0b36d4c9d6 Fix code style 2025-01-23 14:18:23 +00:00
Art4
c64d80fef9 Increate ExcessiveClassComplexity rule to 800 2025-01-23 14:16:56 +00:00
Art4
40f467fb72 Extract Feed::importOlderEntries() into own method 2025-01-23 14:13:32 +00:00
Art4
f75b67de2f Extract method Fee::getTitleFromItemOrEntry() 2025-01-23 13:56:35 +00:00
Art4
befb4796f9 Extract Transmitter::filterReceiverData() as own method 2025-01-23 13:36:57 +00:00
Art4
db949270f5 Extract getDuplicateID() into ItemHelper 2025-01-23 13:26:58 +00:00
Art4
118e59ac5c Extract isDuplicate() into ItemHelper 2025-01-23 13:17:04 +00:00
Art4
7a2e1e0511 Rename ItemInserter into ItemHelper 2025-01-23 12:11:18 +00:00
Art4
764a701610 Extract handleToplevelParent() into ItemInserter 2025-01-23 10:50:04 +00:00
Art4
9cd6c025d5 Extract getTopLevelParent() into ItemInserter 2025-01-23 10:42:43 +00:00
Art4
ddfdf02b34 Fix support for PHP 7.4 2025-01-23 10:31:47 +00:00
Art4
0e054cd4a0 Extract hasRestrictions() into ItemInserter 2025-01-23 09:50:27 +00:00
Art4
3c51af78a2 Replace DBA class with DI::dba() in Item Model 2025-01-23 09:35:46 +00:00
Art4
0732c6158a Extract validateItemData() into ItemInserter 2025-01-23 09:26:58 +00:00
Art4
cfc07d7b0d Mark ItemInserter as internal 2025-01-23 09:16:14 +00:00
Art4
4c95605711 Merge branch 'develop' into introduce-phpmd 2025-01-23 08:56:07 +00:00
Tobias Diekershoff
4917380716
Merge pull request #14719 from MrPetovan/bug/14717-revert-moderation
Partially revert "Improve search for user in Modration module"
2025-01-23 07:38:48 +01:00
Tobias Diekershoff
4fa82f4c73
Merge pull request #14720 from MrPetovan/bug/14099-create-new-group
Show Create new Group link in widget even if there's no group membership to display
2025-01-23 07:35:45 +01:00
Hypolite Petovan
1794d58a5b Fix code style in Content\GroupManager 2025-01-22 22:17:22 -05:00
Hypolite Petovan
354e3adc04 Show Create new Group link in widget even if there's no group membership to display 2025-01-22 22:14:38 -05:00
Hypolite Petovan
c426b27287
Merge pull request #14696 from xundeenergie/dropzone-upload-improvement
Do not change cursor position while replacing upload-placeholder, add video, audio and documents to upload
2025-01-22 22:00:07 -05:00
Hypolite Petovan
3980de94a4 Merge branch 'develop' into xundeenergy/dropzone-upload-improvement 2025-01-22 21:52:52 -05:00
Hypolite Petovan
cbb6b7819a Extract GET action processing in Moderation modules 2025-01-22 21:51:03 -05:00
Hypolite Petovan
3e465cb761 Partially revert "Improve search for user in Modration module"
This reverts commit 78444ff25c.
↪️ When the uid parameter isn't set, the regular list should be shown instead of throwing an error.
2025-01-22 21:37:39 -05:00
Hypolite Petovan
d97b8f8faa
Merge pull request #14690 from Art4/fix-code-style-for-pr-14688
Fix code style for #14688
2025-01-22 21:20:26 -05:00
Hypolite Petovan
822b4429f3 Merge branch 'develop' into Art4/fix-code-style-for-pr-14688
# Conflicts:
#	src/Model/GServer.php
#	src/Util/HTTPSignature.php
2025-01-22 21:05:24 -05:00
Hypolite Petovan
0d97118cfb
Merge pull request #14718 from Art4/mark-internal-code
Mark internal code, move deprecation warnings into entry points
2025-01-22 20:58:45 -05:00
Hypolite Petovan
3d1ab8c5b9
Merge pull request #14700 from annando/get-signer
Issue 14692: Prevent loops with remote servers
2025-01-22 20:50:41 -05:00
Hypolite Petovan
15cec1ac10
Merge pull request #14699 from annando/update-contact
New option to only update contacts that have got a relation to local users
2025-01-22 20:48:50 -05:00
Michael
3da2a3ef3d Fix logger calls 2025-01-22 21:02:15 +00:00
Michael
d74ca3ecf5 Fix codestyle 2025-01-22 20:56:21 +00:00
Michael
0f8786f8b1 Fix codestyle 2025-01-22 20:31:14 +00:00
Michael
bccf95a088 Changes after review 2025-01-22 20:26:05 +00:00
Art4
0b84cf401d Mark more new classes as internal 2025-01-22 19:52:48 +00:00
Art4
179ccbc08c Merge branch 'develop' into mark-internal-code 2025-01-22 19:46:49 +00:00
Hypolite Petovan
8df84ed217
Merge pull request #14716 from Art4/fix-load-hooks
Fix App not loading Hooks
2025-01-22 14:29:02 -05:00
Hypolite Petovan
0b227b50b8
Merge pull request #14694 from Art4/deprecation-process
Backward Compatibility Promise
2025-01-22 12:04:13 -05:00
Art4
65b79b5ea0 Remove unused AbstractConsole 2025-01-22 15:57:21 +00:00
Art4
23fcb4f87f Dont show deprecation message twice 2025-01-22 15:47:49 +00:00
Art4
69830b9c03 Move deprecation message into bin-files 2025-01-22 15:43:26 +00:00
Art4
700cedd69b Mark DI::getDice() as internal 2025-01-22 15:31:11 +00:00
Art4
92aabbdcec Mark App as final and internal 2025-01-22 15:24:32 +00:00
Art4
a6c1b2eaf3 Change BC promise to 5 months, fix some wording 2025-01-22 14:59:01 +00:00
Art4
ed184ab520 Revert "Inject Mode into App::runFrontend() via parameter"
This reverts commit 52c6f93c9a.
2025-01-22 13:58:50 +00:00
Art4
5a40fdd7e1 Call App::load() on App::processConsole() and procesEjabberd() 2025-01-22 13:53:30 +00:00
Art4
c9bcc45d7c Provide $_SERVER to App::processConsole() 2025-01-22 13:47:58 +00:00
Art4
15446f35a5 Inject AppHelper into App::loadDefaultTimezone() via parameter 2025-01-22 13:19:17 +00:00
Art4
7cc37ff2cb Inject AppHelper into App::load() via parameter 2025-01-22 13:17:53 +00:00
Art4
e57424ec35 Inject profiler into App::load() via parameter 2025-01-22 12:46:24 +00:00
Art4
6c0a2eaefc Inject config into App::loadDefaultTimezone() via parameter 2025-01-22 12:36:14 +00:00
Art4
fdb14f23f2 Inject config into App::load() via parameter 2025-01-22 12:13:57 +00:00
Art4
52c6f93c9a Inject Mode into App::runFrontend() via parameter 2025-01-22 12:11:06 +00:00
Art4
76aec2d575 Inject Mode into App::load() via parameter 2025-01-22 12:06:53 +00:00
Art4
064b70f4c0 Move Mode::setExecutor() call inside App::runFrontend() 2025-01-22 11:59:24 +00:00
Art4
bf28afb651 Remove dependency for ServerRequestInterface in App::load() 2025-01-22 11:56:23 +00:00
Art4
b9f5a4f745 Rename back App::load() 2025-01-22 10:53:34 +00:00
Art4
ac187f1e9c Merge branch 'develop' into deprecation-process 2025-01-22 10:31:50 +00:00
Art4
6309d4c43d Merge branch 'develop' into fix-code-style-for-pr-14688 2025-01-22 09:07:59 +00:00
Michael
1eaab5e410 Issue 14692: Prevent loops with remote servers 2025-01-22 06:42:47 +00:00
Michael
c6a9e7aa4c New option to only update contacts with local relations 2025-01-22 06:40:04 +00:00
Michael Vogel
bb252e326f
Merge pull request #14688 from Art4/refactor-logger-class-with-logger-object
Replace Logger class with LoggerInterface implementation
2025-01-22 07:20:26 +01:00
Tobias Diekershoff
3080250888
Merge pull request #14715 from MarekBenjamin/bugfix/photoalbum-button-appeareance
fix photo albums button appeareance for dark appereance in frio theme
2025-01-22 06:22:22 +01:00
Marek Bachmann
8c8067c624 fixed button readabilid in media browser for dark appereance in frio theme 2025-01-21 19:27:15 +00:00
Tobias Diekershoff
ee25c69cd7
Merge pull request #14708 from annando/exception
Fix exception "Argument #2 ($jsonld) must be of type array, string given"
2025-01-19 17:36:54 +01:00
Michael
d2b1eaaaa9 Fix codestyle 2025-01-19 13:26:22 +00:00
Michael
d42b31bee6 Fix exception "Argument #2 ($jsonld) must be of type array, string given" 2025-01-19 13:24:59 +00:00
Artur Weigandt
11593bb887
Adjust fromat 2025-01-16 16:07:32 +01:00
Tobias Diekershoff
cd79d26ed5
Merge pull request #14703 from annando/atp-archive
Improved handling of archive posts
2025-01-16 06:36:09 +01:00
Michael
860dbacf1b Fixed codestyle 2025-01-15 21:52:44 +00:00
Michael
aad362fee3 Improved handling of archive poszs 2025-01-15 21:51:10 +00:00
Art4
e8df01fab6 Merge branch 'develop' into deprecation-process 2025-01-14 19:31:59 +00:00
Artur Weigandt
3dc467e208
Increase BC to 6 months 2025-01-14 20:29:20 +01:00
Artur Weigandt
3801382ffe
Update doc/Developers-Intro.md 2025-01-14 19:52:03 +01:00
Jakobus Schürz
6e6903e073 add upload for video/*, audio/* and application/* via dropzone
Upload videos, audios and documents (all mimetype application/*) via
Drag&Drop and Copy&Paste in new postings and comments as attachments.
The same as images before with placeholder on insert-position.
You can write text while upload is done.
2025-01-14 11:17:48 +01:00
Art4
3698ab5aaa Merge branch 'refactor-logger-class-with-logger-object' into fix-code-style-for-pr-14688 2025-01-14 09:29:35 +00:00
Art4
04161a0a5f Merge branch 'develop' into refactor-logger-class-with-logger-object 2025-01-14 09:16:06 +00:00
Tobias Diekershoff
f3106097af
Merge pull request #14697 from annando/updatecontact
Only update a contact when it should be updated
2025-01-14 07:36:33 +01:00
Michael
8345ada757 Fixed codestyle 2025-01-14 06:06:39 +00:00
Michael
dc382b5288 Changed contact update rule / added logging 2025-01-14 06:06:28 +00:00
Jakobus Schürz
c47323e358 do not change cursor position while replacing upload-placeholder
fixes #14695

Save caret position just before replacing the upload-placeholder.
replace upload-placeholder
Set caret position to the position in textarea as before replacing action.
Setting caret position considers the position before or after
placeholder and therefore the textlength of server-response to find the
right place.
2025-01-14 05:49:48 +01:00
Artur Weigandt
34e6d29d1f
Apply suggestions from code review 2025-01-13 23:56:27 +01:00
Art4
0de00003c6 add Backward Compatibility Promise 2025-01-13 22:38:07 +00:00
Art4
581f4c6194 Merge branch 'develop' into introduce-phpmd 2025-01-13 21:22:52 +00:00
Art4
1a391fc9c3 Merge branch 'develop' into refactor-logger-class-with-logger-object 2025-01-13 19:19:45 +00:00
Hypolite Petovan
47946b1cb7
Merge pull request #14682 from Art4/refactor-logger
Create LoggerManager
2025-01-13 13:31:35 -05:00
Art4
3eab8eb3dd Merge branch 'develop' into refactor-logger 2025-01-13 16:54:48 +00:00
Art4
f9b7b6a413 Clean private static properties of LoggerManager via tearDown method 2025-01-13 16:52:05 +00:00
Art4
39088ab003 Clean static private properties of LoggerManager after test 2025-01-13 16:41:35 +00:00
Art4
c1dde29ef6 Add description for LegacyLoggerFactory 2025-01-13 15:17:20 +00:00
Art4
d38edfc6ca Fix code style 2025-01-13 13:40:31 +00:00
Art4
0e59dba914 Fix code style 2025-01-13 13:31:54 +00:00
Art4
d4697a17a3 Remove unused import statements 2025-01-13 13:27:50 +00:00
Art4
5caa3b13e6 Remove call of non-existing Logger::init() method in tests 2025-01-13 13:24:40 +00:00
Art4
abe6bf7947 Replace Logger with DI::logger() in OnePoll Worker classes 2025-01-13 13:21:19 +00:00
Art4
90a76ec60b Replace Logger with DI::logger() in Notifier Worker classes 2025-01-13 13:20:33 +00:00
Art4
8fe3383976 Replace Logger with DI::logger() in many Worker classes 2025-01-13 13:19:24 +00:00
Art4
1762d1e72d Replace Logger with DI::logger() in Remove Worker classes 2025-01-13 13:13:50 +00:00
Art4
c90b485089 Replace Logger with DI::logger() in Process Worker classes 2025-01-13 13:07:14 +00:00
Art4
bcf784254f Replace Logger with DI::logger() in Expire Worker classes 2025-01-13 13:06:00 +00:00
Art4
c2f65af8bf Replace Logger with DI::logger() in Update Worker classes 2025-01-13 13:04:29 +00:00
Art4
0ce0aa4d2c Replace Logger with DI::logger() in Util classes 2025-01-13 12:53:09 +00:00
Art4
9306a56da0 Replace Logger with DI::logger() in Security classes 2025-01-13 12:47:34 +00:00
Art4
bc53c9b208 Replace Logger with DI::logger() in ActivityPub Protocol classes 2025-01-13 12:45:38 +00:00
Art4
6de75e4b9b Replace Logger with DI::logger() in ZOT Protocol class 2025-01-13 12:40:44 +00:00
Art4
ab1e0638fb Replace Logger with DI::logger() in Relay Protocol class 2025-01-13 12:39:50 +00:00
Art4
bf8df261ad Replace Logger with DI::logger() in Feed Protocol class 2025-01-13 12:39:20 +00:00
Art4
d4afcc0b7e Replace Logger with DI::logger() in Email Protocol class 2025-01-13 12:38:48 +00:00
Art4
6ead2d1738 Replace Logger with DI::logger() in Diaspora Protocol class 2025-01-13 12:37:44 +00:00
Art4
abc456e587 Replace Logger with DI::logger() in Delivery Protocol class 2025-01-13 12:37:29 +00:00
Art4
5d6be2aeb4 Replace Logger with DI::logger() in DFRN Protocol class 2025-01-13 12:36:39 +00:00
Art4
c335754dec Change static methods to dynamic in Mastodon Search class 2025-01-13 12:07:05 +00:00
Art4
33b5ba35d4 Replace Logger with DI::logger() in Object classes 2025-01-13 12:01:48 +00:00
Art4
0b20a9c923 Replace Logger with DI::logger() in Network classes 2025-01-13 11:58:35 +00:00
Art4
c6cef6bbce Replace Logger with $this->logger in all Module classes 2025-01-13 11:56:22 +00:00
Art4
d4873dbc6b Replace Logger with $this->logger in Module Twitter classes 2025-01-13 11:55:30 +00:00
Art4
b0a5494a8f Replace Logger with $this->logger in Module Mastodon classes 2025-01-13 11:53:38 +00:00
Art4
6f91b16403 Replace Logger with $this->logger in Module OAuth classes 2025-01-13 11:43:47 +00:00
Art4
c9588fcbb0 Replace Logger with $this->logger in Module ActivityPub classes 2025-01-13 11:41:58 +00:00
Art4
8643231019 Replace Logger with $this->logger in Module classes 2025-01-13 11:00:50 +00:00
Art4
105c737609 Replace Logger with $this->logger in Module BaseApi class 2025-01-13 10:32:57 +00:00
Art4
f817308080 Replace Logger with DI::logger() in Moderation classes 2025-01-13 10:17:26 +00:00
Art4
a0e2c82c62 Replace Logger with DI::logger() in Model classes 2025-01-13 10:16:02 +00:00
Art4
5b4faf811f Replace Logger with DI::logger() in Model Contact classes 2025-01-13 10:04:49 +00:00
Art4
b88fd9168f Replace Logger with DI::logger() in Factory classes 2025-01-13 10:00:51 +00:00
Art4
39448160f1 Replace Logger with DI::logger() in Model Post classes 2025-01-13 09:51:46 +00:00
Art4
615f96012f Replace Logger with DI::logger() in Database classes 2025-01-13 09:44:21 +00:00
Art4
0213001acb Replace Logger with DI::logger() in Worker classes 2025-01-13 09:41:37 +00:00
Art4
e3cf6b9c54 Replace Logger with DI::logger() in Core classes 2025-01-13 09:39:19 +00:00
Art4
8c89c37775 Replace Logger with DI::logger() in Content namespace 2025-01-13 09:32:41 +00:00
Art4
d4c90d41a0 remove unused Logger imports 2025-01-13 09:26:08 +00:00
Art4
ef0fe65c07 Replace Logger with DI::logger() in mod folder 2025-01-13 08:56:33 +00:00
Art4
ace375aacb Replace Logger with DI::logger() in theme folder 2025-01-13 08:55:34 +00:00
Art4
16d3c36391 Replace Logger with DI::logger() in update.php 2025-01-13 08:54:34 +00:00
Art4
6fc6fa0f41 Merge branch 'develop' into refactor-logger-class-with-logger-object 2025-01-13 08:04:17 +00:00
Hypolite Petovan
71e47ce976
Merge pull request #14683 from annando/issue-14681
Issue 14681: enable path "remote_follow/{nickname}"
2025-01-12 22:47:27 -05:00
Hypolite Petovan
5de04f965a
Merge pull request #14687 from Art4/fix-console-addon-list
Fix list enabled/disabled addons
2025-01-12 22:46:55 -05:00
Art4
cb7534c823 Replace Logger with DI::logger() in Contact namespace 2025-01-12 21:14:33 +00:00
Art4
bf3004e4bf Replace Logger with DI::logger() in Page and BaseModule class 2025-01-12 21:13:19 +00:00
Art4
e7eaa8d8a9 Add composer script to partial fix code style 2025-01-12 21:04:38 +00:00
Art4
7b241cebeb Fix code style 2025-01-12 20:48:53 +00:00
Art4
9fbdbcb054 Fix list enabled/disabled addons 2025-01-12 20:38:55 +00:00
Hypolite Petovan
1a68fed349
Merge pull request #14678 from xundeenergie/dropzone-placeholder
Dropzone placeholder
2025-01-12 08:32:52 -05:00
Art4
148c9cdfe6 Fix PHP warning 2025-01-12 13:20:01 +00:00
Art4
ea35ec4d6e Rename method to setup logger 2025-01-12 13:19:47 +00:00
Art4
9d09b10537 Remove unused Friendica\Core\Logger::enableWorker() and disableWorker() 2025-01-12 13:07:05 +00:00
Art4
2f811f99de Fix PHPStan error, fix code style 2025-01-12 13:04:49 +00:00
Art4
7ebb57c82b Fix code style 2025-01-12 08:23:45 +00:00
Art4
510f4e02c8 Add support for WorkerLogger decorator in LoggerManager, deprecate core Logger class, deprecate DI::workerLogger() 2025-01-12 08:21:30 +00:00
Michael
dbf42db0fc Issue 14681: enable path "remote_follow/{nickname}" 2025-01-12 07:33:33 +00:00
Art4
0804413c41 LegacyLoggerFactory uses Logger as factory 2025-01-11 21:05:35 +00:00
xundeenergie
5c3aba176d
Update view/js/dropzone-factory.js
accept suggestion

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-01-11 18:22:16 +01:00
xundeenergie
da9f9d8964
Update view/js/dropzone-factory.js
accept suggestion

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-01-11 18:22:00 +01:00
xundeenergie
61e0a2a0f4
Update view/js/dropzone-factory.js
accept suggestion

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-01-11 18:21:33 +01:00
Art4
b40db06ef3 Merge branch 'develop' into refactor-logger 2025-01-11 17:08:07 +00:00
Hypolite Petovan
6c43cac067
Merge pull request #14677 from Art4/refactor-container
Refactor Container and App class
2025-01-11 11:37:54 -05:00
Art4
48154a090a Create LoggerManager::changeLogChannel() 2025-01-11 08:05:50 +00:00
Jakobus Schürz
f55ed01fb5 enable dropzone on jot for mentions 2025-01-10 23:26:15 +01:00
Art4
d9af357663 Create LegacyLoggerFactory 2025-01-10 21:58:21 +00:00
Jakobus Schürz
29cb0211db add placeholder for uploading images 2025-01-10 18:53:43 +01:00
Art4
2df76617c1 Rename LoggerFactory into LoggerManager 2025-01-10 15:21:56 +00:00
Art4
c339dc1a07 Add support for LogLevel and LogChannel 2025-01-10 15:15:58 +00:00
Art4
96af0e6ebb LoggerFactory can create ProfilerLogger 2025-01-10 13:28:42 +00:00
Art4
f65a838594 Always return NullLogger if debug is disabled 2025-01-10 12:36:13 +00:00
Art4
4a8533aa11 LoggerFactory returns same object 2025-01-10 10:33:55 +00:00
Art4
9bcb470caa Create new LoggerFactory 2025-01-10 10:30:11 +00:00
Jakobus Schürz
d0ccd5d263 remove unneeded newlines 2025-01-10 09:40:09 +01:00
Art4
a5d4475f45 Increase class complexity rule to 700 2025-01-10 07:27:21 +00:00
Art4
b845524134 Move Item::getGravity() into ItemInserter 2025-01-09 21:21:42 +00:00
Art4
27ba28237a Move Item::prepareItemData() into ItemInserter 2025-01-09 21:04:12 +00:00
Art4
61a975bf36 Extract Item::prepareOriginPost() into ItemInserter 2025-01-09 20:57:39 +00:00
Art4
9b9432090b fix return type 2025-01-09 20:36:43 +00:00
Art4
53f046a74d Extract handleToplevelParent into own method 2025-01-09 20:30:39 +00:00
Art4
e93ff4243f extract Item::prepareItemD() into own method 2025-01-09 20:19:35 +00:00
Art4
7107acb15c Fix namespace for DiceContainer test 2025-01-09 19:53:47 +00:00
Art4
2a7f7af02c extract validating item data into separate method 2025-01-09 15:39:26 +00:00
Art4
92ae748498 Fix missing variable 2025-01-09 15:24:13 +00:00
Art4
5315ec0c10 Add license file for phpmd ruleset 2025-01-09 14:16:33 +00:00
Art4
f1af52baa1 Merge branch 'develop' into introduce-phpmd 2025-01-09 14:05:47 +00:00
Art4
2ef943394d Remove Container::setup() 2025-01-09 13:35:03 +00:00
Art4
f1dba9f89e Move setupLegacyServiceLocator() into App class 2025-01-09 13:34:10 +00:00
Art4
2f3ef5359f Remove unused import 2025-01-09 10:18:11 +00:00
Art4
7f643aadd8 Move setupContainerForLogger() and determine log channel into App class 2025-01-09 10:13:33 +00:00
Art4
870b3b9a1c Remove default logchannel from Container::setup() 2025-01-09 09:34:43 +00:00
Art4
f40fb6b099 Fix code style 2025-01-09 09:21:10 +00:00
Art4
27fa4c0cdf Remove Dice rules for unused $devLogger service 2025-01-09 09:16:52 +00:00
Art4
0869140756 remove unused DI::devLogger() method 2025-01-09 09:10:09 +00:00
Art4
08a50efb08 remove unused Logger::devLog() method 2025-01-09 09:08:14 +00:00
Art4
633c692083 Move registerErrorHandler() into App class 2025-01-09 08:53:07 +00:00
Art4
04fb9dd9e0 Move registerTemplateEngine() into App class 2025-01-09 08:36:47 +00:00
Art4
768d7961a6 Move setupContainerForAddons() into App 2025-01-09 08:17:43 +00:00
Art4
e899127137 Deprecate Container::setup() 2025-01-09 08:11:38 +00:00
Art4
57c96b89a1 Remove unused import 2025-01-08 23:10:31 +00:00
Art4
c762c62029 Remove DiceContainer::fromDice() 2025-01-08 23:00:38 +00:00
Art4
320fe18654 Create Container interface, add DiceContainer as implementation 2025-01-08 22:59:29 +00:00
Art4
316fac0161 Add tests for Container::fromBasePath() 2025-01-08 22:52:30 +00:00
Art4
37ffeb8121 Move creation of Dice into Container class 2025-01-08 22:35:27 +00:00
Art4
610267a3ea Move Console call into App class 2025-01-08 22:20:06 +00:00
Art4
744bf9f971 Fix depreation message for old bin files 2025-01-08 22:07:16 +00:00
Michael Vogel
275b383be7
Merge pull request #14671 from MrPetovan/bug/14469-content-after-post
Force exits in PushSubscription PUT, POST and DELETE handlers
2025-01-07 23:29:47 +01:00
Philipp
ae8450f4fb Make PHP-CS happy 2025-01-07 06:42:04 -05:00
Hypolite Petovan
f53292cb11 Force exits in PushSubscription PUT, POST and DELETE endpoints
- These add their own content to the response, which makes rawContent() redundant
2025-01-07 06:42:04 -05:00
Hypolite Petovan
4d146c93d4 Update messages.po main translation file 2025-01-07 06:42:04 -05:00
Hypolite Petovan
a7210f76d1 Revert "Fix installation"
This reverts commit 67a8c5073c.
2025-01-07 06:42:04 -05:00
Hypolite Petovan
101f0e8181 Revert "QuickFix: 2FA - App specific password"
This reverts commit dc4eac2742.
2025-01-07 06:42:04 -05:00
Hypolite Petovan
ef9c2cb223 Revert "Issue 14325: Process "post" requests only once"
This reverts commit 0b710ce4fb.
2025-01-07 06:42:04 -05:00
Hypolite Petovan
f6afc5a2bb
Merge pull request #14675 from annando/get
New function to handle "get" requests
2025-01-07 06:40:50 -05:00
Michael
e090fd4495 Improved code style 2025-01-06 22:15:41 +00:00
Michael
8e76d13a96 New function to handle "get" requests 2025-01-06 22:04:45 +00:00
Hypolite Petovan
c2eae676bf
Merge pull request #14659 from nupplaphil/feat/worker_console
Move 'bin/worker.php' to 'bin/console.php worker'
2025-01-06 14:42:00 -05:00
Philipp
c4f15706ee
Add cons 2025-01-06 18:59:22 +01:00
Philipp
127e522ed8
Update deprecated version 2025-01-06 18:45:33 +01:00
Philipp
b9dde78466
Centralize deprecated check 2025-01-05 23:13:49 +01:00
Philipp
77c9f54f5c
Fix default log channel 2025-01-05 23:13:48 +01:00
Philipp
be8fe24b6e
Make PHP-CS happy 2025-01-05 23:13:47 +01:00
Philipp
f1e93be694
Use correct typing 2025-01-05 23:13:46 +01:00
Philipp
22ce079222
Make PHP-CS happy :-) 2025-01-05 23:13:45 +01:00
Philipp
560bf345da
Add UnitTest for Container 2025-01-05 23:13:44 +01:00
Philipp
2238ea8d52
Add license 2025-01-05 23:13:43 +01:00
Philipp
c726675189
Add doc & fix test 2025-01-05 23:13:43 +01:00
Philipp
b7a0c53b0b
Update src/Console/Worker.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-01-05 23:13:42 +01:00
Philipp
5fe9d53cfa
Fixup LogChannels 2025-01-05 23:13:41 +01:00
Philipp
40fbb02149
Move Container logic into own class 2025-01-05 23:13:41 +01:00
Philipp
6d77eb9b10
Make PHP-CS happy 2025-01-05 23:13:40 +01:00
Philipp
eb0c38f90f
Adapt run-command for console.php executions 2025-01-05 23:13:40 +01:00
Philipp
c79f0c83a7
Replace 'bin/worker.php' calls and help 2025-01-05 23:13:39 +01:00
Philipp
7b952e3c94
Replace 'bin/daemon.php' and 'bin/jetstream.php' calls and help 2025-01-05 23:13:38 +01:00
Philipp
8f43ab9573
Update doc 2025-01-05 23:13:37 +01:00
Philipp
c58cd835d2
Move 'bin/worker.php' to 'bin/console.php worker' 2025-01-05 23:13:37 +01:00
Philipp
07c4e606e1
Merge pull request #14673 from annando/issue-14275
Issue 14275: Avoid "Data too long" error
2025-01-05 22:03:55 +00:00
Michael
c2e940c4f9 Code Style fixed for "Photo.php" 2025-01-05 21:43:16 +00:00
Michael
fff8cf1c34 Issue 14275: Avoid "Data too long" error 2025-01-05 21:35:06 +00:00
Hypolite Petovan
7a7a74d93e
Merge pull request #14668 from annando/mime
Use the fetched mimetype if present / improved detection of quoted posts
2025-01-05 10:34:24 -05:00
Michael
9bcd00bfa8 Fix code style Receiver.php 2025-01-05 08:48:02 +00:00
Michael
8d1971e0b2 Fix code style Media.php 2025-01-05 08:29:10 +00:00
Michael
503e33a683 Use the fetched mimetype if present 2025-01-04 22:19:16 +00:00
Philipp
1c63cc7ee9
Merge pull request #14663 from MrPetovan/bug/fatal-errors
Restore template engine registration for Worker execution
2025-01-03 09:43:02 +00:00
Hypolite Petovan
c2dbd40027 Restore template engine registration for Worker execution
- Template engine is used in BBCode processing
2025-01-02 18:30:30 -05:00
Hypolite Petovan
e177ad55c1
Merge pull request #14660 from annando/set-quote-id
Set the quote-uri-id when a post is linked
2025-01-02 12:05:35 -05:00
Michael
4a61867f79 Set the quote-uri-id when a post is linked 2025-01-02 16:57:30 +00:00
Hypolite Petovan
28b26c892b
Merge pull request #14658 from tobiasd/20250102-note
CHANGELOG note for 2025.02
2025-01-02 08:42:11 -05:00
Tobias Diekershoff
4198236f6a
Update CHANGELOG
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-01-02 14:37:53 +01:00
Hypolite Petovan
8215b5de83
Merge pull request #14655 from nupplaphil/feat/worker_daemon
Add JetStream to Console
2025-01-02 07:40:03 -05:00
Philipp
0d2419e402
updated message 2025-01-02 13:06:42 +01:00
Philipp
efa912c373
Add deprecation notice 2025-01-02 13:03:28 +01:00
Philipp
9cdc1dde0e
remove dependency 2025-01-02 12:54:46 +01:00
Philipp
1f9e1285af
Move Addon/Hook dependency where it belongs :) 2025-01-02 12:54:45 +01:00
Philipp
96332720e5
Update messages.po ... 2025-01-02 12:54:43 +01:00
Philipp
320103af77
Make PHP-CS even more happy :) 2025-01-02 12:54:42 +01:00
Philipp
bc5d3b6c3a
Apply suggestions from code review
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2025-01-02 12:54:40 +01:00
Philipp
2b5882855b
Make PHP-CS even more happy :) 2025-01-02 12:54:39 +01:00
Philipp
f2ce5647f2
Make PHP-CS super-happy :) 2025-01-02 12:54:37 +01:00
Philipp
3e5872d0b1
Add docs :-) 2025-01-02 12:54:35 +01:00
Philipp
3d2524532f
Add Jetstream daemon to console 2025-01-02 12:54:34 +01:00
Philipp
64e66acb01
Add system daemon class 2025-01-02 12:54:19 +01:00
Tobias Diekershoff
b2ea4dbab7 CHANGELOG note for 2025.02
This adds a note to the CHANGELOG so the important deprecation information is not forgotten.

see #14642
2025-01-02 07:42:07 +01:00
Hypolite Petovan
092958441b
Merge pull request #14656 from nupplaphil/feat/fix-codestyle
Add `bin/dev/fix-codestyle.sh`
2025-01-01 21:01:34 -05:00
Philipp
ad549cc5d6
Execute COMMAND=fix TARGET_BRANCH=develop bin/dev/fix-codestyle.sh 2025-01-02 02:03:58 +01:00
Philipp
0ff7a1c72b
temporary add App.php 2025-01-02 02:01:34 +01:00
Philipp
7cead7b168
Add fix-codestyle.sh 2025-01-02 02:01:31 +01:00
Michael Vogel
999d5d58ec
Merge pull request #14645 from MrPetovan/docs/making-new-friends
Fix links in Quick-Start-makingnewfriends
2025-01-01 22:56:00 +01:00
Michael Vogel
d540ec7f8d
Merge pull request #14654 from MrPetovan/bug/14607-view-group
Prevent contact id = 0 case in VCard
2025-01-01 22:54:06 +01:00
Hypolite Petovan
e3aa9b8121 Prevent contact id = 0 case in VCard 2025-01-01 16:17:31 -05:00
Hypolite Petovan
c0d4cb918a Fix links in Quick-Start-makingnewfriends
- Update German version as well
2025-01-01 15:51:26 -05:00
Hypolite Petovan
d2dce46184
Merge pull request #14652 from nupplaphil/ci/stable_pick
[CI] Fix releaser
2025-01-01 15:45:29 -05:00
Philipp
0ece5a530c [CI] Fix releaser 2025-01-01 15:45:06 -05:00
Hypolite Petovan
ee9f6d73d6
Merge pull request #14653 from nupplaphil/fix/messages_po
Fix messages.po - Happy new year ;-)
2025-01-01 15:40:06 -05:00
Philipp
ec2fefee30
Fix messages.po - Happy new year ;-) 2025-01-01 20:31:42 +01:00
Hypolite Petovan
8b47378720 Welcome version 2025.02-dev!
# Conflicts:
#	CHANGELOG
#	VERSION
#	database.sql
#	src/App.php
#	view/lang/C/messages.po
2025-01-01 12:16:35 -05:00
Hypolite Petovan
acf98cc6d4
Merge pull request #14642 from nupplaphil/feat/console/daemon
Moving the daemon to a Console class
2024-12-30 11:50:53 -05:00
Philipp
eebc2d9a79
Don't feed the daemons! 2024-12-30 17:48:53 +01:00
Philipp
a5649bdaeb
Make PHP-CS happy 2024-12-30 12:46:24 +01:00
Philipp
22ce71e792
Move daemon to Console Command 2024-12-30 12:41:14 +01:00
Philipp
b0ec3ad0c9
Move daemon to Console Command 2024-12-30 12:40:42 +01:00
Hypolite Petovan
afa2969b39
Merge pull request #14637 from Art4/refactor-entrypoint-jetstream.php
Refactor entrypoint `jetstream.php`
2024-12-29 10:51:54 -05:00
Art4
515ae7693b Merge branch 'develop' into refactor-entrypoint-jetstream.php 2024-12-29 07:43:27 +00:00
Hypolite Petovan
3f39b6366f
Merge pull request #14628 from Art4/refactor-entrypoint-worker.php
Refactor entrypoint `worker.php`
2024-12-28 20:11:41 -05:00
Hypolite Petovan
f484dc8bd8
Merge pull request #14635 from Art4/remove-dice-from-router
Remove DICE from router
2024-12-28 20:07:45 -05:00
Art4
3309bc818a Fix duplicate usage of the $mode variable 2024-12-28 23:36:15 +00:00
Art4
0fd84f5864 Let phpstan check the jetstream.php file 2024-12-28 23:04:50 +00:00
Art4
84d7188f0c remove unused use statements 2024-12-28 23:01:22 +00:00
Art4
1bfcd0ac6e refactor App::processJetstream 2024-12-28 23:00:23 +00:00
Art4
8fef32b954 run setup functions 2024-12-28 22:57:24 +00:00
Art4
318c57df12 Inline jetstream.php code into App::processJetstream() 2024-12-28 22:53:54 +00:00
Art4
6e44d6c7e4 add shutdown handler as anonymous function 2024-12-28 22:50:49 +00:00
Art4
24ce6180c4 require dice dependency 2024-12-28 22:44:23 +00:00
Art4
bb0900093d refactor chdir() call 2024-12-28 22:39:20 +00:00
Art4
dde8291597 Move getModule() code into App class 2024-12-28 16:36:07 +00:00
Art4
4d0a695588 use $dice_profiler_threshold in Router not as property 2024-12-28 16:30:33 +00:00
Art4
fa315cf44a remove constructor injection of Dice in Router 2024-12-28 13:10:28 +00:00
Art4
182732b112 Extract create module into own method 2024-12-28 13:07:07 +00:00
Art4
7cb962de82 move Router creation into App::runFrontend() 2024-12-28 12:58:09 +00:00
Art4
126ec1977b Merge branch 'develop' into refactor-entrypoint-worker.php 2024-12-28 07:01:04 +00:00
Hypolite Petovan
5af1dce914
Merge pull request #14626 from Art4/refactor-entrypoint-daemon.php
Refactor entrypoint `daemon.php`
2024-12-27 15:16:35 -05:00
Art4
84f4c8d3fa Merge branch 'refactor-entrypoint-daemon.php' into refactor-entrypoint-worker.php 2024-12-27 18:55:27 +00:00
Art4
f0824903b9 Merge branch 'develop' into refactor-entrypoint-daemon.php 2024-12-27 18:55:05 +00:00
Hypolite Petovan
02662ecd11
Merge pull request #14625 from Art4/refactor-entrypoint-console.php
Refactor entrypoint `console.php`
2024-12-27 10:03:58 -05:00
Art4
83a3bc44af Split method Item::insert() 2024-12-27 11:45:28 +00:00
Art4
5d5d1ca7b2 Merge branch 'develop' into introduce-phpmd 2024-12-27 11:28:55 +00:00
Art4
030905fafa Merge branch 'refactor-entrypoint-daemon.php' into refactor-entrypoint-worker.php 2024-12-27 11:19:17 +00:00
Art4
82d987cb1d Merge branch 'refactor-entrypoint-console.php' into refactor-entrypoint-daemon.php 2024-12-27 11:19:00 +00:00
Art4
1fab37f74e Merge branch 'develop' into refactor-entrypoint-console.php 2024-12-27 11:02:42 +00:00
Hypolite Petovan
e3067095f4
Merge pull request #14616 from Art4/refactor-dice-rules
Refactor DICE rules
2024-12-26 23:23:59 -05:00
Art4
04e92766fc Refactor calling process repository 2024-12-26 19:29:23 +00:00
Art4
867eba7381 Replace DI::basePath() with BasePath service 2024-12-26 19:17:18 +00:00
Art4
caec1ed576 replace DI::mode() with container 2024-12-26 19:15:33 +00:00
Art4
3ae9ae8728 use registerErrorHandler() in processWorker() 2024-12-26 19:13:34 +00:00
Art4
e0a249f9a4 Refactor r init service locator 2024-12-26 19:12:32 +00:00
Art4
31deac5117 Refactor setup Container for Logger 2024-12-26 19:11:54 +00:00
Art4
8edca631e6 Refactor setup Container for addons 2024-12-26 19:11:21 +00:00
Art4
c5d7f26a8c Move code from worker.php into App::processWorker() 2024-12-26 19:04:27 +00:00
Art4
bb9e09ef51 check worker.php with PHPStan 2024-12-26 18:58:07 +00:00
Art4
2d1142743e Merge branch 'refactor-entrypoint-daemon.php' into refactor-entrypoint-worker.php 2024-12-26 18:44:15 +00:00
Art4
0300447298 Merge branch 'refactor-entrypoint-console.php' into refactor-entrypoint-daemon.php 2024-12-26 18:42:47 +00:00
Art4
9d25db0e86 Merge branch 'develop' into refactor-entrypoint-console.php 2024-12-26 18:37:44 +00:00
Art4
962a76759f Fix indentation 2024-12-26 18:36:40 +00:00
Hypolite Petovan
5518672677
Merge pull request #14623 from Art4/refactor-entrypoint-auth_ejabberd.php
Refactor entrypoint `auth_ejabberd.php`
2024-12-26 12:10:25 -05:00
Art4
e685ff8837 Fix method call for App::setupLegacyServiceLocator 2024-12-26 17:06:41 +00:00
Art4
2623ff5484 Merge branch 'refactor-entrypoint-console.php' into refactor-entrypoint-daemon.php 2024-12-26 17:04:35 +00:00
Art4
adee070ee6 Merge branch 'refactor-entrypoint-auth_ejabberd.php' into refactor-entrypoint-console.php 2024-12-26 17:03:42 +00:00
Art4
2ed1b969fb rename App::setupLegacyServiceLocator() 2024-12-26 16:59:15 +00:00
Art4
bb911296a6 require dice rules 2024-12-26 14:08:40 +00:00
Art4
51b24cbac9 refactor getopt() call 2024-12-26 13:57:46 +00:00
Art4
06f0c6c32c Merge branch 'refactor-entrypoint-daemon.php' into refactor-entrypoint-worker.php 2024-12-26 13:56:49 +00:00
Art4
cdf3361f2a update messages.po 2024-12-26 13:44:57 +00:00
Art4
3c2db734d6 Merge branch 'refactor-entrypoint-daemon.php' into refactor-entrypoint-worker.php 2024-12-26 12:23:07 +00:00
Art4
5ca887d839 Check more bin files with PHPStan 2024-12-26 12:22:39 +00:00
Art4
619cb730ef Fix possible falsy return of getopt() 2024-12-26 12:18:03 +00:00
Art4
40927178f4 refactor chdir() in worker.php 2024-12-26 11:56:25 +00:00
Art4
894cd5814f remove HTTPInputData as argument 2024-12-26 11:41:37 +00:00
Art4
17ff47f6d5 remove dependency to global $_GET 2024-12-26 11:35:32 +00:00
Art4
082ed8745b rename server vars 2024-12-26 11:33:45 +00:00
Art4
a09e182238 work with PSR-7 Request in App::runFrontend() 2024-12-26 11:33:00 +00:00
Art4
11540a8bff Replace DI::system() with container 2024-12-26 10:49:34 +00:00
Art4
aba54ebbbe Replace DI::basePath() with container 2024-12-26 10:46:54 +00:00
Art4
bcbdcbd1ff Replace DI::keyValue() with container 2024-12-26 10:42:41 +00:00
Art4
f3703f433e resolve double used variable name 2024-12-26 10:38:10 +00:00
Art4
81d28bbb4c Replace DI::config() with container 2024-12-26 10:34:32 +00:00
Art4
502d0d1b53 Replace DI::mode() with container 2024-12-26 10:30:09 +00:00
Art4
cb5a1daa40 extract dependency for $_SERVER 2024-12-26 10:27:44 +00:00
Art4
eb0e1c393f Fix indent for HEREDOC 2024-12-26 10:26:10 +00:00
Art4
68e729e192 refactor using registerErrorHandler 2024-12-26 10:18:03 +00:00
Art4
dc65958c17 refactor setup DI 2024-12-26 10:17:22 +00:00
Art4
8ed5dd3a30 refactor setup container for addons and logger 2024-12-26 10:16:01 +00:00
Art4
a2c4585914 simplify class names 2024-12-26 10:13:04 +00:00
Art4
bac5f00190 Move daemon.php code into App::processDaemon() method 2024-12-26 10:07:03 +00:00
Art4
d8509b426d Register shutdown function as anonymous function 2024-12-26 09:31:36 +00:00
Art4
4348b0b873 Move daemon code into anonymous function 2024-12-26 09:30:44 +00:00
Art4
287e50f81a require the dependencies.config.php file 2024-12-26 09:26:23 +00:00
Art4
341f5b46f6 refactor getopt() call 2024-12-26 09:24:12 +00:00
Art4
0cd2b8e2c0 Refactor chdir() call 2024-12-26 09:05:50 +00:00
Art4
38ad97f24f Refactor App::load() method 2024-12-26 08:45:57 +00:00
Art4
ba6bde9b09 move up registerTemplateEngine call 2024-12-26 08:29:11 +00:00
Art4
a6385bed71 Refactor registering template engine 2024-12-26 08:27:02 +00:00
Art4
e9b92aea7b Move call of register the template engine into App 2024-12-26 08:24:19 +00:00
Art4
ffbc7d0ea1 Remove multiple calls of DI::init() 2024-12-26 08:15:20 +00:00
Art4
0afa5aba63 Setup container with explicit LogChannel 2024-12-26 08:10:06 +00:00
Art4
cf8ce380b7 Refactor App::processConsole() 2024-12-26 08:01:30 +00:00
Art4
f40b428ac2 Move code from console.php into App::processConsole() 2024-12-26 07:44:19 +00:00
Art4
907e07a4c4 Replace global $argv with $_SERVER 2024-12-26 07:39:43 +00:00
Art4
486a6ba8c6 require dependencies.config.php file in console.php entry point 2024-12-26 07:29:39 +00:00
Art4
c99958c327 require dependencies.config.php file in index.php entry point 2024-12-26 07:26:04 +00:00
Art4
ed06480e75 Remove comment 2024-12-26 07:00:21 +00:00
Art4
e59dd9d9d4 Merge branch 'develop' into refactor-entrypoint-auth_ejabberd.php 2024-12-26 06:31:21 +00:00
Hypolite Petovan
a8963c3ba2
Merge pull request #14618 from Art4/merge-2024.09-rc-into-develop
Merge `2024.09-rc` into `develop`
2024-12-25 22:38:07 -05:00
Hypolite Petovan
9921abc8bd
Merge pull request #14619 from Art4/remove-di-app-method
Remove `DI::app()`
2024-12-25 22:36:25 -05:00
Hypolite Petovan
90181759cd
Merge pull request #14620 from Art4/refactor-entrypoint-index.php
Refactor entrypoint in `index.php`
2024-12-25 22:27:42 -05:00
Art4
26f1c5f1dc inline App::setupContainerForRunningFrontend() method 2024-12-25 21:27:08 +00:00
Art4
ce7fd1b0e2 extract setup of DI class 2024-12-25 21:20:08 +00:00
Art4
d2f2d1d0b9 Use App::registerErrorHandler() 2024-12-25 21:17:02 +00:00
Art4
f7c661b5e9 Extract call of AddonLoader into App::setupContainerForAddons() 2024-12-25 21:16:00 +00:00
Art4
34b2419427 Move auth_ejabberd.php code into App::processEjabberd() 2024-12-25 21:12:24 +00:00
Art4
e0dadea0ff Refactor path to dice rules 2024-12-25 21:01:24 +00:00
Art4
b94697678e refactor chdir() call 2024-12-25 20:43:15 +00:00
Art4
530a93794f Fix PHPStan error 2024-12-25 18:37:13 +00:00
Art4
d55830902b Reduce cyclomatic complexity in GServer::detect() 2024-12-25 18:33:04 +00:00
Art4
6684f0d5c7 Reduce cyclomatic complexity in APContact::getByURL() 2024-12-25 18:21:27 +00:00
Art4
c83099c8d0 Change output format in Github 2024-12-25 16:17:31 +00:00
Art4
19659296eb enable cache and colors in phpmd 2024-12-25 15:59:16 +00:00
Art4
9ed137a119 Add phpmd as code quality check in github actions 2024-12-25 15:28:05 +00:00
Art4
36dbae7642 Add script to run phpmd with composer 2024-12-25 15:25:34 +00:00
Art4
5fe7af6489 Add very tolerant ruleset for friendica code 2024-12-25 15:19:31 +00:00
Art4
f775d6e049 install phpmd 2024-12-25 10:41:37 +00:00
Art4
7d10d04768 Extract register error handler into separate method 2024-12-23 15:30:42 +00:00
Art4
3c4da64348 Refactor App::setupContainerForRunningFrontend() 2024-12-23 15:28:57 +00:00
Art4
66822c6a81 Rename App variable 2024-12-23 15:26:35 +00:00
Art4
856f8fb908 Move adding Dice rules into App 2024-12-23 15:22:27 +00:00
Art4
ae0cab36dc Improve BasePath tests 2024-12-23 14:51:58 +00:00
Art4
0bd8118673 Fix code style 2024-12-23 14:51:41 +00:00
Art4
dd4fbc0194 Replace Util class names with FQCN 2024-12-23 14:34:57 +00:00
Art4
899ac663fc Replace Network class names with FQCN 2024-12-23 14:34:23 +00:00
Art4
011c098c63 Replace Model class names with FQCN 2024-12-23 14:32:47 +00:00
Art4
c33223a0eb Replace Database class names with FQCN 2024-12-23 14:31:41 +00:00
Art4
ce5789690d Replace Core class names with FQCN 2024-12-23 14:30:14 +00:00
Art4
5edc36d6fc Fix PHPDoc and add link to DICE docs 2024-12-23 14:28:01 +00:00
Art4
31a731deb7 Refactor dependency for $_COOKIE 2024-12-23 14:23:58 +00:00
Art4
48bd6b2f81 Refactor dependency for $basepath 2024-12-23 14:22:52 +00:00
Art4
b4762238ed Replace DiceInstanceManager class names with FQCN 2024-12-23 14:19:31 +00:00
Art4
7587517499 Refactor dependency for $_GET 2024-12-23 14:18:22 +00:00
Art4
c53a75bc38 Refactor dependency for $_SERVER 2024-12-23 14:12:37 +00:00
Art4
5803c1e760 Replace Hooks class names with FQCN 2024-12-23 14:11:45 +00:00
Art4
f1405cdb6c Replace Config class names with FQCN 2024-12-23 14:06:04 +00:00
Art4
4a766b9750 Replace class names with FQCN 2024-12-23 14:03:32 +00:00
Art4
b9b44931ac Remove Dice rules for $basepath 2024-12-23 13:42:01 +00:00
Art4
4deb28f24e Refactor DI::basePath() to use BasePath class 2024-12-23 13:40:53 +00:00
Art4
3a491b879c Replace more calls of dirname() with $basepath 2024-12-23 13:35:46 +00:00
Art4
a0e77032cf remove $basepath from global namespace 2024-12-23 13:34:10 +00:00
Art4
73fb1f1549 Remove DI::app() method 2024-12-23 12:39:11 +00:00
Art4
22b1f871a8 Merge branch 'develop' into refactor-dice-rules 2024-12-23 12:08:38 +00:00
Art4
b1d78e34db Remove checks if result body is not an object 2024-12-23 11:37:52 +00:00
Art4
ae2b6e3bb7 Fix PHPStan errors from upstream 2024-12-23 10:45:15 +00:00
Art4
1b4d0d0bb0 Merge branch '2024.09-rc' into merge-2024.09-rc-into-develop 2024-12-23 10:18:56 +00:00
Hypolite Petovan
19cd11cc8e
Merge pull request #14538 from Art4/restore-github-actions
Add optional GitHub Action for PHP tests
2024-12-22 22:06:58 -05:00
Art4
6f570a08e5 declare strict mode in unit tests 2024-12-22 18:48:46 +00:00
Art4
75772d874f refactor BasePathTest 2024-12-22 18:47:57 +00:00
Art4
704ddc2089 simplify basepath 2024-12-22 18:03:54 +00:00
Art4
9987c90faf Refactor getting the basepath 2024-12-22 16:29:47 +00:00
Art4
b801e176aa Merge database and unit tests into one workflow 2024-12-22 14:36:19 +00:00
Art4
432f28ecd1 merge code quality checks into on workflow 2024-12-22 14:29:13 +00:00
Art4
af4cac91b1 Run PHP-CS-Fixer with PHP 8.3 2024-12-22 07:27:07 +00:00
Art4
f8b96c562a Add codestyle check 2024-12-22 07:23:49 +00:00
Art4
af655ff392 rename workflows and test cases 2024-12-22 07:05:25 +00:00
Art4
9803bd731c Merge branch 'develop' into restore-github-actions 2024-12-22 07:02:24 +00:00
Art4
3b8aac4c55 Add tests with PHP 8.5 2024-12-22 06:56:30 +00:00
Art4
1b4ace329e Rename tests, use composer v2 2024-12-22 06:55:09 +00:00
Art4
dd4467043a Set bin path to phpunit 2024-12-22 06:51:37 +00:00
Art4
57da3416c5 clone addon repository 2024-12-22 06:41:11 +00:00
Art4
ab22464d55 better healtcheck for mariadb 2024-12-22 06:38:16 +00:00
Hypolite Petovan
e7e0ae3784
Merge pull request #14603 from Art4/create-app-from-container
Add `App::fromDice()` factory method
2024-12-21 21:35:01 -05:00
Art4
c949032fc7 Remove src tests 2024-12-20 21:49:34 +00:00
Art4
722164711c test only src tests 2024-12-20 21:36:06 +00:00
Art4
2fba79929d add tests workflow 2024-12-20 21:32:59 +00:00
Art4
81b87e9ca4 Add workflow for unit tests 2024-12-20 21:26:05 +00:00
Art4
d9841eeea3 Add Github workflow for PHPStan 2024-12-20 21:07:53 +00:00
Art4
0bdc1d9f57 Let phpstan check index.php 2024-12-20 20:56:26 +00:00
Art4
2f9f873f4b refactor App::runFrontend() 2024-12-20 13:38:38 +00:00
Art4
7a4542cd50 refactor App 2024-12-20 13:24:25 +00:00
Art4
ea07b83fd0 adjust tests 2024-12-20 13:21:35 +00:00
Art4
0ab9c23bb9 Refactor App::fromDice() 2024-12-20 12:30:26 +00:00
Art4
9e4f39b4fb Inline runFrontend() call into App::processRequest() method 2024-12-20 10:07:59 +00:00
Art4
ee5b210682 Inline mode call into App::processRequest() 2024-12-20 10:05:13 +00:00
Art4
7a7b8d3e27 Inline App::load() call in new processRequest() method 2024-12-20 10:04:02 +00:00
Art4
40fa8559e5 Merge branch 'develop' into create-app-from-container 2024-12-20 09:26:14 +01:00
Hypolite Petovan
3e3fe92567
Merge pull request #14602 from Art4/remove-apphelper-implementation-from-app
Remove `AppHelper` implementation in `App` class
2024-12-19 17:58:14 -05:00
Art4
9ef3fdc857 move load() call outside of constructor to remove side effects 2024-12-19 21:01:41 +00:00
Art4
23e3af4a09 Create tests for App 2024-12-19 20:37:56 +00:00
Art4
af51441d88 require AppHelper in App 2024-12-19 20:26:38 +00:00
Art4
241031f1fa inject container inside app instance 2024-12-19 20:24:24 +00:00
Art4
16bdd76be1 Create PSR-7 request 2024-12-19 20:07:37 +00:00
Art4
d6ec1d7d6b Prevent App class to be used with dependency injection 2024-12-19 20:03:42 +00:00
Art4
d05b2dd8c2 Merge branch 'remove-apphelper-implementation-from-app' into create-app-from-container 2024-12-19 19:51:51 +00:00
Art4
1c4d021b67 Merge branch 'develop' into remove-apphelper-implementation-from-app 2024-12-19 19:50:36 +00:00
Hypolite Petovan
d0d9712ac3
Merge pull request #14593 from Art4/replace-app-with-apphelper-in-tests
Replace App with AppHelper in tests
2024-12-19 07:30:33 -05:00
Art4
ce6ae1d98c Merge branch 'develop' into restore-github-actions 2024-12-18 22:27:07 +00:00
Art4
1c7446bf9a Create App::fromDice() factory method 2024-12-18 22:16:34 +00:00
Art4
23b19b76b5 Provide appHelper in Page run() method 2024-12-18 21:57:39 +00:00
Art4
6b948c82d7 Remove AppHelper implementation from App class 2024-12-18 21:30:36 +00:00
Art4
a583cc9b0e replace more calls of DI::app(), add workaround for tests 2024-12-18 21:19:01 +00:00
Art4
ba65cad1cd Replace DI::app() with DI::appHelper() in more tests 2024-12-18 21:06:55 +00:00
Art4
b2a383a9cb Replace DI::app() with DI::appHelper() in Module\Api\Friendica namespace tests 2024-12-18 20:55:39 +00:00
Art4
1d441ab657 remove unnecessary Di::app() all 2024-12-18 19:57:00 +00:00
Art4
e16d9ace34 Merge branch 'develop' into replace-app-with-apphelper-in-tests 2024-12-18 19:47:57 +00:00
Hypolite Petovan
2ebac8207f
Merge pull request #14599 from Art4/fix-phpstan-errors
Fix phpstan errors
2024-12-16 21:01:36 -05:00
Art4
99d6599747 Merge branch 'fix-phpstan-errors' into replace-app-with-apphelper-in-tests 2024-12-16 22:37:37 +00:00
Art4
228ca0bfac Fix type 2024-12-16 22:36:15 +00:00
Art4
cc9ff34e45 Fix phpstan errors 2024-12-16 22:32:12 +00:00
Art4
c70da6641f Merge branch 'develop' into replace-app-with-apphelper-in-tests 2024-12-16 22:13:47 +00:00
Hypolite Petovan
657ccaf226
Merge pull request #14597 from Art4/rearange-testcases
Rearrange testcases
2024-12-16 09:23:40 -05:00
Hypolite Petovan
65ca688da6
Merge pull request #14598 from Art4/merge-2024.09-rc-into-develop
Merge 2024.09-rc into develop
2024-12-16 09:22:10 -05:00
Hypolite Petovan
012cce1ac7
Merge pull request #14590 from Art4/phpstan-level-2-in-addons
Fix PHPStan errors level 2 in addons
2024-12-16 09:14:29 -05:00
Art4
c6c29b29b1 Merge branch '2024.09-rc' into merge-2024.09-rc-into-develop 2024-12-16 11:06:45 +01:00
Art4
4f1b917e42 Remove unused AppDouble class 2024-12-15 22:15:46 +00:00
Art4
c24d36c02e Merge branch 'rearange-testcases' into replace-app-with-apphelper-in-tests 2024-12-15 22:03:06 +00:00
Art4
f7d8240d2c Merge branch 'develop' into replace-app-with-apphelper-in-tests 2024-12-15 21:58:13 +00:00
Art4
b60f9863c6 clean use statements 2024-12-15 21:51:22 +00:00
Art4
f8bb565fa5 Rename StorageTest with StorageTestCase 2024-12-15 21:36:40 +00:00
Art4
8401b5b0ee rename StorageConfigTest to StorageConfigTestCase 2024-12-15 21:32:23 +00:00
Art4
b09fb1047f Rename AbstractLoggerTest to LoggerTestCase 2024-12-15 21:28:34 +00:00
Art4
75632a1490 Rename LockTest to LockTestCase 2024-12-15 21:15:21 +00:00
Art4
a676e738e0 Rename MemoryCacheTest to MemoryCacheTestCase 2024-12-15 21:09:57 +00:00
Art4
0826cb50bd Rename CacheTest to CacheTestCase 2024-12-15 21:06:49 +00:00
Art4
75fee6784e Rename PConfigTest to PConfigTestCase 2024-12-15 16:13:53 +00:00
Art4
78f7285e00 Merge branch 'develop' into phpstan-level-2-in-addons 2024-12-15 06:57:52 +00:00
Hypolite Petovan
8210f5c7e5
Merge pull request #14584 from Art4/phpstan-level-2
PHPStan level 2
2024-12-14 16:54:02 -05:00
Art4
f3f52efe18 Inline KeyValueStorageTest into DBKeyValueStorageTest 2024-12-14 21:33:16 +00:00
Art4
7e05416da6 Renemae Notification entity alias 2024-12-14 20:12:04 +00:00
Art4
76e5495e15 Remove unused use statement 2024-12-14 14:58:34 +00:00
Art4
59404752f9 Change return type 2024-12-14 14:58:19 +00:00
Art4
6a2e8739d1 Rename variable 2024-12-14 14:53:56 +00:00
Art4
8178f87e61 Rename class alias 2024-12-14 14:49:52 +00:00
Artur Weigandt
18d847275a
Update src/Contact/FriendSuggest/Repository/FriendSuggest.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-12-14 15:45:50 +01:00
Art4
54ee36a6aa Rename ConsoleTest to ConsoleTestCase 2024-12-14 08:16:37 +00:00
Art4
9f8023b91f rename and move ApiTest to ApiTestCase 2024-12-14 07:56:34 +00:00
Art4
cb6269eddb Fix path to tests 2024-12-14 07:55:22 +00:00
Art4
346b42fba5 Fix use statements 2024-12-14 07:55:22 +00:00
Art4
5430d65799 rename DatabaseTest to DatabaseTestCase 2024-12-14 07:55:22 +00:00
Art4
42b543cd24 rename FixtureTest to FixtureTestCase 2024-12-14 07:55:22 +00:00
Art4
ee579280c7 Rename MockedTest to MockedTestCase 2024-12-14 07:55:22 +00:00
Art4
9a28eee477 Add suffix for PHPUnit test cases 2024-12-14 07:55:22 +00:00
Art4
e8c1f4ec2b Fix path to tests 2024-12-13 22:47:32 +00:00
Art4
b3cf518628 rename and move ApiTest to ApiTestCase 2024-12-13 22:42:27 +00:00
Art4
06667fc37c Fix use statements 2024-12-13 22:22:50 +00:00
Art4
4f02c9ca88 rename DatabaseTest to DatabaseTestCase 2024-12-13 22:10:30 +00:00
Art4
c00a7c571a rename FixtureTest to FixtureTestCase 2024-12-13 22:04:16 +00:00
Art4
90f148afaf Merge branch 'phpstan-level-2' into phpstan-level-2-in-addons 2024-12-13 16:04:32 +01:00
Art4
3b694741cc Merge branch 'develop' into phpstan-level-2 2024-12-13 15:59:36 +01:00
Hypolite Petovan
955c8a18f0
Merge pull request #14581 from Art4/phpstan-level-1-in-addons
PHPStan level 1 in addons
2024-12-13 07:46:21 -05:00
Art4
1d177ed907 Rename MockedTest to MockedTestCase 2024-12-11 22:45:17 +00:00
Art4
b378f5b0a7 Add suffix for PHPUnit test cases 2024-12-11 22:44:51 +00:00
Art4
3406dbb29c Merge branch 'phpstan-level-2' into phpstan-level-2-in-addons 2024-12-09 22:46:11 +00:00
Art4
4c80eb98e5 Fix errors from #14578 2024-12-09 22:45:47 +00:00
Art4
3589dca717 Merge branch 'phpstan-level-2' into phpstan-level-2-in-addons 2024-12-09 22:32:03 +00:00
Art4
535baaebcf Merge branch 'phpstan-level-1-in-addons' into phpstan-level-2 2024-12-09 22:31:13 +00:00
Art4
9867bdfcff Fix errors from #14578 2024-12-09 22:26:24 +00:00
Art4
97605498a6 Merge branch 'develop' into phpstan-level-1-in-addons 2024-12-09 22:11:29 +00:00
Hypolite Petovan
65c6cb05ee
Merge pull request #14588 from Art4/merge-2024.09-rc-into-develop
Merge 2024.09-rc branch into develop
2024-12-09 07:09:26 -05:00
Art4
3cd098bfc7 Fix Util Strings 2024-12-08 22:20:20 +00:00
Art4
020d1f6e30 Ignore missing SMTP class in PHPMailer 2024-12-08 21:17:56 +00:00
Art4
cf6d7fbb76 Ignore vender class UnitConverter.php 2024-12-07 22:08:27 +00:00
Art4
5422ba42b6 add checks for addon folder 2024-12-07 21:18:48 +00:00
Art4
98229a5ace clone develop branch of addon repository 2024-12-07 18:23:36 +00:00
Art4
1c43d57233 Merge branch '2024.09-rc' into merge-2024.09-rc-into-develop 2024-12-07 15:40:08 +00:00
Art4
e976126f2e Update messages.po 2024-12-07 15:25:30 +00:00
Art4
c3586cb51a Fix errors in Worker namespace 2024-12-07 15:23:38 +00:00
Art4
7abdc17711 Fix errors in Util namespace 2024-12-07 15:21:21 +00:00
Art4
780bfe0cbe Fix errors in Security namespace 2024-12-07 15:10:13 +00:00
Art4
d4e4c1505b Fix errors in Protocol namespace 2024-12-07 14:45:47 +00:00
Art4
47c2715568 Ignore errors in addon folder 2024-12-07 14:40:10 +00:00
Art4
8aa54fe9fd Ignore missing IMAP\Connection class in PHP 7.4 and 8.0 2024-12-07 14:35:59 +00:00
Art4
053dc2bea5 ignore PHPStan errors for PHP 7.4 compatability 2024-12-07 14:31:24 +00:00
Art4
68ce03797a GdImage is not available on PHP 7.4 2024-12-07 09:01:04 +00:00
Art4
f36e118609 fix non-capturing catch for PHP 7.4 support 2024-12-07 07:11:28 +00:00
Art4
b55dc0ac48 remove unused $e 2024-12-07 07:03:48 +00:00
Art4
2838e3319b remove unnecessary properties from BaseEntity 2024-12-07 06:58:11 +00:00
Art4
99603d3d90 fix errors in Protocoll namespace 2024-12-06 22:55:58 +00:00
Artur Weigandt
d9ab7efcd6
Update src/Module/Security/OpenID.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-12-06 23:23:33 +01:00
Art4
8b15bb9e66 Fix errors in Object namespace 2024-12-06 21:55:04 +00:00
Art4
b35c45bf5a Fix errors in Module namespace 2024-12-06 21:12:29 +00:00
Art4
650e65d4b4 Ignore phpstan error for magic setter in LightOpenID class 2024-12-04 21:53:15 +00:00
Art4
7b892fac9c add comment in Model User 2024-12-04 21:45:13 +00:00
Art4
07e9f0f54a Fix errors in Model namespace 2024-12-04 21:41:41 +00:00
Art4
2c801abb06 Fix errors in Model namespace 2024-12-03 22:46:40 +00:00
Art4
06e3051ad1 Fix errors in Factory namespace 2024-12-03 21:44:35 +00:00
Art4
1fe730f514 Fix errors in Database namespace 2024-12-03 20:36:29 +00:00
Art4
496f0755b1 Fix errors in Core namespace 2024-12-03 20:11:46 +00:00
Art4
6ad1dd72d6 Merge branch 'phpstan-level-1-in-addons' into phpstan-level-2 2024-12-02 19:13:15 +00:00
Art4
867253436d bump to phpstan level 1 2024-12-02 19:02:14 +00:00
Art4
fb4ddb7d8d Merge branch 'develop' into phpstan-level-1-in-addons 2024-12-02 19:01:39 +00:00
Hypolite Petovan
7a8be0e87e
Merge pull request #14571 from Art4/phpstan-level-0-in-addons
Phpstan level 0 in addons
2024-12-02 09:29:16 -05:00
Art4
fb3a3ea7e6 Fix errors in Content namespace 2024-12-01 22:53:53 +00:00
Art4
f628c540a4 Fix errors in Contact namespace 2024-12-01 22:11:04 +00:00
Art4
88f693bb71 Fix errors in Console namespace 2024-12-01 21:24:43 +00:00
Art4
fef844cc68 Fix errors in Collection namespace 2024-12-01 21:03:06 +00:00
Art4
139ddbd1de fix errors in BaseModel 2024-12-01 20:51:57 +00:00
Art4
685e058fe6 bump phpstan to level 2 2024-12-01 20:46:04 +00:00
Art4
7c499c2212 set PHPStan level to 0 for now 2024-12-01 08:13:25 +00:00
Art4
3ec5119933 Merge branch 'develop' into phpstan-level-0-in-addons 2024-12-01 07:39:41 +00:00
Art4
6ee0890c5e Merge branch 'develop' into phpstan-level-1-in-addons 2024-12-01 07:38:06 +00:00
Hypolite Petovan
e34d38182c
Merge pull request #14559 from Art4/phpstan-level-1
Phpstan level 1
2024-11-30 21:40:29 -05:00
Art4
796db5dfae Merge branch 'phpstan-level-1' into phpstan-level-1-in-addons 2024-11-30 21:06:36 +00:00
Art4
56b8b6cd03 update messages.po 2024-11-30 20:47:49 +00:00
Art4
b9e9af0361 Ignore errors in vendors in pumpio addon 2024-11-30 20:12:10 +00:00
Art4
e17012801f Merge branch 'develop' into phpstan-level-1-in-addons 2024-11-30 19:23:36 +00:00
Art4
f44b261cd7 Update messages.po 2024-11-30 07:12:25 +00:00
Art4
cbcb4374fc Merge branch 'develop' into phpstan-level-0-in-addons 2024-11-30 07:05:19 +00:00
Art4
bdae3c56c0 Revert "remove ->toArray() call"
This reverts commit e797db8d48.
2024-11-29 20:53:15 +00:00
Hypolite Petovan
a06e18a4bd
Merge pull request #14570 from Art4/replace-app-with-apphelper
[Refactoring] Replace App with AppHelper
2024-11-29 15:50:51 -05:00
Art4
b2eee3ffd3 Merge branch 'phpstan-level-1' into phpstan-level-1-in-addons 2024-11-29 20:18:25 +00:00
Art4
e797db8d48 remove ->toArray() call 2024-11-29 19:50:48 +00:00
Art4
69f30a2631 Merge branch 'develop' into phpstan-level-1 2024-11-29 19:32:37 +00:00
Hypolite Petovan
c133884ce4
Merge pull request #14579 from Art4/port-2024.09-rc-into-develop
Merge 2024.09-rc branch into develop
2024-11-29 12:48:51 -05:00
Art4
66d7ec5734 Merge branch '2024.09-rc' into port-2024.09-rc-into-develop 2024-11-28 15:11:11 +00:00
Art4
86721490e1 clone addon repository for tests 2024-11-28 12:56:04 +00:00
Art4
937739cb0d Move phpstan step back into phpunit pipeline 2024-11-28 12:55:37 +00:00
Art4
d3be886dac Rename code style check job 2024-11-28 12:42:03 +00:00
Art4
07f7632d64 move phpstan check into code_standards_check pipeline 2024-11-28 12:41:40 +00:00
Art4
6fed376c50 let phpstan ignore addon lang folders 2024-11-28 12:39:26 +00:00
Art4
8f66cbee91 remove unused parameter 2024-11-28 08:26:26 +00:00
Art4
a0da648214 remove unused call for DI::app() 2024-11-28 08:17:04 +00:00
Art4
9c7066ae35 Merge branch 'develop' into replace-app-with-apphelper 2024-11-28 08:11:21 +00:00
Art4
ec5d3e55c7 Use Status object in User object 2024-11-28 08:04:53 +00:00
Art4
0b58562a4e Merge branch 'develop' into phpstan-level-1 2024-11-28 07:58:50 +00:00
Art4
763d66f367 exclude vendor pathes from scan 2024-11-23 23:06:45 +00:00
Art4
9d4dc61807 scan addon folder with PHPStan level 0 2024-11-23 22:15:04 +00:00
Art4
5b281d22ed Remove parameter App from addons __addon_admin_post() functions 2024-11-23 12:25:03 +00:00
Art4
3819ec9dd1 Remove call for DI::app() 2024-11-23 12:18:07 +00:00
Art4
f93915075e remove requirement for DI::app() in addon_install()
see https://github.com/friendica/friendica-addons/pull/1364
2024-11-23 08:38:37 +00:00
Art4
5f829ac1cd Remove DI::app() call from LegacyModule 2024-11-23 08:27:40 +00:00
Art4
76d25a27b4 Remove requirement for App class in legacy mods 2024-11-23 08:26:59 +00:00
Art4
7dbf1bb8bb remove unused call of DI::app() 2024-11-23 08:18:31 +00:00
Art4
d7c25ce0b5 Remove unused DI::app() call 2024-11-23 07:41:34 +00:00
Art4
c5ca4df389 remove try block 2024-11-22 11:04:04 +00:00
Art4
bc76f2af67 refactor confusing finally block 2024-11-22 11:02:54 +00:00
Art4
4e9d129dd3 remove unnecessary finally blocks 2024-11-22 11:02:27 +00:00
Art4
d4504c39c6 remove confusing finally block 2024-11-22 10:53:26 +00:00
Hypolite Petovan
84f9c0ef1f
Merge pull request #14567 from Art4/merge-2024.09-rc-into-develop
Merge 2024.09-rc branch into develop
2024-11-21 10:06:57 -05:00
Art4
702abb2830 Remove unused calls of DI::app() 2024-11-21 10:12:27 +00:00
Art4
4f1a4c4c8a Replace App with AppHelper 2024-11-21 09:56:56 +00:00
Art4
c30327c043 Merge branch '2024.09-rc' into merge-2024.09-rc-into-develop 2024-11-21 09:27:28 +00:00
Artur Weigandt
b8d2a352ae
Update src/Module/Post/Tag/Remove.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-11-21 10:09:27 +01:00
Art4
11dba90440 Merge branch 'develop' into phpstan-level-1 2024-11-21 08:58:55 +00:00
Artur Weigandt
ca956408f6
Update src/Module/Item/Display.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-11-21 09:57:07 +01:00
Michael Vogel
9e2b192054
Merge pull request #14566 from MrPetovan/bug/phpstan-follow-up
Differentiate both UserGServer types used in Content/Conversation
2024-11-20 22:43:38 +01:00
Hypolite Petovan
0e5b79f1dd Differentiate both UserGServer types used in Content/Conversation
- Address https://forum.friendi.ca/display/0b6b25a8-5967-3d08-355b-14b668843210
2024-11-20 11:51:46 -05:00
Art4
81be4c238c Fix namespace in PlaintextTest 2024-11-19 09:08:03 +00:00
Art4
c311a65073 Fix Plaintext class 2024-11-19 09:05:55 +00:00
Art4
2ff280d34c Fix more errors 2024-11-19 08:40:48 +00:00
Art4
caa826ca06 Fix errors in Content namespace 2024-11-19 08:30:26 +00:00
Art4
3c84c21318 Remove unused parameters in AddonInvalidConfigFileException 2024-11-19 08:05:34 +00:00
Art4
b8e15b42fa Refactor DatabaseCache 2024-11-19 08:04:06 +00:00
Art4
0f785e8bd0 Remove unused parameters in ConfigFileException 2024-11-19 07:54:17 +00:00
Art4
58e447f7bb Refactor ConfigFileManager 2024-11-19 07:48:43 +00:00
Art4
cde93c68dc Fix session factory 2024-11-19 07:46:52 +00:00
Art4
c1c158ccda Fix errors in Core namespace 2024-11-19 07:40:46 +00:00
Art4
2b81529844 Refactor Session factory 2024-11-19 07:33:07 +00:00
Art4
a5f623a86a Fix errors in Database namespace 2024-11-19 07:24:27 +00:00
Artur Weigandt
17e5ba715e
Update src/Model/GServer.php 2024-11-19 08:14:00 +01:00
Artur Weigandt
92666e4444
Update src/Model/GServer.php 2024-11-19 08:13:48 +01:00
Art4
92eff402af fix errors in all models 2024-11-18 23:30:37 +00:00
Art4
c61ae5da42 Refactor Item model 2024-11-18 23:23:47 +00:00
Art4
65a3bff645 Refactor GServer Model and platforms.config.php 2024-11-18 23:22:16 +00:00
Art4
3c1599323b Fix docs for themes and theme_admin() 2024-11-18 22:28:35 +00:00
Art4
f254283dc6 Fix errors in all modules 2024-11-18 22:20:28 +00:00
Art4
6cb9676250 Refactor Conversations class 2024-11-18 22:04:05 +00:00
Art4
ec0c3bf96e Refactor Conversation Timeline 2024-11-18 22:00:02 +00:00
Art4
c79f3cde22 Merge branch 'develop' into phpstan-level-1 2024-11-18 21:45:42 +00:00
Artur Weigandt
5ab976dd51
Update src/Network/Probe.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-11-18 22:40:34 +01:00
Artur Weigandt
4faad61a7c
Update src/Module/Post/Tag/Remove.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-11-18 22:40:05 +01:00
Hypolite Petovan
17dba36e77
Merge pull request #14542 from Art4/refactoring-of-app-class
[Refactoring] Extract App methods into AppHelper
2024-11-18 10:37:24 -05:00
Art4
b612180c22 check for path parts 2024-11-18 14:33:26 +00:00
Art4
ae52648950 Fix annotation from review 2024-11-18 14:20:57 +00:00
Artur Weigandt
817eeb9734
Update src/Module/Item/Display.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-11-18 15:15:58 +01:00
Art4
46f6a041a0 Merge branch 'develop' into refactoring-of-app-class 2024-11-18 13:14:29 +00:00
Hypolite Petovan
74802edd44
Merge pull request #14561 from Art4/introduce-apphelper
Create AppHelper interface
2024-11-18 07:51:14 -05:00
Art4
55709169eb Remove dreamhost_error_hack
This was introduced in commit 2c5ba7fc15 but might never worked
because $dreamhost_error_hack was never defined
2024-11-18 08:53:09 +00:00
Art4
e4ec14767f Refactor module Item Display 2024-11-18 08:39:06 +00:00
Art4
9422b016d7 Refactor Magic module 2024-11-18 08:28:32 +00:00
Art4
78444ff25c Improve search for user in Modration module 2024-11-18 08:09:59 +00:00
Art4
3d97280f52 Refactor OAuth Token 2024-11-18 08:02:22 +00:00
Art4
5772c70216 Check for explicit types 2024-11-18 07:44:26 +00:00
Artur Weigandt
2b40e49e6e
Update src/Protocol/ActivityPub/Processor.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-11-18 08:38:12 +01:00
Artur Weigandt
219b258a54
Update src/Protocol/ActivityPub/ClientToServer.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-11-18 08:35:45 +01:00
Art4
e26f435c2e Remove set_include_path() call 2024-11-18 07:32:01 +00:00
Art4
24f75cd618 Add return type never, fix more errors 2024-11-17 22:55:42 +00:00
Art4
12ed714a9e Fix more errors 2024-11-17 22:26:43 +00:00
Art4
08ecf2c9a4 fix more errors 2024-11-17 22:13:01 +00:00
Art4
36484309d1 fix errors in Object namespace 2024-11-17 21:43:06 +00:00
Art4
f7b4f57028 Merge branch 'introduce-apphelper' into refactoring-of-app-class 2024-11-17 20:26:02 +00:00
Art4
ab2f7d8845 Fix Authentication 2024-11-17 20:22:01 +00:00
Art4
6dc193500d Recreate messages.po 2024-11-17 20:16:29 +00:00
Art4
0e23f35438 Add Dice rule for AppHelper 2024-11-17 20:11:43 +00:00
Art4
34845910ec Create AppHelper interface and AppLegacy class 2024-11-17 20:06:34 +00:00
Art4
603af2fb19 Rename DI::apphelper() to DI::appHeler() 2024-11-17 20:00:34 +00:00
Art4
e320b010c7 Fix method order in App class 2024-11-17 19:53:17 +00:00
Art4
9ebdd9f95c Improve Page.php 2024-11-17 19:50:45 +00:00
Art4
d09e19ce1d fix property scope 2024-11-17 19:50:01 +00:00
Art4
9638113244 Fix all errors in Protocol namespace 2024-11-17 18:39:17 +00:00
Art4
5469637f2b Merge branch 'develop' into phpstan-level-1 2024-11-17 07:53:09 +00:00
Art4
5696a5249f Merge branch 'develop' into refactoring-of-app-class 2024-11-17 07:37:58 +00:00
Hypolite Petovan
1f99e2924d
Merge pull request #14558 from Art4/run-phpstan-in-ci-pipeline
Add phpstan check in woodpecker ci
2024-11-16 20:52:13 -05:00
Art4
8bbf9d25b6 Merge branch 'develop' into phpstan-level-1 2024-11-16 19:59:32 +00:00
Art4
ceb4747eea Fix phpstan errors 2024-11-16 19:36:08 +00:00
Art4
a24a65de2f Merge branch 'develop' into refactoring-of-app-class 2024-11-16 19:29:56 +00:00
Art4
6e17b3b76e Move phpstan into own workflow step 2024-11-16 19:03:15 +00:00
Art4
f75fc9a2fb Merge branch 'develop' into run-phpstan-in-ci-pipeline 2024-11-16 18:59:55 +00:00
Hypolite Petovan
112df46200
Merge pull request #14555 from Art4/merge-2024.09-rc-branch
Merge 2024.09-rc branch into develop
2024-11-16 13:00:28 -05:00
Art4
e97231683a fix erros in Util namespace 2024-11-16 17:16:26 +00:00
Art4
c74ed3d2b9 Fix errors for missing DB_UPDATE_VERSION const 2024-11-16 15:54:48 +00:00
Art4
bb37e87b6e bump phpstan to level 1 2024-11-16 15:54:24 +00:00
Art4
d2ea53deb1 Remove App dependency in test 2024-11-16 14:27:31 +00:00
Art4
6909f5cba6 Recreate lang 2024-11-16 12:22:39 +00:00
Art4
84048617c9 Remove phpstan ignored errors 2024-11-16 10:41:14 +00:00
Art4
fca8de40a1 Remove dependency for twitter addon 2024-11-16 10:37:48 +00:00
Art4
551cb5f50f Recreate messages.po 2024-11-16 10:27:54 +00:00
Art4
1f2c97f76f Fix tests for now because of side effect in Friendica\App class 2024-11-16 10:21:29 +00:00
Art4
2b6cc5378f Fix command, move it to top 2024-11-16 09:17:07 +00:00
Art4
c1b48be75c Merge branch 'develop' into refactoring-of-app-class 2024-11-16 09:08:22 +00:00
Art4
d3df0ff1d3 Add phpstan check in woodpecker ci 2024-11-16 09:01:20 +00:00
Art4
e5b837f183 bump version to 2024.12-dev 2024-11-16 08:39:37 +00:00
Art4
eb04f3b079 Merge branch 'develop' into merge-2024.09-rc-branch 2024-11-16 08:32:25 +00:00
Hypolite Petovan
b8aa6f15c9
Merge pull request #14529 from Art4/add-static-code-analysis
Add static code analysis with PHPStan level 0
2024-11-15 13:52:45 -05:00
Art4
5595bfc0d8 Merge branch '2024.09-rc' into merge-2024.09-rc-branch 2024-11-15 14:32:05 +00:00
Art4
2ef9982f63 refactor Receiver::processObject() method 2024-11-14 07:32:25 +00:00
Art4
ee2cdc7763 replace method with anonymous function 2024-11-13 07:49:29 +00:00
Artur Weigandt
3e523ddd09
Update src/Protocol/ActivityPub/Receiver.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2024-11-12 22:03:09 +01:00
Art4
ca51b45f04 Upgrade to PHPStan 2.0 2024-11-12 21:02:21 +00:00
Art4
9a04f90bbd Improve check for unlisted receiver 2024-11-12 00:20:30 +00:00
Art4
12d5e4da44 use get_class() instead of static() in BaseCollection 2024-11-11 23:40:45 +00:00
Art4
20f5a96fe0 refactor usage of Friendica\App namespace 2024-11-11 00:30:58 +00:00
Art4
629c4af3c8 Replace typehint App with AppHelper in view folder 2024-11-10 23:53:03 +00:00
Art4
5baa54e81c Fix variable names 2024-11-10 23:51:04 +00:00
Art4
2a132718d0 Replace typehint App with AppHelper in mod folder 2024-11-10 23:37:46 +00:00
Art4
14ec1950b9 Replace typehint App with AppHelper in all classes 2024-11-10 23:33:28 +00:00
Michael Vogel
c6754fe838
Merge pull request #14543 from Art4/fix-continous-deployment-pipeline
Fix composer installation in woodpecker pipelines
2024-11-11 00:08:42 +01:00
Art4
712b9e9610 Fix lang strings object in PhpToPo command 2024-11-10 22:50:59 +00:00
Art4
68fb214f85 Fix composer installation in woodpecker pipelines 2024-11-10 21:17:41 +00:00
Art4
59292571e0 Merge branch 'add-static-code-analysis' into refactoring-of-app-class 2024-11-10 21:11:05 +00:00
Art4
31665e795c Merge branch 'develop' into add-static-code-analysis 2024-11-10 21:03:31 +00:00
Hypolite Petovan
a7bc4010b9
Merge pull request #14526 from Art4/improve-tests
Improve tests
2024-11-10 15:14:07 -05:00
Art4
d87f24f17a Replace calls for App::redirect() with AppHelper 2024-11-10 16:19:02 +00:00
Art4
2c0db2f043 Replace calls for App::setCurrentTheme() with AppHelper 2024-11-10 16:09:30 +00:00
Art4
c495461ffb Fix missing $app 2024-11-10 12:13:32 +00:00
Art4
782271aa3c Refactor App class 2024-11-10 12:02:31 +00:00
Art4
4abfc3907b Replace calls for App::getCurrentTheme() with AppHelper 2024-11-10 11:59:43 +00:00
Art4
e6b39e5f1c Fix cs in App and AppLegacy classes 2024-11-10 11:42:59 +00:00
Art4
ae75ffc31a replace calls for App::getBasePath() with AppHelper 2024-11-10 10:57:13 +00:00
Art4
79f9e78daf Replace temp variable with property 2024-11-10 08:53:36 +00:00
Art4
81c0c56e5a Replace calls for App with AppHelper in Module\Install 2024-11-10 08:46:50 +00:00
Art4
d9d1e9e0e0 Merge branch 'add-static-code-analysis' into refactoring-of-app-class 2024-11-10 08:10:17 +00:00
Art4
9c7a0f7e58 Merge branch 'develop' into restore-github-actions 2024-11-10 07:49:06 +00:00
Art4
89801f043f recreate messages.po 2024-11-10 07:45:24 +00:00
Art4
d2151f9cd0 add composer script to recreate lang file 2024-11-10 07:44:58 +00:00
Art4
82a95367ae fix code style 2024-11-10 00:23:35 +00:00
Art4
221dad7663 Merge branch 'improve-tests' into add-static-code-analysis 2024-11-10 00:20:29 +00:00
Art4
5305286312 Improve phpunit testsuites, add script for unit tests 2024-11-10 00:12:47 +00:00
Art4
bbf7e4a936 Fix code style 2024-11-09 23:56:59 +00:00
Art4
8b500926ee Refactor tests for Util\Crypto 2024-11-09 23:50:06 +00:00
Art4
940884e4bd Refactor Crypto::randomDigits() 2024-11-09 23:18:13 +00:00
Art4
29c0473b64 Merge branch 'develop' into improve-tests 2024-11-09 22:51:40 +00:00
Michael Vogel
e1efa09260
Merge pull request #14539 from Art4/fix-composer-install-in-woodpecker-ci
Fix woodpecker ci pipelines
2024-11-09 15:59:23 +01:00
Art4
35c01b9685 Fix code style 2024-11-09 10:08:40 +00:00
Art4
dcc8cca6cd Merge branch 'improve-tests' into add-static-code-analysis 2024-11-09 10:05:06 +00:00
Art4
37b2c3faab Merge branch 'fix-composer-install-in-woodpecker-ci' into improve-tests 2024-11-09 10:02:52 +00:00
Art4
64751b7b5a create empty addon folder in phpunit tests 2024-11-09 09:57:16 +00:00
Art4
1946d4f470 Create empty addon folder 2024-11-09 09:50:47 +00:00
Art4
9623645cfa Add copyright notes 2024-11-09 09:32:35 +00:00
Art4
5a10bd3d4b Merge branch 'develop' into restore-github-actions 2024-11-09 09:22:23 +00:00
Art4
d4f6b3bbef Merge branch 'develop' into improve-tests 2024-11-09 09:06:33 +00:00
Michael Vogel
c2be44a848
Merge pull request #14523 from Art4/update-composer-v2
Update to Composer v2
2024-11-09 06:15:27 +01:00
Art4
7de79fc753 Replace calls for App:::getThemeInfoValue() with AppHelper 2024-11-08 23:23:01 +00:00
Art4
536234a9c6 Replace calls for App::getThemeInfo() with AppHelper 2024-11-08 23:14:08 +00:00
Art4
2ac926dfb2 Replace all calls for App::setThemeInfoValue() with AppHelper 2024-11-08 23:11:59 +00:00
Art4
be193a236e Replace all calls for App::getTimeZone() with AppHelper 2024-11-08 23:08:40 +00:00
Art4
d9087b4f7c Replace all calls for App::getContactId() with AppHelper 2024-11-08 23:04:52 +00:00
Art4
cad3311afb Replace calls for App::setContactId() with AppHelper 2024-11-08 22:50:08 +00:00
Art4
6f14645a5f Replace calls for App::getProfileOwner() with AppHelper 2024-11-08 22:45:14 +00:00
Art4
6a6a5af3b2 Replace calls of App::setProfileOwner with AppHelper 2024-11-08 16:20:55 +00:00
Art4
9477e1b55f Move AppHelper code to AppLegacy, create interface for AppHelper 2024-11-08 16:07:24 +00:00
Art4
85f74c80e8 extract redirect method into AppHelper 2024-11-08 12:13:20 +00:00
Art4
470c47f45c Extract config methods into AppHelper 2024-11-08 12:06:30 +00:00
Art4
0fc9f7f0b4 extract ThemeInfo methods into AppHelper 2024-11-08 11:05:02 +00:00
Art4
6fd74bccb0 Remove unused dependencies 2024-11-08 09:44:01 +00:00
Art4
48b2cff53d extract getter and setter for current theme into AppHelper 2024-11-08 09:39:16 +00:00
Art4
bbf7d50295 Merge branch 'add-static-code-analysis' into refactoring-of-app-class 2024-11-08 08:31:31 +00:00
Art4
256ed12b51 Move test into Unit test namespace 2024-11-08 08:17:27 +00:00
Art4
dc80d35088 Fix cs 2024-11-08 08:15:03 +00:00
Art4
4203ce5d51 Merge branch 'add-static-code-analysis' into refactoring-of-app-class 2024-11-08 08:03:16 +00:00
Art4
1c3a33ab49 Fix namespace 2024-11-08 08:01:07 +00:00
Art4
60a9833130 Replace App with AppHelper in Worker classes 2024-11-08 07:42:35 +00:00
Art4
1d5fc6a4bf Extract Queue getter and setter into AppHelper 2024-11-08 07:30:36 +00:00
Art4
aa6ddb73fe Restore ports 2024-11-08 07:23:35 +00:00
Art4
10497e9231 Try different port 2024-11-07 13:47:02 +00:00
Art4
5601c8b6a1 Try mariadb 11.1 2024-11-07 13:38:43 +00:00
Art4
5066e4b6e0 Try different port style 2024-11-07 13:34:50 +00:00
Art4
7176ba5a0a remove interactive timeout 2024-11-06 23:02:24 +00:00
Art4
6985808624 remove wait-timeout 2024-11-06 23:01:20 +00:00
Art4
3ac97e44ab add command args as options 2024-11-06 22:59:45 +00:00
Art4
6477179231 remove wrong parameter 2024-11-06 22:55:01 +00:00
Art4
2662fce74d try to keep mariadb alive 2024-11-06 22:53:04 +00:00
Art4
f48311051e Improve workflow for PHP 2024-11-06 22:41:56 +00:00
Art4
b6a972c5fe Update php versions, remove code coverage upload 2024-11-06 22:25:48 +00:00
Art4
d959c07e25 remove bin/dev/setup-phpunit.sh 2024-11-06 22:02:44 +00:00
Art4
50cf3bf4f7 Revert "remove GitHub Action for PHP tests"
This reverts commit f1e268ee0a.
2024-11-06 21:57:23 +00:00
Art4
f0ce7ea61e Extract App::getProfileOwner() and setProfileOwner() into AppHelper 2024-11-06 13:36:38 +01:00
Art4
b5317f8e46 Refactor App, add AppHelper in constructor 2024-11-06 12:26:33 +00:00
Art4
00d2e24dd2 Refactor Security\Authentication class, remove dependency for App instance 2024-11-06 13:21:57 +01:00
Art4
c0bd3b5ff0 Extract App::setContactId() and App::getContactId() into AppHelper 2024-11-06 13:11:26 +01:00
Art4
94b4009397 Improve code style in Security\Authentication 2024-11-06 13:06:54 +01:00
Art4
ae36d66ddc Replace App with AppHelper in Calendar/Event/API.php 2024-11-06 12:52:48 +01:00
Art4
7c6505cc55 Replace App with AppHelper in Network classes 2024-11-06 08:14:50 +00:00
Art4
9074258b78 Replace static calls of DI::app() with DI::apphelper() 2024-11-06 07:57:43 +00:00
Art4
4f16bbe5f5 deprecate App::ge DI::app(),tTimeZone() and App::setTimezone() 2024-11-06 07:52:46 +00:00
Art4
81b0bab084 Create AppHelper class 2024-11-06 07:32:07 +00:00
Art4
d29a18e56f Refactor App class 2024-11-06 07:21:50 +00:00
Art4
dfb821d3b5 Ignore false positive PHPStan error
see https://github.com/friendica/friendica-addons/pull/1363
2024-11-05 15:26:24 +00:00
Art4
a28a207774 Fix name of Mode class 2024-11-05 12:20:43 +00:00
Art4
eff96cc140 add missing use statement 2024-11-05 12:17:41 +00:00
Art4
4b971f84fd Fix returns in Console commands 2024-11-05 12:13:18 +00:00
Art4
01ba276455 Add missing return
This needs some refactoring: returning nothing implicit returns null, thas will be convert to int 0.
I return false instead of nothing to keep this behaviour for BC.
2024-11-05 11:52:23 +00:00
Art4
bf04b3e57d Fix usage of static 2024-11-05 11:27:29 +00:00
Art4
f024de4350 add missing property in FixAPDeliveryWorkerTaskParameters 2024-11-05 11:25:35 +00:00
Art4
3c229443e8 Remove missleading template phpdoc 2024-11-05 07:14:24 +00:00
Art4
4e49c45021 Remove support for apc 2024-11-05 07:07:58 +00:00
Art4
8448d719e7 Remove support for apc
apc is deprecated since PHP 5.5 and not compatible with PHP 7
2024-11-04 20:34:42 +00:00
Art4
ad6be21b56 Fix defaults in Contact model 2024-11-04 20:02:44 +00:00
Art4
28f2b7fc81 Fix variable name
The variable was renamed but this line was accidently overseen

see 62eb16e9ad (diff-785d24b46fdf749363656f33208f941ea0eca809c7c76452180a0bfc16df68a3R2555)
2024-11-04 15:28:10 +00:00
Art4
3535c7c4cd Remove unused code 2024-11-04 15:09:33 +00:00
Art4
71add60f59 remove unused code
this code was never called because $body is never declared
and hence the if could never be true
2024-11-04 15:04:06 +00:00
Art4
57c188d01d Fix wrong use of static 2024-11-04 13:46:33 +00:00
Art4
4a9c7d2f30 Remove call of non-existing functions
This functions were removed in commit a97b3f690c9e4476ba638236897507100f77af6f

- twitter_statuses_show()
- twitter_media_entities()
- twitter_expand_entities()

see a97b3f690c
2024-11-04 13:56:08 +01:00
Art4
b5c2cbc597 Refactor Friendica\Module\Debug\ItemBody class 2024-11-04 13:36:57 +01:00
Art4
979468e7fb refactor of Friendica\Object\Api\Mastodon\Preferences class 2024-11-04 13:30:26 +01:00
Art4
0bb8e3af80 add test for Preferences class 2024-11-04 13:22:26 +01:00
Art4
9ae7b9cf01 Fix warnings in Receiver.php 2024-11-04 11:58:08 +00:00
Art4
3a8058ec09 Extract visible_whitespace() into separate method in ActivityPubConversion 2024-11-03 15:54:37 +01:00
Art4
e984057ceb Extract visible_whitespace() into separate method 2024-11-03 15:52:46 +01:00
Art4
c5dac44c8f add missing return statement 2024-11-03 15:49:44 +01:00
Art4
adb1bd2ad0 Add license note an scan directory for PHPStan 2024-11-03 11:24:15 +01:00
Art4
0965a84929 install PHPStan for static code analysis 2024-11-02 22:24:10 +01:00
Art4
cf92446cf3 Fix tests 2024-11-02 22:06:02 +01:00
Art4
04d4c6d8f0 Fix mocking namespace 2024-11-02 20:57:11 +01:00
Art4
5ecee2b9f7 Fix namespace in IntallerTest, mock function_exists() with PHPMock 2024-11-02 17:43:43 +01:00
Art4
7de3b16dc3 Fix namespace for CryptoTest 2024-11-01 21:46:09 +00:00
Art4
f575f6c94c require php-mock/php-mock-phpunit for mocking php builtin functions 2024-11-01 21:45:45 +00:00
Art4
2d248ec8ca autoload addons via classmap instead of psr-4 2024-11-01 21:15:34 +00:00
Art4
87491dc3b5 replace bower-asset/fork-awesome with npm-asset/fork-awesome 2024-11-01 14:45:38 +00:00
Art4
0126aa5018 replace bower-asset/dompurify with npm-asset/dompurify 2024-11-01 14:40:10 +00:00
Art4
c15671fa78 replace bower-asset/chart-js with npm-asset/chart.js 2024-11-01 14:37:31 +00:00
Art4
5a201819ac fix path name for chart.js 2024-11-01 12:29:14 +00:00
Art4
f799ab563c Remove fxp-asset config 2024-11-01 12:11:16 +00:00
Art4
b7e007c37b install all bower and npm dependencies with composer 2024-11-01 13:07:32 +01:00
Art4
fa22e11c5f replace composer/installers with oomphinc/composer-installers-extender 2024-11-01 11:46:04 +00:00
Art4
4c02205454 install composer/installers, add asset-packagist as new repository 2024-11-01 11:27:42 +00:00
Art4
d62eee3379 remove fxp/composer-asset-plugin dependency 2024-11-01 11:17:55 +00:00
Art4
2c325eb124 Update to Compose v2 2024-10-31 14:40:00 +00:00
870 changed files with 48629 additions and 38129 deletions

View file

@ -19,7 +19,7 @@ cd $DocumentRoot
# copy the .htaccess-dist file to .htaccess so that rewrite rules work
cp $DocumentRoot/.htaccess-dist $DocumentRoot/.htaccess
bin/composer.phar --no-dev install
bin/composer.phar install
# install friendica
bin/console autoinstall -f /tmp/autoinstall.config.php

141
.github/workflows/code-quality.yml vendored Normal file
View file

@ -0,0 +1,141 @@
# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
#
# SPDX-License-Identifier: CC0-1.0
name: Code Quality
on:
push:
pull_request:
workflow_dispatch:
jobs:
code-style:
name: PHP-CS-Fixer (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
php: ['8.3']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup PHP with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: none
- name: Clone addon repository
run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon
- name: Install PHP-CS-Fixer
run: composer install --working-dir=bin/dev/php-cs-fixer
- name: Run PHP-CS-Fixer
continue-on-error: true
run: bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff --dry-run
phpstan:
name: PHPStan (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
php: ['8.4']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup PHP with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: none
- name: Clone addon repository
run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Run PHPStan
run: composer run phpstan
phpstan-addons:
name: PHPStan in addons (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
php: ['8.4']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup PHP with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: none
- name: Clone addon repository
run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Run PHPStan in addons
run: composer run phpstan-addons
phpmd:
name: PHPMD (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
php: ['8.4']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup PHP with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
coverage: none
tools: none
- name: Clone addon repository
run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Run PHPMD
run: vendor/bin/phpmd src/ text .phpmd-ruleset.xml --color

129
.github/workflows/tests.yml vendored Normal file
View file

@ -0,0 +1,129 @@
# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
#
# SPDX-License-Identifier: CC0-1.0
name: CI tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
unit-tests:
name: Unit-Tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup PHP with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: none
- name: Clone addon repository
run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
- name: Run Unit tests
run: composer run test:unit
database-tests:
name: Database-Tests (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: test
MYSQL_PASSWORD: test
MYSQL_USER: test
ports:
- 3306/tcp
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
memcached:
image: memcached
ports:
- 11211/tcp
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: pecl, composer
extensions: pdo_mysql, gd, zip, opcache, ctype, pcntl, ldap, apcu, memcached, redis, imagick, memcache
coverage: xdebug
ini-values: apc.enabled=1, apc.enable_cli=1
- name: Clone addon repository
run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon
# Install composer dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Copy default Friendica config
run: cp config/local-sample.config.php config/local.config.php
- name: Verify MariaDB connection
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
sleep 1
done
- name: Setup MYSQL database
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
mysql -h"127.0.0.1" -P"$PORT" -utest -ptest test < database.sql
- name: Test with phpunit
run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
MYSQL_DATABASE: test
MYSQL_PASSWORD: test
MYSQL_USER: test
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
REDIS_HOST: 127.0.0.1
MEMCACHED_PORT: ${{ job.services.memcached.ports[11211] }}
MEMCACHE_PORT: ${{ job.services.memcached.ports[11211] }}

2
.gitignore vendored
View file

@ -72,7 +72,6 @@ venv/
/.idea
#ignore addons directory
/addons
/addon
#ignore base .htaccess
@ -90,6 +89,7 @@ venv/
#Ignore cache files
.php_cs.cache
.php-cs-fixer.cache
.phpmd.result-cache.php
#ignore avatar picture cache path
/avatar

26
.phpmd-ruleset.xml Normal file
View file

@ -0,0 +1,26 @@
<?xml version="1.0"?>
<ruleset name="Friendica Ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="
http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
PHPMD ruleset for friendica code.
</description>
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity">
<priority>3</priority>
<properties>
<property name="maximum" value="800" />
</properties>
</rule>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<priority>3</priority>
<properties>
<property name="reportLevel" value="100" />
</properties>
</rule>
</ruleset>

View file

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2010-2024 the Friendica project
SPDX-License-Identifier: CC0-1.0

52
.phpstan-addons.neon Normal file
View file

@ -0,0 +1,52 @@
# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
#
# SPDX-License-Identifier: CC0-1.0
parameters:
level: 3
paths:
- addon/
excludePaths:
analyse:
- addon/*/lang/*
- addon/*/vendor/*
- addon/convert/UnitConvertor.php
- addon/pumpio/oauth/*
scanDirectories:
- mod
- src
- static
- vendor
- view
dynamicConstantNames:
- DB_UPDATE_VERSION
ignoreErrors:
-
# Ignore missing SMTP class in PHPMailer 5.2.21
# see https://github.com/PHPMailer/PHPMailer/blob/v5.2.21/class.smtp.php
message: '(^.+ an unknown class SMTP\.$)'
path: addon/mailstream/phpmailer
-
# Ignore missing SMTP class in PHPMailer 5.2.21
# see https://github.com/PHPMailer/PHPMailer/blob/v5.2.21/class.smtp.php
message: '(^Property .+ has unknown class SMTP as its type\.$)'
path: addon/mailstream/phpmailer
-
# Ignore missing SMTP class in PHPMailer 5.2.21
# see https://github.com/PHPMailer/PHPMailer/blob/v5.2.21/class.smtp.php
message: '(^Method .+ has invalid return type SMTP\.$)'
path: addon/mailstream/phpmailer
-
# Ignore missing SMTP class in PHPMailer 5.2.21
# see https://github.com/PHPMailer/PHPMailer/blob/v5.2.21/class.smtp.php
message: '(^Instantiated class SMTP not found\.$)'
path: addon/mailstream/phpmailer

40
.phpstan.neon Normal file
View file

@ -0,0 +1,40 @@
# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
#
# SPDX-License-Identifier: CC0-1.0
parameters:
level: 3
paths:
- bin/auth_ejabberd.php
- bin/console.php
- bin/daemon.php
- bin/jetstream.php
- bin/worker.php
- index.php
- src/
scanDirectories:
- mod
- static
- vendor
- view
dynamicConstantNames:
- DB_UPDATE_VERSION
ignoreErrors:
-
# Ignore missing GdImage class in PHP <= 7.4
message: '(^Property .+ has unknown class GdImage as its type\.$)'
path: src
-
# Ignore missing IMAP\Connection class in PHP <= 8.0
message: '(^Method .+ has invalid return type IMAP\\Connection\.$)'
path: src
-
# Ignore missing IMAP\Connection class in PHP <= 8.0
message: '(^Parameter .+ has invalid type IMAP\\Connection\.$)'
path: src

View file

@ -39,17 +39,14 @@ steps:
check:
image: php:8.3
commands:
- echo "**** Use bin/dev/fix-codestyle.sh in case of errors ****"
- apt-get update -q
- DEBIAN_FRONTEND=noninteractive apt-get install -q -y git
- if [ ! -z "$${CI_COMMIT_PULL_REQUEST}" ]; then
git fetch --no-tags origin ${CI_COMMIT_TARGET_BRANCH};
CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base FETCH_HEAD origin/${CI_COMMIT_TARGET_BRANCH})..${CI_COMMIT_SHA})";
git fetch --no-tags --unshallow origin ${CI_COMMIT_TARGET_BRANCH}:refs/remotes/origin/${CI_COMMIT_TARGET_BRANCH};
CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base ${CI_COMMIT_SHA} origin/${CI_COMMIT_TARGET_BRANCH})..${CI_COMMIT_SHA})";
else
CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRTUXB ${CI_COMMIT_SHA})";
fi
- if ! echo "$${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then
EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "$${CHANGED_FILES}");
else
EXTRA_ARGS='';
fi
- EXTRA_ARGS="--path-mode=intersection -- $${CHANGED_FILES}";
- ./bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php -v --diff --using-cache=no $${EXTRA_ARGS}

View file

@ -41,8 +41,9 @@ steps:
volumes:
- /tmp/drone-cache:/tmp/cache
composer_install:
image: friendicaci/php8.2:php8.2.16
image: friendicaci/php8.2:php8.2.28
commands:
- mkdir addon # create empty addon folder to appease composer
- export COMPOSER_HOME=.composer
- composer validate
- composer install --no-dev --optimize-autoloader

View file

@ -5,7 +5,7 @@
matrix:
include:
- PHP_MAJOR_VERSION: 8.2
PHP_VERSION: 8.2.16
PHP_VERSION: 8.2.28
when:
branch:
@ -41,6 +41,7 @@ steps:
composer_install:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
commands:
- mkdir addon # create empty addon folder to appease composer
- export COMPOSER_HOME=.composer
- ./bin/composer.phar validate
- ./bin/composer.phar install --prefer-dist

View file

@ -0,0 +1,50 @@
# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
#
# SPDX-License-Identifier: CC0-1.0
# The phpmd check is just triggered for PRs and pushes to non-stable branches of Friendica
when:
branch:
exclude: [ stable ]
event: [ pull_request, push ]
# This forces PHP Unit executions at the "opensocial" labeled location (because of access issues with git.friendi.ca)
labels:
location: opensocial
steps:
restore_cache:
image: meltwater/drone-cache:dev
settings:
backend: "filesystem"
restore: true
cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
archive_format: "gzip"
mount:
- '.composer'
volumes:
- /tmp/drone-cache:/tmp/cache
composer_install:
image: friendicaci/php8.3:php8.3.17
commands:
- mkdir addon # create empty addon folder to appease composer
- export COMPOSER_HOME=.composer
- ./bin/composer.phar install --prefer-dist
rebuild_cache:
image: meltwater/drone-cache:dev
settings:
backend: "filesystem"
rebuild: true
cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}"
archive_format: "gzip"
mount:
- '.composer'
volumes:
- /tmp/drone-cache:/tmp/cache
phpmd:
image: friendicaci/php8.3:php8.3.17
commands:
- ./bin/composer.phar run phpmd

View file

@ -9,11 +9,13 @@ matrix:
- PHP_MAJOR_VERSION: 8.0
PHP_VERSION: 8.0.30
- PHP_MAJOR_VERSION: 8.1
PHP_VERSION: 8.1.27
PHP_VERSION: 8.1.31
- PHP_MAJOR_VERSION: 8.2
PHP_VERSION: 8.2.16
PHP_VERSION: 8.2.28
- PHP_MAJOR_VERSION: 8.3
PHP_VERSION: 8.3.3
PHP_VERSION: 8.3.17
- PHP_MAJOR_VERSION: 8.4
PHP_VERSION: 8.4.5
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
labels:
@ -24,7 +26,19 @@ when:
exclude: [ stable ]
event: [ pull_request, push ]
skip_clone: true
steps:
clone:
image: alpine/git
commands:
- git config --global user.email "no-reply@friendi.ca"
- git config --global user.name "Friendica"
- git config --global --add safe.directory $CI_WORKSPACE
- git clone $CI_REPO_CLONE_URL .
- git checkout $CI_COMMIT_BRANCH
- git fetch origin $CI_COMMIT_REF
- git merge $CI_COMMIT_SHA
php-lint:
image: php:${PHP_MAJOR_VERSION}
commands:
@ -43,6 +57,7 @@ steps:
composer_install:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
commands:
- git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon
- export COMPOSER_HOME=.composer
- ./bin/composer.phar validate
- ./bin/composer.phar install --prefer-dist
@ -59,6 +74,20 @@ steps:
- '.composer'
volumes:
- /tmp/drone-cache:/tmp/cache
phpstan:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
when:
matrix:
PHP_MAJOR_VERSION: 8.3
commands:
- bin/composer.phar run phpstan;
phpstan-addons:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
when:
matrix:
PHP_MAJOR_VERSION: 8.3
commands:
- bin/composer.phar run phpstan-addons;
test:
image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION}
environment:
@ -86,7 +115,7 @@ steps:
when:
matrix:
PHP_MAJOR_VERSION: 8.2
PHP_VERSION: 8.2.16
PHP_VERSION: 8.2.28
repo:
- friendica/friendica
commands:

View file

@ -2,10 +2,6 @@
#
# SPDX-License-Identifier: CC0-1.0
depends_on:
- phpunit
- code_standards_check
# This prevents executing this pipeline at other servers than ci.friendi.ca
labels:
location: friendica
@ -39,8 +35,9 @@ steps:
volumes:
- /tmp/drone-cache:/tmp/cache
composer_install:
image: friendicaci/php8.2:php8.2.16
image: friendicaci/php8.2:php8.2.28
commands:
- mkdir addon # create empty addon folder to appease composer
- export COMPOSER_HOME=.composer
- composer validate
- composer install --no-dev --optimize-autoloader

View file

@ -1,3 +1,12 @@
Version 2025.02 (unreleased)
Friendica Core
Deprecated bin/daemon in favor of bin/console daemon (PR 14642) [nupplaphil]
Deprecated bin/jetstream in favor of bin/console jetstream (PR 14655) [nupplaphil]
Friendica Addons
Closed Issues
Version 2024.12 (2024-12-31)
Friendica Core
Updates to the translations AR, BG, CA, CS, DE, EO, ES, ET, FR, GD, HU, IS, IT, JA, NL, PL, RU, SV

View file

@ -1 +1 @@
2024.12
2025.02-dev

View file

@ -44,44 +44,12 @@ if (php_sapi_name() !== 'cli') {
exit();
}
use Dice\Dice;
use Friendica\App\Mode;
use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\Security\ExAuth;
use Psr\Log\LoggerInterface;
if (sizeof($_SERVER["argv"]) == 0) {
die();
}
$directory = dirname($_SERVER["argv"][0]);
if (substr($directory, 0, 1) != DIRECTORY_SEPARATOR) {
$directory = $_SERVER["PWD"] . DIRECTORY_SEPARATOR . $directory;
}
$directory = realpath($directory . DIRECTORY_SEPARATOR . "..");
chdir($directory);
chdir(dirname(__DIR__));
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => [LogChannel::AUTH_JABBERED]]);
$container = \Friendica\Core\DiceContainer::fromBasePath(dirname(__DIR__));
\Friendica\DI::init($dice);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
$app = \Friendica\App::fromContainer($container);
// Check the database structure and possibly fixes it
\Friendica\Core\Update::check(\Friendica\DI::basePath(), true);
$appMode = $dice->create(Mode::class);
if ($appMode->isNormal()) {
/** @var ExAuth $oAuth */
$oAuth = $dice->create(ExAuth::class);
$oAuth->readStdin();
}
$app->processEjabberd($_SERVER);

Binary file not shown.

View file

@ -1,14 +1,14 @@
#!/bin/bash
#!/bin/sh
# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
#
# SPDX-License-Identifier: CC0-1.0
dir=$(cd "${0%[/\\]*}" > /dev/null; pwd)
dir=$(cd "$(dirname "$0")" > /dev/null 2>&1; pwd)
if [[ -d /proc/cygdrive && $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
if [ -d /proc/cygdrive ] && [ "$(which php)" = "$(readlink -n /proc/cygdrive)/*" ]; then
# We are in Cygwin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
dir=$(cygpath -m "$dir")
fi
php "${dir}/console.php" "$@"

View file

@ -13,21 +13,13 @@ if (php_sapi_name() !== 'cli') {
exit();
}
use Dice\Dice;
use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\DI;
use Psr\Log\LoggerInterface;
// Ensure that te console is executed from the base path of the installation
chdir(dirname(__DIR__));
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::CONSOLE]]);
$container = \Friendica\Core\DiceContainer::fromBasePath(dirname(__DIR__));
/// @fixme Necessary until Hooks inside the Logger can get loaded without the DI-class
DI::init($dice);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
$app = \Friendica\App::fromContainer($container);
(new Friendica\Core\Console($dice, $argv))->execute();
$app->processConsole($_SERVER);

View file

@ -5,6 +5,8 @@
* SPDX-FileCopyrightText: 2010-2024 the Friendica project
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* @deprecated 2025.02 use `bin/console.php daemon` instead
*/
/**
@ -17,231 +19,20 @@ if (php_sapi_name() !== 'cli') {
exit();
}
use Dice\Dice;
use Friendica\App\Mode;
use Friendica\Core\Logger;
use Friendica\Core\Update;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
use Psr\Log\LoggerInterface;
// Get options
$shortopts = 'f';
$longopts = ['foreground'];
$options = getopt($shortopts, $longopts);
// Ensure that daemon.php is executed from the base path of the installation
if (!file_exists('index.php') && (sizeof($_SERVER['argv']) != 0)) {
$directory = dirname($_SERVER['argv'][0]);
if (substr($directory, 0, 1) != '/') {
$directory = $_SERVER['PWD'] . '/' . $directory;
}
$directory = realpath($directory . '/..');
chdir($directory);
}
chdir(dirname(__DIR__));
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capability\LogChannel::DAEMON]]);
fwrite(STDOUT, '`bin/daemon.php` is deprecated since 2025.02 and will be removed in 5 months, please use `bin/console.php daemon` instead.' . \PHP_EOL);
DI::init($dice);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
// BC: Add console command as second argument
$argv = $_SERVER['argv'] ?? [];
array_splice($argv, 1, 0, "daemon");
$_SERVER['argv'] = $argv;
if (DI::mode()->isInstall()) {
die("Friendica isn't properly installed yet.\n");
}
$container = \Friendica\Core\DiceContainer::fromBasePath(dirname(__DIR__));
DI::mode()->setExecutor(Mode::DAEMON);
$app = \Friendica\App::fromContainer($container);
DI::config()->reload();
if (empty(DI::config()->get('system', 'pidfile'))) {
die(<<<TXT
Please set system.pidfile in config/local.config.php. For example:
'system' => [
'pidfile' => '/path/to/daemon.pid',
],
TXT
);
}
$pidfile = DI::config()->get('system', 'pidfile');
if (in_array('start', $_SERVER['argv'])) {
$mode = 'start';
}
if (in_array('stop', $_SERVER['argv'])) {
$mode = 'stop';
}
if (in_array('status', $_SERVER['argv'])) {
$mode = 'status';
}
$foreground = array_key_exists('f', $options) || array_key_exists('foreground', $options);
if (!isset($mode)) {
die("Please use either 'start', 'stop' or 'status'.\n");
}
if (empty($_SERVER['argv'][0])) {
die("Unexpected script behaviour. This message should never occur.\n");
}
$pid = null;
if (is_readable($pidfile)) {
$pid = intval(file_get_contents($pidfile));
}
if (empty($pid) && in_array($mode, ['stop', 'status'])) {
DI::keyValue()->set('worker_daemon_mode', false);
die("Pidfile wasn't found. Is the daemon running?\n");
}
if ($mode == 'status') {
if (posix_kill($pid, 0)) {
die("Daemon process $pid is running.\n");
}
unlink($pidfile);
DI::keyValue()->set('worker_daemon_mode', false);
die("Daemon process $pid isn't running.\n");
}
if ($mode == 'stop') {
posix_kill($pid, SIGTERM);
unlink($pidfile);
Logger::notice('Worker daemon process was killed', ['pid' => $pid]);
DI::keyValue()->set('worker_daemon_mode', false);
die("Worker daemon process $pid was killed.\n");
}
if (!empty($pid) && posix_kill($pid, 0)) {
die("Daemon process $pid is already running.\n");
}
Logger::notice('Starting worker daemon.', ['pid' => $pid]);
if (!$foreground) {
echo "Starting worker daemon.\n";
DBA::disconnect();
// Fork a daemon process
$pid = pcntl_fork();
if ($pid == -1) {
echo "Daemon couldn't be forked.\n";
Logger::warning('Could not fork daemon');
exit(1);
} elseif ($pid) {
// The parent process continues here
if (!file_put_contents($pidfile, $pid)) {
echo "Pid file wasn't written.\n";
Logger::warning('Could not store pid file');
posix_kill($pid, SIGTERM);
exit(1);
}
echo 'Child process started with pid ' . $pid . ".\n";
Logger::notice('Child process started', ['pid' => $pid]);
exit(0);
}
// We now are in the child process
register_shutdown_function('shutdown');
// Make the child the main process, detach it from the terminal
if (posix_setsid() < 0) {
return;
}
// Closing all existing connections with the outside
fclose(STDIN);
// And now connect the database again
DBA::connect();
}
DI::keyValue()->set('worker_daemon_mode', true);
// Just to be sure that this script really runs endlessly
set_time_limit(0);
$wait_interval = intval(DI::config()->get('system', 'cron_interval', 5)) * 60;
$do_cron = true;
$last_cron = 0;
// Now running as a daemon.
while (true) {
// Check the database structure and possibly fixes it
Update::check(DI::basePath(), true);
if (!$do_cron && ($last_cron + $wait_interval) < time()) {
Logger::info('Forcing cron worker call.', ['pid' => $pid]);
$do_cron = true;
}
if ($do_cron || (!DI::system()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
Worker::spawnWorker($do_cron);
} else {
Logger::info('Cool down for 5 seconds', ['pid' => $pid]);
sleep(5);
}
if ($do_cron) {
// We force a reconnect of the database connection.
// This is done to ensure that the connection don't get lost over time.
DBA::reconnect();
$last_cron = time();
}
$start = time();
Logger::info('Sleeping', ['pid' => $pid, 'until' => gmdate(DateTimeFormat::MYSQL, $start + $wait_interval)]);
do {
$seconds = (time() - $start);
// logarithmic wait time calculation.
// Background: After jobs had been started, they often fork many workers.
// To not waste too much time, the sleep period increases.
$arg = (($seconds + 1) / ($wait_interval / 9)) + 1;
$sleep = min(1000000, round(log10($arg) * 1000000, 0));
usleep($sleep);
$pid = pcntl_waitpid(-1, $status, WNOHANG);
if ($pid > 0) {
Logger::info('Children quit via pcntl_waitpid', ['pid' => $pid, 'status' => $status]);
}
$timeout = ($seconds >= $wait_interval);
} while (!$timeout && !Worker\IPC::JobsExists());
if ($timeout) {
$do_cron = true;
Logger::info('Woke up after $wait_interval seconds.', ['pid' => $pid, 'sleep' => $wait_interval]);
} else {
$do_cron = false;
Logger::info('Worker jobs are calling to be forked.', ['pid' => $pid]);
}
}
function shutdown() {
posix_kill(posix_getpid(), SIGTERM);
posix_kill(posix_getpid(), SIGHUP);
}
$app->processConsole($_SERVER);

24
bin/dev/fix-codestyle.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
# SPDX-FileCopyrightText: 2010-2025 the Friendica project
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# this script checks or fixes php-files, based on the php-cs rules
#
# You can use the following variables:
# COMMAND ... the php-cs command to execute (default is "check --diff")
# TARGET_BRANCH ... set the target branch for the current branch to create a diff between them
#
##
COMMAND=${COMMAND:-"check --diff"}
if [ -n "${TARGET_BRANCH}" ]; then
CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRTUXB "$(git ls-remote -q | grep refs/heads/"${TARGET_BRANCH}"$ | awk '{print $1}' | xargs git rev-parse )".."$(git rev-parse HEAD)")";
else
CHANGED_FILES="$(git diff --name-only --diff-filter=ACMRTUXB "$(git rev-parse HEAD)")";
fi
EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}");
./bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer ${COMMAND} --config=.php-cs-fixer.dist.php -v --using-cache=no ${EXTRA_ARGS}

View file

@ -129,7 +129,7 @@ bin/console user password "$USER_NICK" "$USER_PASSW"
# create cronjob - activate if you have enough memory in you dev VM
# cronjob runs as www-data user
echo ">>> Installing cronjob"
echo "*/10 * * * * www-data cd /vagrant; /usr/bin/php bin/worker.php" >> /etc/cron.d/friendica
echo "*/10 * * * * www-data cd /vagrant; /usr/bin/php bin/console.php worker" >> /etc/cron.d/friendica
# friendica needs write access to /tmp
chmod 777 /tmp

View file

@ -6,179 +6,28 @@
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* @deprecated 2025.02 use `bin/console.php jetstream` instead
*/
use Dice\Dice;
use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\DI;
use Psr\Log\LoggerInterface;
use Friendica\Protocol\ATProtocol\Jetstream;
if (php_sapi_name() !== 'cli') {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
exit();
}
// Ensure that Jetstream.php is executed from the base path of the installation
if (!file_exists('index.php') && (sizeof((array)$_SERVER['argv']) != 0)) {
$directory = dirname($_SERVER['argv'][0]);
if (substr($directory, 0, 1) != '/') {
$directory = $_SERVER['PWD'] . '/' . $directory;
}
$directory = realpath($directory . '/..');
chdir($directory);
}
chdir(dirname(__DIR__));
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capability\LogChannel::DAEMON]]);
fwrite(STDOUT, '`bin/jetstream.php` is deprecated since 2025.02 and will be removed in 5 months, please use `bin/console.php jetstream` instead.' . \PHP_EOL);
DI::init($dice);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
Addon::loadAddons();
Hook::loadHooks();
DI::config()->reload();
// BC: Add console command as second argument
$argv = $_SERVER['argv'] ?? [];
array_splice($argv, 1, 0, "jetstream");
$_SERVER['argv'] = $argv;
if (DI::mode()->isInstall()) {
die("Friendica isn't properly installed yet.\n");
}
$container = \Friendica\Core\DiceContainer::fromBasePath(dirname(__DIR__));
if (empty(DI::config()->get('jetstream', 'pidfile'))) {
die(<<<TXT
Please set jetstream.pidfile in config/local.config.php. For example:
$app = \Friendica\App::fromContainer($container);
'jetstream' => [
'pidfile' => '/path/to/jetstream.pid',
],
TXT);
}
if (!Addon::isEnabled('bluesky')) {
die("Bluesky has to be enabled.\n");
}
$pidfile = DI::config()->get('jetstream', 'pidfile');
if (in_array('start', (array)$_SERVER['argv'])) {
$mode = 'start';
}
if (in_array('stop', (array)$_SERVER['argv'])) {
$mode = 'stop';
}
if (in_array('status', (array)$_SERVER['argv'])) {
$mode = 'status';
}
if (!isset($mode)) {
die("Please use either 'start', 'stop' or 'status'.\n");
}
// Get options
$shortopts = 'f';
$longopts = ['foreground'];
$options = getopt($shortopts, $longopts);
$foreground = array_key_exists('f', $options) || array_key_exists('foreground', $options);
if (empty($_SERVER['argv'][0])) {
die("Unexpected script behaviour. This message should never occur.\n");
}
$pid = null;
if (is_readable($pidfile)) {
$pid = intval(file_get_contents($pidfile));
}
if (empty($pid) && in_array($mode, ['stop', 'status'])) {
die("Pidfile wasn't found. Is jetstream running?\n");
}
if ($mode == 'status') {
if (posix_kill($pid, 0)) {
die("Jetstream process $pid is running.\n");
}
unlink($pidfile);
die("Jetstream process $pid isn't running.\n");
}
if ($mode == 'stop') {
posix_kill($pid, SIGTERM);
unlink($pidfile);
Logger::notice('Jetstream process was killed', ['pid' => $pid]);
die("Jetstream process $pid was killed.\n");
}
if (!empty($pid) && posix_kill($pid, 0)) {
die("Jetstream process $pid is already running.\n");
}
Logger::notice('Starting jetstream daemon.', ['pid' => $pid]);
if (!$foreground) {
echo "Starting jetstream daemon.\n";
DBA::disconnect();
// Fork a daemon process
$pid = pcntl_fork();
if ($pid == -1) {
echo "Daemon couldn't be forked.\n";
Logger::warning('Could not fork daemon');
exit(1);
} elseif ($pid) {
// The parent process continues here
if (!file_put_contents($pidfile, $pid)) {
echo "Pid file wasn't written.\n";
Logger::warning('Could not store pid file');
posix_kill($pid, SIGTERM);
exit(1);
}
echo 'Child process started with pid ' . $pid . ".\n";
Logger::notice('Child process started', ['pid' => $pid]);
exit(0);
}
// We now are in the child process
register_shutdown_function('shutdown');
// Make the child the main process, detach it from the terminal
if (posix_setsid() < 0) {
return;
}
// Closing all existing connections with the outside
fclose(STDIN);
// And now connect the database again
DBA::connect();
}
// Just to be sure that this script really runs endlessly
set_time_limit(0);
// Now running as a daemon.
$jetstream = $dice->create(Jetstream::class);
$jetstream->listen();
function shutdown()
{
posix_kill(posix_getpid(), SIGTERM);
posix_kill(posix_getpid(), SIGHUP);
}
$app->processConsole($_SERVER);

View file

@ -1,13 +1,20 @@
#!/bin/bash
#!/bin/sh
# SPDX-FileCopyrightText: 2010 - 2024 the Friendica project
#
# SPDX-License-Identifier: CC0-1.0
set -eo pipefail
set -e
function resolve {
if [ "$(uname)" == "Darwin" ]
# Custom function to handle pipefail behavior
pipefail() {
local cmd="$1"
shift
{ eval "$cmd"; } || exit 1
}
resolve() {
if [ "$(uname)" = "Darwin" ]
then
realpath "$1"
else
@ -17,7 +24,7 @@ function resolve {
FULLPATH=$(dirname "$(resolve "$0")")
if [ "$1" == "--help" ] || [ "$1" == "-h" ]
if [ "$1" = "--help" ] || [ "$1" = "-h" ]
then
echo "$(basename "$(resolve "$0")") [options]"
echo
@ -28,15 +35,15 @@ fi
MODE='default'
ADDONNAME=
if [ "$1" == "--addon" ] || [ "$1" == "-a" ]
if [ "$1" = "--addon" ] || [ "$1" = "-a" ]
then
MODE='addon'
if [ -z "$2" ]; then echo -e "ERROR: missing addon name\n\nrun_xgettext.sh -a <addonname>"; exit 1; fi
if [ -z "$2" ]; then echo "ERROR: missing addon name\n\nrun_xgettext.sh -a <addonname>"; exit 1; fi
ADDONNAME=$2
if [ ! -d "$FULLPATH/../addon/$ADDONNAME" ]; then echo "ERROR: addon '$ADDONNAME' not found"; exit 2; fi
fi
if [ "$1" == "--single" ] || [ "$1" == "-s" ]
if [ "$1" = "--single" ] || [ "$1" = "-s" ]
then
MODE='single'
fi
@ -70,7 +77,6 @@ case "$MODE" in
;;
esac
KEYWORDS="-k -kt -ktt:1,2"
echo "Extract strings to $OUTFILE.."
@ -79,13 +85,13 @@ echo "Extract strings to $OUTFILE.."
# shellcheck disable=SC2086 # $FINDOPTS is meant to be split
find_result=$(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f | LC_ALL=C sort -s)
total_files=$(wc -l <<< "${find_result}")
total_files=$(echo "${find_result}" | wc -l)
count=1
for file in $find_result
do
echo -ne " \r"
echo -ne "Reading file $count/$total_files..."
printf " \r"
printf "Reading file %d/%d..." "$count" "$total_files"
# On Windows, find still outputs the name of pruned folders
if [ ! -d "$file" ]
@ -94,9 +100,8 @@ do
xgettext $KEYWORDS --no-wrap -j -o "$OUTFILE" --from-code=UTF-8 "$file" || exit 1
sed -i.bkp "s/CHARSET/UTF-8/g" "$OUTFILE"
fi
(( count++ ))
count=$((count + 1))
done
echo -ne "\n"
echo "Interpolate metadata.."
@ -119,7 +124,7 @@ case "$MODE" in
;;
esac
if [ "" != "$1" ] && [ "$MODE" == "default" ]
if [ -n "$1" ] && [ "$MODE" = "default" ]
then
UPDATEFILE="$(resolve "${FULLPATH}/$1")"
echo "Merging new strings to $UPDATEFILE.."

View file

@ -7,6 +7,8 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* Starts the background processing
*
* @deprecated 2025.02 use `bin/console.php worker` instead
*/
if (php_sapi_name() !== 'cli') {
@ -14,66 +16,20 @@ if (php_sapi_name() !== 'cli') {
exit();
}
use Dice\Dice;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\Core\Update;
use Friendica\Core\Worker;
use Friendica\DI;
use Psr\Log\LoggerInterface;
// Get options
$shortopts = 'sn';
$longopts = ['spawn', 'no_cron'];
$options = getopt($shortopts, $longopts);
// Ensure that worker.php is executed from the base path of the installation
if (!file_exists("index.php") && (sizeof($_SERVER["argv"]) != 0)) {
$directory = dirname($_SERVER["argv"][0]);
if (substr($directory, 0, 1) != '/') {
$directory = $_SERVER["PWD"] . '/' . $directory;
}
$directory = realpath($directory . '/..');
chdir($directory);
}
chdir(dirname(__DIR__));
require dirname(__DIR__) . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::WORKER]]);
fwrite(STDOUT, '`bin/worker.php` is deprecated since 2025.02 and will be removed in 5 months, please use `bin/console.php worker` instead.' . \PHP_EOL);
DI::init($dice);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
// BC: Add console command as second argument
$argv = $_SERVER['argv'] ?? [];
array_splice($argv, 1, 0, "worker");
$_SERVER['argv'] = $argv;
DI::mode()->setExecutor(Mode::WORKER);
$container = \Friendica\Core\DiceContainer::fromBasePath(dirname(__DIR__));
// Check the database structure and possibly fixes it
Update::check(DI::basePath(), true);
$app = \Friendica\App::fromContainer($container);
// Quit when in maintenance
if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
return;
}
$spawn = array_key_exists('s', $options) || array_key_exists('spawn', $options);
if ($spawn) {
Worker::spawnWorker();
exit();
}
$run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options);
$process = DI::process()->create(getmypid(), basename(__FILE__));
Worker::processQueue($run_cron, $process);
Worker::unclaimProcess($process);
DI::process()->delete($process);
$app->processConsole($_SERVER);

View file

@ -29,13 +29,14 @@
"ext-xml": "*",
"asika/simple-console": "^1.0",
"bacon/bacon-qr-code": "^2.0.0",
"bower-asset/base64": "^1.0",
"divineomega/password_exposed": "^3",
"enyo/dropzone": "^5.9",
"ezyang/htmlpurifier": "^4.7",
"friendica/json-ld": "^1.0",
"geekwright/po": "^2.0",
"guzzlehttp/guzzle": "^7",
"guzzlehttp/oauth-subscriber": "^0.6",
"guzzlehttp/oauth-subscriber": "^0.8",
"kornrunner/blurhash": "^1.2",
"league/html-to-markdown": "^4.8",
"level-2/dice": "^4",
@ -46,37 +47,38 @@
"minishlink/web-push": "^6.0",
"mobiledetect/mobiledetectlib": "^3.74",
"nikic/fast-route": "^1.3",
"paragonie/hidden-string": "^1.0",
"patrickschur/language-detection": "^5.0.0",
"pear/console_table": "^1.3",
"phpseclib/phpseclib": "^3.0",
"pragmarx/google2fa": "^5.0",
"pragmarx/recovery": "^0.2",
"psr/clock": "^1.0",
"psr/container": "^2.0",
"psr/log": "^1.1",
"seld/cli-prompt": "^1.0",
"smarty/smarty": "^4",
"ua-parser/uap-php": "^3.9",
"xemlock/htmlpurifier-html5": "^0.1.11",
"fxp/composer-asset-plugin": "^1.4",
"bower-asset/base64": "^1.0",
"bower-asset/chart-js": "^2.8",
"bower-asset/dompurify": "^1.0",
"bower-asset/fork-awesome": "^1.1",
"npm-asset/chart.js": "^2.8",
"npm-asset/cropperjs": "1.2.2",
"npm-asset/dompurify": "^1.0",
"npm-asset/es-jquery-sortable": "^0.9.13",
"npm-asset/fork-awesome": "^1.1",
"npm-asset/fullcalendar": "^3.10",
"npm-asset/imagesloaded": "4.1.4",
"npm-asset/jgrowl": "^1.4",
"npm-asset/jquery": "^2.0",
"npm-asset/jquery-colorbox": "^1.6",
"npm-asset/jquery-datetimepicker": "^2.5",
"npm-asset/jgrowl": "^1.4",
"npm-asset/moment": "^2.24",
"npm-asset/perfect-scrollbar": "0.6.16",
"npm-asset/textcomplete": "^0.18.2",
"npm-asset/typeahead.js": "^0.11.1",
"textalk/websocket": "^1.6"
"oomphinc/composer-installers-extender": "^2.0",
"paragonie/hidden-string": "^1.0",
"patrickschur/language-detection": "^5.0.0",
"pear/console_table": "^1.3",
"phpseclib/phpseclib": "^3.0",
"phrity/websocket": "^1.7",
"pragmarx/google2fa": "^5.0",
"pragmarx/recovery": "^0.2",
"psr/clock": "^1.0",
"psr/container": "^1.1|^2.0",
"psr/event-dispatcher": "^1.0",
"psr/log": "^1.1",
"seld/cli-prompt": "^1.0",
"smarty/smarty": "^4",
"symfony/event-dispatcher": "^5.4",
"ua-parser/uap-php": "^3.9",
"xemlock/htmlpurifier-html5": "^0.1.11"
},
"suggest": {
"ext-imagick": "For faster image processing",
@ -88,13 +90,20 @@
{
"type": "vcs",
"url": "https://git.friendi.ca/friendica/php-json-ld"
},
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"autoload": {
"psr-4": {
"Friendica\\": "src/",
"Friendica\\Addon\\": "addon/"
}
"Friendica\\": "src/"
},
"classmap": ["addon/"],
"exclude-from-classmap": [
"addon/*/vendor/"
]
},
"autoload-dev": {
"psr-4": {
@ -105,14 +114,22 @@
"platform": {
"php": "7.4"
},
"sort-packages": true,
"autoloader-suffix": "Friendica",
"optimize-autoloader": true,
"preferred-install": "dist",
"fxp-asset": {
"installer-paths": {
"npm-asset-library": "view/asset",
"bower-asset-library": "view/asset"
"allow-plugins": {
"composer/installers": true,
"oomphinc/composer-installers-extender": true,
"php-http/discovery": false
}
},
"extra": {
"installer-types": ["bower-asset", "npm-asset"],
"installer-paths": {
"view/asset/{$name}/": [
"type:bower-asset",
"type:npm-asset"
]
}
},
"archive": {
@ -133,15 +150,24 @@
]
},
"require-dev": {
"mockery/mockery": "^1.3",
"dms/phpunit-arraysubset-asserts": "^0.3.1",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^9",
"dms/phpunit-arraysubset-asserts": "^0.3.1"
"mockery/mockery": "^1.3",
"php-mock/php-mock-mockery": "^1.5",
"php-mock/php-mock-phpunit": "^2.10",
"phpmd/phpmd": "^2.15",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^9"
},
"scripts": {
"test": "phpunit",
"test:unit": "phpunit -c tests/phpunit.xml --testsuite unit",
"phpmd": "phpmd src/ text .phpmd-ruleset.xml --color --cache",
"phpstan": "phpstan analyze --memory-limit 1024M --configuration .phpstan.neon",
"phpstan-addons": "phpstan analyze --memory-limit 1024M --configuration .phpstan-addons.neon",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './view/asset/*' -print0 | xargs -0 -n1 php -l",
"docker:translate": "docker run --rm -v $PWD:/data -w /data friendicaci/transifex bin/run_xgettext.sh",
"lang:recreate": "bin/run_xgettext.sh",
"cs:install": "@composer install --working-dir=bin/dev/php-cs-fixer",
"cs:check": [
"@cs:install",
@ -150,6 +176,9 @@
"cs:fix": [
"@cs:install",
"bin/dev/php-cs-fixer/vendor/bin/php-cs-fixer fix"
]
],
"cs:fix-develop": "TARGET_BRANCH=develop COMMAND=fix bin/dev/fix-codestyle.sh",
"db:update-structure": "bin/console.php dbstructure dumpsql > database.sql",
"install:prod": "@composer install -o --no-dev"
}
}

3143
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
-- ------------------------------------------
-- Friendica 2024.12 (Interrupted Fern)
-- DB_UPDATE_VERSION 1576
-- Friendica 2025.02-dev (Interrupted Fern)
-- DB_UPDATE_VERSION 1580
-- ------------------------------------------
@ -41,10 +41,13 @@ CREATE TABLE IF NOT EXISTS `gserver` (
`blocked` boolean COMMENT 'Server is blocked',
`failed` boolean COMMENT 'Connection failed',
`next_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT 'Next connection request',
`redirect-gsid` int unsigned COMMENT 'Target Gserver id in case of a redirect',
PRIMARY KEY(`id`),
UNIQUE INDEX `nurl` (`nurl`(190)),
INDEX `next_contact` (`next_contact`),
INDEX `network` (`network`)
INDEX `network` (`network`),
INDEX `redirect-gsid` (`redirect-gsid`),
FOREIGN KEY (`redirect-gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Global servers';
--
@ -1438,6 +1441,9 @@ CREATE TABLE IF NOT EXISTS `post-media` (
`publisher-url` varbinary(383) COMMENT 'URL of the publisher of the media',
`publisher-name` varchar(255) COMMENT 'Name of the publisher of the media',
`publisher-image` varbinary(383) COMMENT 'Image of the publisher of the media',
`language` char(3) COMMENT 'Language information about this media in the ISO 639 format',
`published` datetime COMMENT 'Publification date of this media',
`modified` datetime COMMENT 'Modification date of this media',
PRIMARY KEY(`id`),
UNIQUE INDEX `uri-id-url` (`uri-id`,`url`(512)),
INDEX `uri-id-id` (`uri-id`,`id`),
@ -1609,7 +1615,7 @@ CREATE TABLE IF NOT EXISTS `post-user` (
`psid` int unsigned COMMENT 'ID of the permission set of this post',
PRIMARY KEY(`id`),
UNIQUE INDEX `uid_uri-id` (`uid`,`uri-id`),
INDEX `uri-id` (`uri-id`),
INDEX `uri-id_origin_deleted` (`uri-id`,`origin`,`deleted`),
INDEX `parent-uri-id` (`parent-uri-id`),
INDEX `thr-parent-id` (`thr-parent-id`),
INDEX `external-id` (`external-id`),
@ -3809,7 +3815,8 @@ CREATE VIEW `pending-view` AS SELECT
`contact`.`nick` AS `nick`
FROM `register`
INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid`
INNER JOIN `user` ON `register`.`uid` = `user`.`uid`;
INNER JOIN `user` ON `register`.`uid` = `user`.`uid`
WHERE `register`.`uid` != 0;
--
-- VIEW tag-search-view

View file

@ -341,13 +341,13 @@ function samplestorage_storage_uninstall()
DI::storageManager()->unregister(SampleStorageBackend::class);
}
function samplestorage_storage_instance(App $a, array &$data)
function samplestorage_storage_instance(AppHelper $appHelper, array &$data)
{
$config = new SampleStorageBackendConfig(DI::l10n(), DI::config());
$data['storage'] = new SampleStorageBackendConfig($config->getFileName());
}
function samplestorage_storage_config(App $a, array &$data)
function samplestorage_storage_config(AppHelper $appHelper, array &$data)
{
$data['storage_config'] = new SampleStorageBackendConfig(DI::l10n(), DI::config());
}

View file

@ -876,7 +876,7 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
### src/Content/ContactBlock.php
Hook::callAll('contact_block_end', $arr);
Hook::callAll('contact_block_end', $text);
### src/Content/Text/BBCode.php

View file

@ -156,16 +156,6 @@ $a->config['register_policy'] = REGISTER_CLOSED;
'config' => [
'register_policy' => \Friendica\Module\Register::CLOSED,
],
</pre></td>
</tr>
<tr>
<td><pre>
$a->path = "value";
</pre></td>
<td><pre>
'system' => [
'urlpath' => 'value',
],
</pre></td>
</tr>
<tr>

View file

@ -62,7 +62,7 @@ If you want to have git automatically update the dependencies with composer, you
}
# `composer install` if the `composer.lock` file gets changed
# to update all the php dependencies
check_run composer.lock "bin/composer.phar install --no-dev"
check_run composer.lock "bin/composer.phar install"
just place it into `.git/hooks/post-merge` and make it executable.
@ -156,3 +156,98 @@ If you are interested in improving those clients, please contact the developers
* iOS: *currently no client*
* SailfishOS: **Friendiy** [src](https://kirgroup.com/projects/fabrixxm/harbour-friendly) - developed by [Fabio](https://kirgroup.com/profile/fabrixxm/profile)
* Windows: **Friendica Mobile** for Windows versions [before 8.1](http://windowsphone.com/s?appid=e3257730-c9cf-4935-9620-5261e3505c67) and [Windows 10](https://www.microsoft.com/store/apps/9nblggh0fhmn) - developed by [Gerhard Seeber](http://mozartweg.dyndns.org/friendica/profile/gerhard/profile)
## Backward compatibility
### Backward Compatibility Promise
Friendica can be extended by addons.
These addons relies on many classes and conventions from Friendica.
As developers our work on Friendica should not break things in the addons without giving the addon maintainers a chance to fix their addons.
Our goal is to build trust for the addon maintainers but also allow Friendica developers to move on.
This is called the Backward Compatibility Promise.
Inspired by the [Symonfy BC promise](https://symfony.com/doc/current/contributing/code/bc.html) we promise BC for every class, interface, trait, enum, function, constant, etc., but with the exception of:
- Classes, interfaces, traits, enums, functions, methods, properties and constants marked as `@internal` or `@private`
- Extending or modifying any non-abstract class or method in any way
- Extending or modifying a `final` class or method in any way
- Calling `private` methods (via Reflection)
- Accessing `private` properties (via Reflection)
- Accessing `private` methods (via Reflection)
- Accessing `private` constants (via Reflection)
- New properties on overridden `protected` methods
- Possible name collisions with new methods in an extended class (addon developers should prefix their custom methods in the extending classes in an appropriate way)
- Dropping support for every PHP version that has reached end of life
### Deprecation and removing features
As the development goes by Friendica needs to get rid of old code and concepts.
This will be done in 3 steps to give addon maintainers a chance to adjust their addons.
**1. Label deprecation**
If we as the Friendica maintainers decide to remove some functions, classes, interface, etc. we start this by adding a `@deprecated` PHPDoc note on the code.
For instance the class `Friendica\Core\Logger` should be removed, so we add the following note with a possible replacement:
```php
/**
* Logger functions
*
* @deprecated 2025.02 Use constructor injection or `DI::logger()` instead
*/
class Logger {/* ... */}
```
This way addon developers might be notified early by their IDE or other tools that the usage of the class is deprecated.
In Friendica we can now start to replace all occurrences and usage of this class with the alternative.
The deprecation label COULD be remain over multiple releases.
As long as the code that is labeled with `@deprecated` is used inside Friendica or the official addon repository, it SHOULD NOT be hard deprecated.
**2. Hard deprecation**
If the deprecated code is no longer used inside Friendica or the official addons it MUST be hard deprecated.
The code MUST NOT be deleted.
Starting from the next release, it MUST be stay for at least 5 months.
Hard deprecated code COULD remain longer than 5 months, depending on when a release appears.
Addon developer SHOULD NOT consider that they have more than 5 months to adjust their code.
Hard deprecation code means that the code triggers a muted `E_USER_DEPRECATION` error if it is called.
For instance with the deprecated class `Friendica\Core\Logger` the call of every method should trigger an error:
```php
/**
* Logger functions
*
* @deprecated 2025.02 Use constructor injection or `DI::logger()` instead
*/
class Logger {
public static function info(string $message, array $context = [])
{
@trigger_error('Class `' . __CLASS__ . '` is deprecated since 2025.05 and will be removed after 5 months, use constructor injection or `DI::logger()` instead.', E_USER_DEPRECATED);
self::getInstance()->info($message, $context);
}
/* ... */
}
```
This way the maintainer or users of addons will be notified in the logs that the addon will stop working in one of the next releases.
The addon maintainer now has at least 5 months or at least one release to fix the deprecations.
Please note that the deprecation message contains the release that will be released next.
In the example the code was hard deprecated with release `2025.05`, so it COULD be removed earliest with the `2025.11` release.
**3. Code Removing**
We promise BC for deprecated code for at least 5 months, starting from the release the deprecation was announced.
After this time the deprecated code COULD be remove within the next release.
Breaking changes MUST be happen only in a new release but MUST be hard deprecated first.
The BC promise refers only to releases, respective the `stable` branch.
Deprecated code on other branches like `develop` or RC branches could be removed earlier.
This is not a BC break as long as the release will be published 5 months after the hard deprecation.
If a release breaks BC without deprecation or earlier than 5 months, this SHOULD considered as a bug and BC SHOULD be restored in a bugfix release.

View file

@ -177,15 +177,18 @@ Example: Friendica Support
Friendica supports [Mastodon API](help/API-Mastodon) and [Twitter API | gnusocial](help/api).
This means you can use some of the Mastodon and Twitter clients for Friendica.
The available features are client specific and may differ.
Clients dedicated to Friendica are marked in **bold**.
#### Android
* [AndStatus](http://andstatus.org) ([F-Droid](https://f-droid.org/repository/browse/?fdid=org.andstatus.app), [Google Play](https://play.google.com/store/apps/details?id=org.andstatus.app))
* [Fedilab](https://fedilab.app) ([F-Droid](https://f-droid.org/app/fr.gouv.etalab.mastodon), [Google Play](https://play.google.com/store/apps/details?id=app.fedilab.android))
* [Friendiqa](https://git.friendi.ca/lubuwest/Friendiqa) ([F-Droid](https://git.friendi.ca/lubuwest/Friendiqa#install), [Google Play](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa))
* **[Friendiqa](https://git.friendi.ca/lubuwest/Friendiqa)** ([F-Droid](https://git.friendi.ca/lubuwest/Friendiqa#install), [Google Play](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa))
* [Husky](https://codeberg.org/husky/husky) ([F-Droid](https://f-droid.org/repository/browse/?fdid=su.xash.husky), [Google Play](https://play.google.com/store/apps/details?id=su.xash.husky))
* [Mastodon](https://github.com/mastodon/mastodon-android) ([F-Droid](https://f-droid.org/en/packages/org.joinmastodon.android/), [Google Play](https://play.google.com/store/apps/details?id=org.joinmastodon.android))
* [Pachli](https://pachli.app/) ([F-Droid](https://f-droid.org/en/packages/app.pachli/), [Google Play](https://play.google.com/store/apps/details?id=app.pachli))
* **[Raccoon for Friendica](https://github.com/LiveFastEatTrashRaccoon/RaccoonForFriendica)** ([F-Droid](https://f-droid.org/packages/com.livefast.eattrash.raccoonforfriendica), [Google Play](https://play.google.com/apps/testing/com.livefast.eattrash.raccoonforfriendica))
* **[Relatica](https://gitlab.com/mysocialportal/relatica)**
* [Subway Tooter](https://github.com/tateisu/SubwayTooter) ([F-Droid via Izzy](https://android.izzysoft.de/repo/apk/jp.juggler.subwaytooter.noFcm))
* [Tooot](https://tooot.app/) ([Google Play](https://play.google.com/store/apps/details?id=com.xmflsct.app.tooot))
* [Tusky](https://tusky.app) ([F-Droid](https://f-droid.org/repository/browse/?fdid=com.keylesspalace.tusky), [Google Play](https://play.google.com/store/apps/details?id=com.keylesspalace.tusky))
@ -195,6 +198,7 @@ The available features are client specific and may differ.
#### iOS
* [Mastodon](https://joinmastodon.org/apps) ([App Store](https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974))
* **[Relatica](https://gitlab.com/mysocialportal/relatica)**
* [Stella*](https://www.stella-app.net/) ([App Store](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048))
* [Tooot](https://github.com/tooot-app) ([App Store](https://apps.apple.com/app/id1549772269))
* [TwidereX](https://github.com/TwidereProject/TwidereX-iOS) ([App Store](https://apps.apple.com/app/twidere-x/id1530314034))
@ -202,17 +206,20 @@ The available features are client specific and may differ.
#### Linux
* [Choqok](https://choqok.kde.org)
* [Whalebird](https://whalebird.social/en/desktop/contents) ([GitHub](https://github.com/h3poteto/whalebird-desktop))
* **[Relatica](https://gitlab.com/mysocialportal/relatica)**
* [TheDesk](https://thedesk.top/en/) ([GitHub](https://github.com/cutls/TheDesk))
* [Toot](https://toot.readthedocs.io/en/latest/)
* [Whalebird](https://whalebird.social/en/desktop/contents) ([GitHub](https://github.com/h3poteto/whalebird-desktop))
#### macOS
* **[Relatica](https://gitlab.com/mysocialportal/relatica)**
* [TheDesk](https://thedesk.top/en/) ([GitHub](https://github.com/cutls/TheDesk))
* [Whalebird](https://whalebird.social/en/desktop/contents) ([App Store](https://apps.apple.com/de/app/whalebird/id1378283354), [GitHub](https://github.com/h3poteto/whalebird-desktop))
#### Windows
* **[Relatica](https://gitlab.com/mysocialportal/relatica)**
* [TheDesk](https://thedesk.top/en/) ([GitHub](https://github.com/cutls/TheDesk))
* [Whalebird](https://whalebird.social/en/desktop/contents) ([Microsoft Store](https://apps.microsoft.com/detail/9nbw4csdv5hc), [GitHub](https://github.com/h3poteto/whalebird-desktop))

View file

@ -76,14 +76,6 @@ This makes the software much easier to update.
The Linux commands to clone the repository into a directory "mywebsite" would be
git clone https://github.com/friendica/friendica.git -b stable mywebsite
cd mywebsite
bin/composer.phar install --no-dev
Make sure the folder *view/smarty3* exists and is writable by the webserver user, in this case *www-data*
mkdir -p view/smarty3
chown www-data:www-data view/smarty3
chmod 775 view/smarty3
Get the addons by going into your website folder.
@ -93,10 +85,20 @@ Clone the addon repository (separately):
git clone https://github.com/friendica/friendica-addons.git -b stable addon
Install the dependencies:
bin/composer.phar run install:prod
Make sure the folder *view/smarty3* exists and is writable by the webserver user, in this case *www-data*
mkdir -p view/smarty3
chown www-data:www-data view/smarty3
chmod 775 view/smarty3
If you want to use the development version of Friendica you can switch to the develop branch in the repository by running
git checkout develop
bin/composer.phar install
bin/composer.phar run install:prod
cd addon
git checkout develop
@ -216,7 +218,6 @@ All options will be saved in the `config/local.config.php` and are overruling th
- `-U|--dbuser <username>` The username of the mysql/mariadb database login (env `MYSQL_USER` or `MYSQL_USERNAME`)
- `-P|--dbpass <password>` The password of the mysql/mariadb database login (env `MYSQL_PASSWORD`)
- `-d|--dbdata <database>` The name of the mysql/mariadb database (env `MYSQL_DATABASE`)
- `-u|--urlpath <url_path>` The URL path of Friendica - f.e. '/friendica' (env `FRIENDICA_URL_PATH`)
- `-b|--phppath <php_path>` The path of the PHP binary (env `FRIENDICA_PHP_PATH`)
- `-A|--admin <mail>` The admin email address of Friendica (env `FRIENDICA_ADMIN_MAIL`)
- `-T|--tz <timezone>` The timezone of Friendica (env `FRIENDICA_TZ`)
@ -268,7 +269,7 @@ You might wish to delete/rename `config/local.config.php` to another name and dr
Set up a cron job or scheduled task to run the worker once every 5-10 minutes in order to perform background processing.
Example:
cd /base/directory; /path/to/php bin/worker.php
cd /base/directory; /path/to/php bin/console.php worker
Change "/base/directory", and "/path/to/php" as appropriate for your situation.
@ -277,7 +278,7 @@ Change "/base/directory", and "/path/to/php" as appropriate for your situation.
If you are using a Linux server, run "crontab -e" and add a line like the
one shown, substituting for your unique paths and settings:
*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/worker.php
*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/console.php worker
You can generally find the location of PHP by executing "which php".
If you run into trouble with this section please contact your hosting provider for assistance.
@ -290,11 +291,11 @@ Once you have installed Friendica and created an admin account as part of the pr
#### worker alternative: daemon
Otherwise, youll need to use the command line on your remote server and start the Friendica daemon (background task) using the following command:
cd /path/to/friendica; php bin/daemon.php start
cd /path/to/friendica; php bin/console.php daemon start
Once started, you can check the daemon status using the following command:
cd /path/to/friendica; php bin/daemon.php status
cd /path/to/friendica; php bin/console.php daemon status
After a server restart or any other failure, the daemon needs to be restarted.
This could be achieved by a cronjob.
@ -426,7 +427,7 @@ provided by one of our members.
>
> */10 * * * * cd /var/www/friendica/friendica/ && sudo -u www-data /usr/bin/php \
> -d suhosin.executor.func.blacklist=none \
> -d suhosin.executor.eval.blacklist=none -f bin/worker.php
> -d suhosin.executor.eval.blacklist=none -f bin/console.php
>
> This worked well for simple test cases, but the friendica-cron still failed
> with a fatal error:
@ -435,7 +436,7 @@ provided by one of our members.
> (attacker 'REMOTE_ADDR not set', file '/var/www/friendica/friendica/boot.php',
> line 1341)
>
> After a while I noticed, that `bin/worker.php` calls further PHP script via `proc_open`.
> After a while I noticed, that `bin/console.php worker` calls further PHP script via `proc_open`.
> These scripts themselves also use `proc_open` and fail, because they are NOT
> called with `-d suhosin.executor.func.blacklist=none`.
>

View file

@ -28,7 +28,7 @@ Jetstream is a service that connects to the Bluesky firehose.
With Jetstream, messages arrive in real time rather than having to be polled.
It also enables real-time processing of blocks or tracking activities performed by the user via the Bluesky website or application.
To enable Jetstream processing, run `bin/jetstream.php' from the command line.
To enable Jetstream processing, run `bin/console.php jetstream' from the command line.
You will need to define the process id file in local.config.php in the 'jetstream' section using the key 'pidfile'.
To keep track of the messages processed and the drift (the time difference between the date of the message and the date the system processed that message), some fields are added to the statistics endpoint.

View file

@ -57,7 +57,7 @@ Finally, you may also want to optimise your database with the following command:
### Going offline
Stop background tasks and put your server in maintenance mode.
1. If you had set up a worker cron job like this ``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php`` run ``crontab -e`` and comment out this line. Alternatively if you deploy a worker daemon, disable this instead.
1. If you had set up a worker cron job like this ``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/console.php worker`` run ``crontab -e`` and comment out this line. Alternatively if you deploy a worker daemon, disable this instead.
2. Put your server into maintenance mode: ``bin/console maintenance 1 "We are currently upgrading our system and will be back soon."``
## Dumping DB
@ -78,7 +78,7 @@ Ensure the newly created database credentials are identical to the setting in th
### Cron job for worker
Set up the required daily cron job.
Run ``crontab -e`` and add the following line according to your system specification
``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php``
``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/console.php worker``
### DNS settings
Adjust your DNS records by pointing them to your new server.

View file

@ -1,5 +1,5 @@
This is your Suggested Friends page.
If you get lost, you can <a href="help/Quick-Start-makenewfriends">click this link</a> to bring yourself back here.
If you get lost, you can <a href="help/Quick-Start-makingnewfriends">click this link</a> to bring yourself back here.
This is a bit like the Friend Suggestions page of Facebook.
Everybody on this list has agreed that they may be suggested as a friend.
@ -16,6 +16,6 @@ Click the link at the top of this page to go back to the suggested friends list
Feel uncomfortable adding people you don't know?
Don't worry - that's where <a href="help/Quick-Start-groupsandpages">Groups and Pages</a> come in!
<iframe src="suggest" width="950" height="600"></iframe>
<iframe src="contact/suggestions" width="950" height="600"></iframe>

View file

@ -419,7 +419,7 @@ We strongly discourage you from doing so, as this will break federation to other
Say you have a subdirectory for tests and put Friendica into a further subdirectory, the config would be:
'system' => [
'urlpath' => 'tests/friendica',
'url' => 'https://example.com/tests/friendica',
],
## Other exceptions

View file

@ -83,6 +83,8 @@ return [
## Addons
> ⚠️ Since Friendica 2025.02 the strategy hooks for addons are deprecated, please use PHP hooks instead.
The hook logic is useful for decoupling the Friendica core logic, but its primary goal is to modularize Friendica in creating addons.
Therefor you can either use the interfaces directly as shown above, or you can place your own `hooks.config.php` file inside a `static` directory directly under your addon core directory.

View file

@ -30,7 +30,7 @@ You can get the latest changes at any time with
cd path/to/friendica
git pull
bin/composer.phar install --no-dev
bin/composer.phar run install:prod
The addon tree has to be updated separately like so:

View file

@ -18,7 +18,7 @@ What you need to do:
Please use an up-to-date vagrant version from https://www.vagrantup.com/downloads.html.
2. Git clone your Friendica repository.
Inside, you'll find a `Vagrantfile` and some scripts in the `bin/dev` folder.
Pull the PHP requirements with `bin/composer install`.
Pull the PHP requirements with `bin/composer.phar install`.
3. Run `vagrant up` from inside the friendica clone.
This will start the virtual machine.
Be patient: When it runs for the first time, it downloads a Debian Server image and installs Friendica.

View file

@ -46,9 +46,9 @@ The code will be something like:
// mod/network.php
<?php
use Friendica\App;
use Friendica\AppHelper;
function network_content(App $a) {
function network_content(AppHelper $appHelper) {
$itemsmanager = new \Friendica\ItemsManager();
$items = $itemsmanager->getAll();

View file

@ -41,16 +41,24 @@ Fields
| blocked | Server is blocked | boolean | YES | | NULL | |
| failed | Connection failed | boolean | YES | | NULL | |
| next_contact | Next connection request | datetime | YES | | 0001-01-01 00:00:00 | |
| redirect-gsid | Target Gserver id in case of a redirect | int unsigned | YES | | NULL | |
Indexes
------------
| Name | Fields |
| ------------ | ----------------- |
| ------------- | ----------------- |
| PRIMARY | id |
| nurl | UNIQUE, nurl(190) |
| next_contact | next_contact |
| network | network |
| redirect-gsid | redirect-gsid |
Foreign Keys
------------
| Field | Target Table | Target Field |
|-------|--------------|--------------|
| redirect-gsid | [gserver](help/database/db_gserver) | id |
Return to [database documentation](help/database)

View file

@ -30,6 +30,9 @@ Fields
| publisher-url | URL of the publisher of the media | varbinary(383) | YES | | NULL | |
| publisher-name | Name of the publisher of the media | varchar(255) | YES | | NULL | |
| publisher-image | Image of the publisher of the media | varbinary(383) | YES | | NULL | |
| language | Language information about this media in the ISO 639 format | char(3) | YES | | NULL | |
| published | Publification date of this media | datetime | YES | | NULL | |
| modified | Modification date of this media | datetime | YES | | NULL | |
Indexes
------------

View file

@ -45,10 +45,10 @@ Indexes
------------
| Name | Fields |
| -------------------- | ----------------------- |
| --------------------- | ----------------------- |
| PRIMARY | id |
| uid_uri-id | UNIQUE, uid, uri-id |
| uri-id | uri-id |
| uri-id_origin_deleted | uri-id, origin, deleted |
| parent-uri-id | parent-uri-id |
| thr-parent-id | thr-parent-id |
| external-id | external-id |

View file

@ -362,7 +362,7 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
### src/Content/ContactBlock.php
Hook::callAll('contact_block_end', $arr);
Hook::callAll('contact_block_end', $text);
### src/Content/Text/BBCode.php

View file

@ -59,7 +59,7 @@ Der Linux-Code, mit dem man die Dateien direkt in ein Verzeichnis wie "meinewebs
git clone https://github.com/friendica/friendica.git -b stable mywebsite
cd mywebsite
bin/composer.phar install
bin/composer.phar run install:prod
Stelle sicher, dass der Ordner *view/smarty3* existiert and von dem Webserver-Benutzer beschreibbar ist
@ -85,7 +85,7 @@ Wenn du die Entwickler Version von Friendica verwenden möchtest kannst du auf d
Dies tust du mit den folgenden Befehlen
git checkout develop
bin/composer.phar install
bin/composer.phar run install:prod
cd addon
git checkout develop
@ -210,13 +210,13 @@ Gehe in den Friendica-Hauptordner und führe den Kommandozeilen Befehl aus:
Erstelle einen Cron job oder einen regelmäßigen Task, um den Poller alle 5-10 Minuten im Hintergrund ablaufen zu lassen.
Beispiel:
cd /base/directory; /path/to/php bin/worker.php
cd /base/directory; /path/to/php bin/console.php worker
Ändere "/base/directory" und "/path/to/php" auf deine Systemvorgaben.
Wenn du einen Linux-Server nutzt, benutze den Befehl "crontab -e" und ergänze eine Zeile wie die Folgende; angepasst an dein System
`*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/worker.php`
`*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/console.php worker`
Du kannst den PHP-Pfad finden, indem du den Befehl „which php“ ausführst.
Wenn du Schwierigkeiten mit diesem Schritt hast, kannst du deinen Hosting-Anbieter kontaktieren.

View file

@ -27,7 +27,7 @@ Jetstream ist ein Dienst, der sich mit dem Bluesky-Firehose verbindet.
Mit Jetstream kommen die Nachrichten in Echtzeit an und müssen nicht erst abgefragt werden.
Es ermöglicht auch die Echtzeitverarbeitung von Blöcken oder Tracking-Aktivitäten, die über die Bluesky-Website oder -Anwendung durchgeführt werden.
Um die Jetstream-Verarbeitung zu aktivieren, führe `bin/jetstream.php' über die Befehlszeile aus.
Um die Jetstream-Verarbeitung zu aktivieren, führe `bin/console.php daemon' über die Befehlszeile aus.
Du musst vorher die Prozess-ID-Datei in local.config.php im Abschnitt „jetstream“ mit dem Schlüssel „pidfile“ definieren.
Um die verarbeiteten Nachrichten und die Drift (die Zeitdifferenz zwischen dem Datum der Nachricht und dem Datum, an dem das System diese Nachricht verarbeitet hat) zu verfolgen, wurden dem Statistik-Endpunkt einige Felder hinzugefügt.

View file

@ -4,7 +4,7 @@ Neue Freunde finden
* [Zur Startseite der Hilfe](help)
Hier siehst Du die Kontaktvorschläge.
Wenn Du Dich mal verirrt hast, kannst Du diesen Link klicken und wieder hierher kommen.
Wenn Du Dich mal verirrt hast, kannst Du <a href="help/Quick-Start-makingnewfriends">diesen Link klicken</a> und wieder hierher kommen.
Diese Seite funktioniert in etwa wie die Seite für Kontaktvorschläge in Facebook.
Jeder auf dieser Liste hat zugestimmt, als Kontaktvorschlag zu erscheinen.
@ -23,6 +23,6 @@ Klicke einfach auf den Link oben auf dieser Seite und Du gelangst zur Seite mit
Du willst nicht einfach Personen hinzufügen, die du nicht kennst?
Kein Problem - an dieser Stelle kommen wir zu den <a href="help/Quick-Start-groupsandpages">Gruppen und Seiten</a>.
<iframe src="suggest" width="950" height="600"></iframe>
<iframe src="contact/suggestions" width="950" height="600"></iframe>

View file

@ -410,7 +410,7 @@ Wir raten allerdings dringen davon ab, da es die Interoperabilität mit anderen
Mal angenommen, du hast ein Unterverzeichnis tests und willst Friendica in ein weiteres Unterverzeichnis installieren, dann lautet die Konfiguration hierfür:
'system' => [
'urlpath' => 'tests/friendica',
'url' => 'https://example.com/tests/friendica',
],
## Weitere Ausnahmen

35
doc/stats.md Normal file
View file

@ -0,0 +1,35 @@
Monitoring
===========
* [Home](help)
## Endpoints
Currently, there are two endpoints for statistics available
- `/stats` Returns some basic statistics of the current node
- `/stats/caching` Returns statistics of cache or lock instances, which are used for the currend node
### `/stats`
The statistics contain data about the worker performance, the last cron call, number of reports, inbound and outbound packets, posts and comments.
### `/stats/caching`
The statistics contain data about the opcache, the used caching (like memory usage, hits/misses, entries, ...) and the used lock (including the cache data)
## Configuration
Please define 'stats_key' in your local.config.php in the 'system' section to be able to access the statistics page at /stats?key=your-defined-stats_key
## 3rd Party monitoring tools
### Zabbix
To monitor the health status of your Friendica installation, you can use for example a tool like Zabbix.
### Prometheus
To use [prometheus](https://prometheus.io) for gathering metrics, use the [Friendica exporter](https://git.friendi.ca/friendica/friendica-exporter).
You can find the installation instructions here: https://git.friendi.ca/friendica/friendica-exporter#installation

View file

@ -78,15 +78,3 @@ The following will compress */var/log/friendica* (assuming this is the location
daily
rotate 2
}
### Zabbix
To monitor the health status of your Friendica installation, you can use for example a tool like Zabbix. Please define 'stats_key' in your local.config.php in the 'system' section to be able to access the statistics page at /stats?key=your-defined-stats_key
The statistics contain data about the worker performance, the last cron call, number of reports, inbound and outbound packets, posts and comments.
### Prometheus
To use [prometheus](https://prometheus.io) for gathering metrics, use the [Friendica exporter](https://git.friendi.ca/friendica/friendica-exporter).
You can find the installation instructions here: https://git.friendi.ca/friendica/friendica-exporter#installation

View file

@ -5,38 +5,18 @@
//
// SPDX-License-Identifier: AGPL-3.0-or-later
use Dice\Dice;
$start_time = microtime(true);
if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
die('Vendor path not found. Please execute "bin/composer.phar --no-dev install" on the command line in the web root.');
die('Vendor path not found. Please execute "bin/composer.phar run install:prod" on the command line in the web root.');
}
require __DIR__ . '/vendor/autoload.php';
$dice = (new Dice())->addRules(include __DIR__ . '/static/dependencies.config.php');
/** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
$addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
$dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
$dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode', [false, $_SERVER], Dice::CHAIN_CALL]]]);
$request = \GuzzleHttp\Psr7\ServerRequest::fromGlobals();
\Friendica\DI::init($dice);
$container = \Friendica\Core\DiceContainer::fromBasePath(__DIR__);
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
$app = \Friendica\App::fromContainer($container);
$a = \Friendica\DI::app();
\Friendica\DI::mode()->setExecutor(\Friendica\App\Mode::INDEX);
$a->runFrontend(
$dice->create(\Friendica\App\Router::class),
$dice->create(\Friendica\Core\PConfig\Capability\IManagePersonalConfigValues::class),
$dice->create(\Friendica\Security\Authentication::class),
$dice->create(\Friendica\App\Page::class),
$dice->create(\Friendica\Content\Nav::class),
$dice->create(Friendica\Module\Special\HTTPException::class),
new \Friendica\Util\HTTPInputData($_SERVER),
$start_time,
$_SERVER
);
$app->processRequest($request, $start_time);

View file

@ -16,16 +16,14 @@
* information.
*/
use Friendica\App;
use Friendica\Content\Conversation;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Event\ArrayFilterEvent;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\ItemURI;
@ -45,7 +43,11 @@ function item_post()
item_drop($uid, $_REQUEST['dropitems']);
}
Hook::callAll('post_local_start', $_REQUEST);
$eventDispatcher = DI::eventDispatcher();
$_REQUEST = $eventDispatcher->dispatch(
new ArrayFilterEvent(ArrayFilterEvent::INSERT_POST_LOCAL_START, $_REQUEST)
)->getArray();
$return_path = $_REQUEST['return'] ?? '';
$preview = intval($_REQUEST['preview'] ?? 0);
@ -57,7 +59,7 @@ function item_post()
*/
if (!$preview && !empty($_REQUEST['post_id_random'])) {
if (DI::session()->get('post-random') == $_REQUEST['post_id_random']) {
Logger::warning('duplicate post');
DI::logger()->warning('duplicate post');
item_post_return(DI::baseUrl(), $return_path);
} else {
DI::session()->set('post-random', $_REQUEST['post_id_random']);
@ -166,7 +168,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat
// This enables interaction like starring and saving into folders
if ($toplevel_item['uid'] == 0) {
$stored = Item::storeForUserByUriId($toplevel_item['uri-id'], $post['uid'], ['post-reason' => Item::PR_ACTIVITY]);
Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $post['uid'], 'stored' => $stored]);
DI::logger()->info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $post['uid'], 'stored' => $stored]);
}
$post['parent'] = $toplevel_item['id'];
@ -198,7 +200,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat
$post = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]);
if (!$post) {
Logger::error('Item couldn\'t be fetched.', ['post_id' => $post_id]);
DI::logger()->error('Item couldn\'t be fetched.', ['post_id' => $post_id]);
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -214,7 +216,7 @@ function item_insert(int $uid, array $request, bool $preview, string $return_pat
DI::contentItem()->copyPermissions($post['thr-parent-id'], $post['uri-id'], $post['parent-uri-id']);
}
Logger::debug('post_complete');
DI::logger()->debug('post_complete');
item_post_return(DI::baseUrl(), $return_path);
// NOTREACHED
@ -277,14 +279,24 @@ function item_process(array $post, array $request, bool $preview, string $return
System::jsonExit(['preview' => $o]);
}
Hook::callAll('post_local', $post);
$eventDispatcher = DI::eventDispatcher();
$hook_data = [
'item' => $post,
];
$hook_data = $eventDispatcher->dispatch(
new ArrayFilterEvent(ArrayFilterEvent::INSERT_POST_LOCAL, $hook_data)
)->getArray();
$post = $hook_data['item'] ?? $post;
unset($post['edit']);
unset($post['self']);
unset($post['api_source']);
if (!empty($request['scheduled_at'])) {
$scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::app()->getTimeZone());
$scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::appHelper()->getTimeZone());
if ($scheduled_at > DateTimeFormat::utcNow()) {
unset($post['created']);
unset($post['edited']);
@ -298,7 +310,7 @@ function item_process(array $post, array $request, bool $preview, string $return
}
if (!empty($post['cancel'])) {
Logger::info('mod_item: post cancelled by addon.');
DI::logger()->info('mod_item: post cancelled by addon.');
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
@ -325,12 +337,12 @@ function item_post_return($baseurl, $return_path)
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
}
Logger::debug('post_json', ['json' => $json]);
DI::logger()->debug('post_json', ['json' => $json]);
System::jsonExit($json);
}
function item_content(App $a)
function item_content()
{
if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\UnauthorizedException();
@ -445,7 +457,7 @@ function drop_item(int $id, string $return = ''): string
item_redirect_after_action($item, $return);
//NOTREACHED
} else {
Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]);
DI::logger()->warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]);
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('display/' . $item['guid']);
//NOTREACHED

View file

@ -7,7 +7,6 @@
*
*/
use Friendica\App;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
@ -15,7 +14,7 @@ use Friendica\Model\User;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
function lostpass_post(App $a)
function lostpass_post()
{
$loginame = trim($_POST['login-name']);
if (!$loginame) {
@ -78,7 +77,7 @@ function lostpass_post(App $a)
DI::baseUrl()->redirect();
}
function lostpass_content(App $a)
function lostpass_content()
{
if (DI::args()->getArgc() > 1) {
$pwdreset_token = DI::args()->getArgv()[1];

View file

@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2010-2024, the Friendica project
* SPDX-FileCopyrightText: 2010-2024 the Friendica project
@ -207,7 +208,7 @@ function message_content()
$r = get_messages(DI::userSession()->getLocalUserId(), $pager->getStart(), $pager->getItemsPerPage());
if (!DBA::isResult($r)) {
DI::sysmsg()->addNotice(DI::l10n()->t('No messages.'));
$o .= DI::l10n()->t('You have no messages.');
return $o;
}
@ -222,7 +223,8 @@ function message_content()
$o .= $header;
$message = DBA::fetchFirst("
$message = DBA::fetchFirst(
"
SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb`
FROM `mail`
LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
@ -245,7 +247,8 @@ function message_content()
} else {
$sql_extra = "AND `mail`.`parent-uri` = ?";
}
$messages_stmt = DBA::p("
$messages_stmt = DBA::p(
"
SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb`
FROM `mail`
LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
@ -396,8 +399,7 @@ function get_messages(int $uid, int $start, int $limit): array
LEFT JOIN `contact` c ON m.`contact-id` = c.`id`
WHERE m.`uid` = ?
ORDER BY m2.`mailcreated` DESC
LIMIT ?, ?'
, $uid, $uid, $start, $limit));
LIMIT ?, ?', $uid, $uid, $start, $limit));
}
function render_messages(array $msg, string $t): string

View file

@ -7,7 +7,6 @@
*
*/
use Friendica\App;
use Friendica\Content\Conversation;
use Friendica\Content\Nav;
use Friendica\Content\Pager;
@ -17,7 +16,7 @@ use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Module\BaseProfile;
function notes_init(App $a)
function notes_init()
{
if (! DI::userSession()->getLocalUserId()) {
return;
@ -27,8 +26,10 @@ function notes_init(App $a)
}
function notes_content(App $a, bool $update = false)
function notes_content(bool $update = false)
{
$contactId = DI::appHelper()->getContactId();
if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
@ -46,11 +47,11 @@ function notes_content(App $a, bool $update = false)
'acl_data' => '',
];
$o .= DI::conversation()->statusEditor($x, $a->getContactId());
$o .= DI::conversation()->statusEditor($x, $contactId);
}
$condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
'contact-id'=> $a->getContactId()];
'contact-id'=> $contactId];
if (DI::mode()->isMobile()) {
$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',

View file

@ -11,14 +11,12 @@ use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode;
use Friendica\Core\ACL;
use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Event\ArrayFilterEvent;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Photo;
@ -28,9 +26,7 @@ use Friendica\Model\Tag;
use Friendica\Model\User;
use Friendica\Module\BaseProfile;
use Friendica\Network\HTTPException;
use Friendica\Network\Probe;
use Friendica\Protocol\Activity;
use Friendica\Protocol\ActivityNamespace;
use Friendica\Security\Security;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
@ -49,7 +45,7 @@ function photos_init()
Nav::setSelected('home');
if (DI::args()->getArgc() > 1) {
$owner = Profile::load(DI::app(), DI::args()->getArgv()[1], false);
$owner = Profile::load(DI::appHelper(), DI::args()->getArgv()[1], false);
if (!isset($owner['account_removed']) || $owner['account_removed']) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
@ -279,7 +275,7 @@ function photos_post()
}
if (!empty($_POST['rotate']) && (intval($_POST['rotate']) == 1 || intval($_POST['rotate']) == 2)) {
Logger::debug('rotate');
DI::logger()->debug('rotate');
$photo = Photo::getPhotoForUser($page_owner_uid, $resource_id);
@ -651,7 +647,11 @@ function photos_content()
'default_upload' => true
];
Hook::callAll('photo_upload_form', $ret);
$eventDispatcher = DI::eventDispatcher();
$eventDispatcher->dispatch(
new ArrayFilterEvent(ArrayFilterEvent::PHOTO_UPLOAD_FORM, $ret)
);
$default_upload_box = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_box.tpl'), []);
$default_upload_submit = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_submit.tpl'), [
@ -1022,14 +1022,14 @@ function photos_content()
}
}
$tags = ['title' => DI::l10n()->t('Tags: '), 'tags' => $tag_arr];
if ($cmd === 'edit') {
if ($cmd === 'edit' && !empty($tag_arr)) {
$tags['removeanyurl'] = 'post/' . $link_item['id'] . '/tag/remove?return=' . urlencode(DI::args()->getCommand());
$tags['removetitle'] = DI::l10n()->t('[Select tags to remove]');
}
}
$edit = Null;
$edit = null;
if ($cmd === 'edit' && $can_post) {
$edit_tpl = Renderer::getMarkupTemplate('photo_edit.tpl');
@ -1070,6 +1070,7 @@ function photos_content()
$cmnt_tpl = Renderer::getMarkupTemplate('comment_item.tpl');
$tpl = Renderer::getMarkupTemplate('photo_item.tpl');
$return_path = DI::args()->getCommand();
$addonHelper = DI::addonHelper();
if (!DBA::isResult($items)) {
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
@ -1078,7 +1079,7 @@ function photos_content()
* This should be better if done by a hook
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
if ($addonHelper->isAddonEnabled('qcomment')) {
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
@ -1134,7 +1135,7 @@ function photos_content()
* This should be better if done by a hook
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
if ($addonHelper->isAddonEnabled('qcomment')) {
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}
@ -1214,7 +1215,7 @@ function photos_content()
* This should be better if done by a hook
*/
$qcomment = null;
if (Addon::isEnabled('qcomment')) {
if ($addonHelper->isAddonEnabled('qcomment')) {
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
$qcomment = $words ? explode("\n", $words) : [];
}

View file

@ -9,14 +9,13 @@
*
*/
use Friendica\App;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Post;
use Friendica\Model\Contact;
function update_contact_content(App $a)
function update_contact_content()
{
if (!empty(DI::args()->get(1)) && !empty($_GET['force'])) {
$contact = DBA::selectFirst('account-user-view', ['pid', 'deleted'], ['id' => DI::args()->get(1)]);

View file

@ -8,13 +8,11 @@
* AJAX synchronisation of notes page
*/
use Friendica\App;
use Friendica\Core\System;
use Friendica\DI;
require_once 'mod/notes.php';
function update_notes_content(App $a)
function update_notes_content()
{
$profile_uid = intval($_GET['p']);
@ -28,7 +26,7 @@ function update_notes_content(App $a)
*
*/
$text = notes_content($a, $profile_uid);
$text = notes_content($profile_uid);
System::htmlUpdateExit($text);
}

View file

@ -6,4 +6,4 @@ Description=Friendica Worker
User=http
#Adapt the path in the following line to your system, use 'which php' to find php path,
#provide the absolute path for worker.php
ExecStart=/usr/bin/php /www/path/bin/worker.php &
ExecStart=/usr/bin/php /www/path/bin/console.php worker &

View file

@ -7,34 +7,50 @@
namespace Friendica;
use Exception;
use Dice\Dice;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\App\Page;
use Friendica\App\Request;
use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Capabilities\ICanHandleRequests;
use Friendica\Content\Nav;
use Friendica\Core\Addon\AddonHelper;
use Friendica\Core\Addon\Capability\ICanLoadAddons;
use Friendica\Core\Config\Factory\Config;
use Friendica\Core\Container;
use Friendica\Core\Hooks\HookEventBridge;
use Friendica\Core\Logger\LoggerManager;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\DiceContainer;
use Friendica\Core\L10n;
use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\Core\Logger\Handler\ErrorHandler;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\System;
use Friendica\Core\Update;
use Friendica\Database\Definition\DbaDefinition;
use Friendica\Database\Definition\ViewDefinition;
use Friendica\Event\ConfigLoadedEvent;
use Friendica\Event\Event;
use Friendica\Module\Maintenance;
use Friendica\Security\Authentication;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Database\Database;
use Friendica\Module\Special\HTTPException as ModuleHTTPException;
use Friendica\Network\HTTPException;
use Friendica\Protocol\ATProtocol\DID;
use Friendica\Security\Authentication;
use Friendica\Security\ExAuth;
use Friendica\Security\OpenWebAuth;
use Friendica\Util\BasePath;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\HTTPInputData;
use Friendica\Util\HTTPSignature;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Log\LoggerInterface;
/**
@ -46,27 +62,29 @@ use Psr\Log\LoggerInterface;
* and anything else that might need to be passed around
* before we spit the page out.
*
* @final
*/
class App
{
const PLATFORM = 'Friendica';
const CODENAME = 'Interrupted Fern';
const VERSION = '2024.12';
// Allow themes to control internal parameters
// by changing App values in theme.php
private $theme_info = [
'videowidth' => 425,
'videoheight' => 350,
];
private $timezone = '';
private $profile_owner = 0;
private $contact_id = 0;
private $queue = [];
const VERSION = '2025.02-dev';
/**
* @var App\Mode The Mode of the Application
* @internal
*/
public static function fromContainer(Container $container): self
{
return new self($container);
}
/**
* @var Container
*/
private $container;
/**
* @var Mode The Mode of the Application
*/
private $mode;
@ -75,11 +93,6 @@ class App
*/
private $baseURL;
/** @var string The name of the current theme */
private $currentTheme;
/** @var string The name of the current mobile theme */
private $currentMobileTheme;
/** @var string */
private $requestId;
@ -101,11 +114,6 @@ class App
*/
private $profiler;
/**
* @var Database The Friendica database connection
*/
private $database;
/**
* @var L10n The translator
*/
@ -116,190 +124,239 @@ class App
*/
private $args;
/**
* @var IManagePersonalConfigValues
*/
private $pConfig;
/**
* @var IHandleUserSessions
*/
private $session;
/**
* Set the profile owner ID
*
* @param int $owner_id
* @return void
* @var AppHelper $appHelper
*/
public function setProfileOwner(int $owner_id)
private $appHelper;
private function __construct(Container $container)
{
$this->profile_owner = $owner_id;
$this->container = $container;
}
/**
* Get the profile owner ID
*
* @return int
* @internal
*/
public function getProfileOwner(): int
public function processRequest(ServerRequestInterface $request, float $start_time): void
{
return $this->profile_owner;
$this->container->addRule(Mode::class, [
'call' => [
['determineRunMode', [false, $request->getServerParams()], Dice::CHAIN_CALL],
],
]);
$this->setupContainerForAddons();
$this->setupLogChannel(LogChannel::APP);
$this->setupLegacyServiceLocator();
$this->registerErrorHandler();
$this->registerEventDispatcher();
$this->requestId = $this->container->create(Request::class)->getRequestId();
$this->auth = $this->container->create(Authentication::class);
$this->config = $this->container->create(IManageConfigValues::class);
$this->mode = $this->container->create(Mode::class);
$this->baseURL = $this->container->create(BaseURL::class);
$this->logger = $this->container->create(LoggerInterface::class);
$this->profiler = $this->container->create(Profiler::class);
$this->l10n = $this->container->create(L10n::class);
$this->args = $this->container->create(Arguments::class);
$this->session = $this->container->create(IHandleUserSessions::class);
$this->appHelper = $this->container->create(AppHelper::class);
$addonHelper = $this->container->create(AddonHelper::class);
$this->load(
$request->getServerParams(),
$this->container->create(DbaDefinition::class),
$this->container->create(ViewDefinition::class),
$this->mode,
$this->config,
$this->profiler,
$this->container->create(EventDispatcherInterface::class),
$this->appHelper,
$addonHelper,
);
$this->registerTemplateEngine();
$this->runFrontend(
$this->container->create(EventDispatcherInterface::class),
$this->container->create(IManagePersonalConfigValues::class),
$this->container->create(Page::class),
$this->container->create(Nav::class),
$addonHelper,
$this->container->create(ModuleHTTPException::class),
$start_time,
$request
);
}
/**
* Set the contact ID
*
* @param int $contact_id
* @return void
* @internal
*/
public function setContactId(int $contact_id)
public function processConsole(array $serverParams): void
{
$this->contact_id = $contact_id;
$argv = $serverParams['argv'] ?? [];
$this->setupContainerForAddons();
$this->setupLogChannel($this->determineLogChannel($argv));
$this->setupLegacyServiceLocator();
$this->registerErrorHandler();
$this->registerEventDispatcher();
$this->load(
$serverParams,
$this->container->create(DbaDefinition::class),
$this->container->create(ViewDefinition::class),
$this->container->create(Mode::class),
$this->container->create(IManageConfigValues::class),
$this->container->create(Profiler::class),
$this->container->create(EventDispatcherInterface::class),
$this->container->create(AppHelper::class),
$this->container->create(AddonHelper::class),
);
$this->registerTemplateEngine();
(\Friendica\Core\Console::create($this->container, $argv))->execute();
}
/**
* Get the contact ID
*
* @return int
* @internal
*/
public function getContactId(): int
public function processEjabberd(array $serverParams): void
{
return $this->contact_id;
$this->setupContainerForAddons();
$this->setupLogChannel(LogChannel::AUTH_JABBERED);
$this->setupLegacyServiceLocator();
$this->registerErrorHandler();
$this->registerEventDispatcher();
$this->load(
$serverParams,
$this->container->create(DbaDefinition::class),
$this->container->create(ViewDefinition::class),
$this->container->create(Mode::class),
$this->container->create(IManageConfigValues::class),
$this->container->create(Profiler::class),
$this->container->create(EventDispatcherInterface::class),
$this->container->create(AppHelper::class),
$this->container->create(AddonHelper::class),
);
/** @var BasePath */
$basePath = $this->container->create(BasePath::class);
// Check the database structure and possibly fixes it
Update::check($basePath->getPath(), true);
$appMode = $this->container->create(Mode::class);
if ($appMode->isNormal()) {
/** @var ExAuth $oAuth */
$oAuth = $this->container->create(ExAuth::class);
$oAuth->readStdin();
}
}
/**
* Set the timezone
*
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
* @return void
*/
public function setTimeZone(string $timezone)
private function setupContainerForAddons(): void
{
$this->timezone = (new \DateTimeZone($timezone))->getName();
DateTimeFormat::setLocalTimeZone($this->timezone);
/** @var ICanLoadAddons $addonLoader */
$addonLoader = $this->container->create(ICanLoadAddons::class);
foreach ($addonLoader->getActiveAddonConfig('dependencies') as $name => $rule) {
$this->container->addRule($name, $rule);
}
}
/**
* Get the timezone
*
* @return int
*/
public function getTimeZone(): string
private function determineLogChannel(array $argv): string
{
return $this->timezone;
$command = strtolower($argv[1] ?? '');
if ($command === 'daemon' || $command === 'jetstream') {
return LogChannel::DAEMON;
}
/**
* Set workerqueue information
*
* @param array $queue
* @return void
*/
public function setQueue(array $queue)
{
$this->queue = $queue;
if ($command === 'worker') {
return LogChannel::WORKER;
}
/**
* Fetch workerqueue information
*
* @return array Worker queue
*/
public function getQueue(): array
{
return $this->queue ?? [];
// @TODO Add support for jetstream
return LogChannel::CONSOLE;
}
/**
* Fetch a specific workerqueue field
*
* @param string $index Work queue record to fetch
* @return mixed Work queue item or NULL if not found
*/
public function getQueueValue(string $index)
private function setupLogChannel(string $logChannel): void
{
return $this->queue[$index] ?? null;
/** @var LoggerManager */
$loggerManager = $this->container->create(LoggerManager::class);
$loggerManager->changeLogChannel($logChannel);
}
public function setThemeInfoValue(string $index, $value)
private function setupLegacyServiceLocator(): void
{
$this->theme_info[$index] = $value;
if ($this->container instanceof DiceContainer) {
DI::init($this->container->getDice());
}
}
public function getThemeInfo()
private function registerErrorHandler(): void
{
return $this->theme_info;
ErrorHandler::register($this->container->create(LoggerInterface::class));
}
public function getThemeInfoValue(string $index, $default = null)
private function registerEventDispatcher(): void
{
return $this->theme_info[$index] ?? $default;
/** @var \Friendica\Event\EventDispatcher */
$eventDispatcher = $this->container->create(EventDispatcherInterface::class);
foreach (HookEventBridge::getStaticSubscribedEvents() as $eventName => $methodName) {
$eventDispatcher->addListener($eventName, [HookEventBridge::class, $methodName]);
}
}
/**
* Returns the current config cache of this node
*
* @return Cache
*/
public function getConfigCache()
private function registerTemplateEngine(): void
{
return $this->config->getCache();
}
/**
* The basepath of this app
*
* @return string Base path from configuration
*/
public function getBasePath(): string
{
return $this->config->get('system', 'basepath');
}
/**
* @param Database $database The Friendica Database
* @param IManageConfigValues $config The Configuration
* @param App\Mode $mode The mode of this Friendica app
* @param BaseURL $baseURL The full base URL of this Friendica app
* @param LoggerInterface $logger The current app logger
* @param Profiler $profiler The profiler of this application
* @param L10n $l10n The translator instance
* @param App\Arguments $args The Friendica Arguments of the call
* @param IManagePersonalConfigValues $pConfig Personal configuration
* @param IHandleUserSessions $session The (User)Session handler
* @param DbaDefinition $dbaDefinition
* @param ViewDefinition $viewDefinition
*/
public function __construct(Request $request, Authentication $auth, Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition)
{
$this->requestId = $request->getRequestId();
$this->auth = $auth;
$this->database = $database;
$this->config = $config;
$this->mode = $mode;
$this->baseURL = $baseURL;
$this->profiler = $profiler;
$this->logger = $logger;
$this->l10n = $l10n;
$this->args = $args;
$this->pConfig = $pConfig;
$this->session = $session;
$this->load($dbaDefinition, $viewDefinition);
Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine');
}
/**
* Load the whole app instance
*/
protected function load(DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition)
{
if ($this->config->get('system', 'ini_max_execution_time') !== false) {
set_time_limit((int)$this->config->get('system', 'ini_max_execution_time'));
private function load(
array $serverParams,
DbaDefinition $dbaDefinition,
ViewDefinition $viewDefinition,
Mode $mode,
IManageConfigValues $config,
Profiler $profiler,
EventDispatcherInterface $eventDispatcher,
AppHelper $appHelper,
AddonHelper $addonHelper
): void {
if ($config->get('system', 'ini_max_execution_time') !== false) {
set_time_limit((int) $config->get('system', 'ini_max_execution_time'));
}
if ($this->config->get('system', 'ini_pcre_backtrack_limit') !== false) {
ini_set('pcre.backtrack_limit', (int)$this->config->get('system', 'ini_pcre_backtrack_limit'));
if ($config->get('system', 'ini_pcre_backtrack_limit') !== false) {
ini_set('pcre.backtrack_limit', (int) $config->get('system', 'ini_pcre_backtrack_limit'));
}
// Normally this constant is defined - but not if "pcntl" isn't installed
@ -310,27 +367,20 @@ class App
// Ensure that all "strtotime" operations do run timezone independent
date_default_timezone_set('UTC');
set_include_path(
get_include_path() . PATH_SEPARATOR
. $this->getBasePath() . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR
. $this->getBasePath() . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR
. $this->getBasePath());
$profiler->reset();
$this->profiler->reset();
if ($this->mode->has(App\Mode::DBAVAILABLE)) {
if ($mode->has(Mode::DBAVAILABLE)) {
Core\Hook::loadHooks();
$loader = (new Config())->createConfigFileManager($this->getBasePath(), $_SERVER);
Core\Hook::callAll('load_config', $loader);
$loader = (new Config())->createConfigFileManager($appHelper->getBasePath(), $addonHelper->getAddonPath(), $serverParams);
$eventDispatcher->dispatch(new ConfigLoadedEvent(ConfigLoadedEvent::CONFIG_LOADED, $loader));
// Hooks are now working, reload the whole definitions with hook enabled
$dbaDefinition->load(true);
$viewDefinition->load(true);
}
$this->loadDefaultTimezone();
// Register template engines
Core\Renderer::registerTemplateEngine('Friendica\Render\FriendicaSmartyEngine');
$this->loadDefaultTimezone($config, $appHelper);
}
/**
@ -340,166 +390,16 @@ class App
*
* @global string $default_timezone
*/
private function loadDefaultTimezone()
private function loadDefaultTimezone(IManageConfigValues $config, AppHelper $appHelper)
{
if ($this->config->get('system', 'default_timezone')) {
$timezone = $this->config->get('system', 'default_timezone', 'UTC');
if ($config->get('system', 'default_timezone')) {
$timezone = $config->get('system', 'default_timezone', 'UTC');
} else {
global $default_timezone;
$timezone = $default_timezone ?? '' ?: 'UTC';
}
$this->setTimeZone($timezone);
}
/**
* Returns the current theme name. May be overridden by the mobile theme name.
*
* @return string Current theme name or empty string in installation phase
* @throws Exception
*/
public function getCurrentTheme(): string
{
if ($this->mode->isInstall()) {
return '';
}
// Specific mobile theme override
if (($this->mode->isMobile() || $this->mode->isTablet()) && $this->session->get('show-mobile', true)) {
$user_mobile_theme = $this->getCurrentMobileTheme();
// --- means same mobile theme as desktop
if (!empty($user_mobile_theme) && $user_mobile_theme !== '---') {
return $user_mobile_theme;
}
}
if (!$this->currentTheme) {
$this->computeCurrentTheme();
}
return $this->currentTheme;
}
/**
* Returns the current mobile theme name.
*
* @return string Mobile theme name or empty string if installer
* @throws Exception
*/
public function getCurrentMobileTheme(): string
{
if ($this->mode->isInstall()) {
return '';
}
if (is_null($this->currentMobileTheme)) {
$this->computeCurrentMobileTheme();
}
return $this->currentMobileTheme;
}
/**
* Setter for current theme name
*
* @param string $theme Name of current theme
*/
public function setCurrentTheme(string $theme)
{
$this->currentTheme = $theme;
}
/**
* Setter for current mobile theme name
*
* @param string $theme Name of current mobile theme
*/
public function setCurrentMobileTheme(string $theme)
{
$this->currentMobileTheme = $theme;
}
/**
* Computes the current theme name based on the node settings, the page owner settings and the user settings
*
* @throws Exception
*/
private function computeCurrentTheme()
{
$system_theme = $this->config->get('system', 'theme');
if (!$system_theme) {
throw new Exception($this->l10n->t('No system theme config value set.'));
}
// Sane default
$this->setCurrentTheme($system_theme);
$page_theme = null;
// Find the theme that belongs to the user whose stuff we are looking at
if (!empty($this->profile_owner) && ($this->profile_owner != $this->session->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]);
if ($this->database->isResult($user) && !$this->session->getLocalUserId()) {
$page_theme = $user['theme'];
}
}
$theme_name = $page_theme ?: $this->session->get('theme', $system_theme);
$theme_name = Strings::sanitizeFilePathItem($theme_name);
if ($theme_name
&& in_array($theme_name, Theme::getAllowedList())
&& (file_exists('view/theme/' . $theme_name . '/style.css')
|| file_exists('view/theme/' . $theme_name . '/style.php'))
) {
$this->setCurrentTheme($theme_name);
}
}
/**
* Computes the current mobile theme name based on the node settings, the page owner settings and the user settings
*/
private function computeCurrentMobileTheme()
{
$system_mobile_theme = $this->config->get('system', 'mobile-theme', '');
// Sane default
$this->setCurrentMobileTheme($system_mobile_theme);
$page_mobile_theme = null;
// Find the theme that belongs to the user whose stuff we are looking at
if (!empty($this->profile_owner) && ($this->profile_owner != $this->session->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
if (!$this->session->getLocalUserId()) {
$page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme');
}
}
$mobile_theme_name = $page_mobile_theme ?: $this->session->get('mobile-theme', $system_mobile_theme);
$mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name);
if ($mobile_theme_name == '---'
||
in_array($mobile_theme_name, Theme::getAllowedList())
&& (file_exists('view/theme/' . $mobile_theme_name . '/style.css')
|| file_exists('view/theme/' . $mobile_theme_name . '/style.php'))
) {
$this->setCurrentMobileTheme($mobile_theme_name);
}
}
/**
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @return string Current theme's stylesheet path
* @throws Exception
*/
public function getCurrentThemeStylesheetPath(): string
{
return Core\Theme::getStylesheetPath($this->getCurrentTheme());
$appHelper->setTimeZone($timezone);
}
/**
@ -510,23 +410,34 @@ class App
*
* This probably should change to limit the size of this monster method.
*
* @param App\Router $router
* @param IManagePersonalConfigValues $pconfig
* @param Authentication $auth The Authentication backend of the node
* @param App\Page $page The Friendica page printing container
* @param Page $page The Friendica page printing container
* @param ModuleHTTPException $httpException The possible HTTP Exception container
* @param HTTPInputData $httpInput A library for processing PHP input streams
* @param float $start_time The start time of the overall script execution
* @param array $server The $_SERVER array
*
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, Nav $nav, ModuleHTTPException $httpException, HTTPInputData $httpInput, float $start_time, array $server)
{
$requeststring = ($server['REQUEST_METHOD'] ?? '') . ' ' . ($server['REQUEST_URI'] ?? '') . ' ' . ($server['SERVER_PROTOCOL'] ?? '');
$this->logger->debug('Request received', ['address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '']);
private function runFrontend(
EventDispatcherInterface $eventDispatcher,
IManagePersonalConfigValues $pconfig,
Page $page,
Nav $nav,
AddonHelper $addonHelper,
ModuleHTTPException $httpException,
float $start_time,
ServerRequestInterface $request
) {
$this->mode->setExecutor(Mode::INDEX);
$httpInput = new HTTPInputData($request->getServerParams());
$serverVars = $request->getServerParams();
$queryVars = $request->getQueryParams();
$requeststring = ($serverVars['REQUEST_METHOD'] ?? '') . ' ' . ($serverVars['REQUEST_URI'] ?? '') . ' ' . ($serverVars['SERVER_PROTOCOL'] ?? '');
$this->logger->debug('Request received', ['address' => $serverVars['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $serverVars['HTTP_REFERER'] ?? '', 'user-agent' => $serverVars['HTTP_USER_AGENT'] ?? '']);
$request_start = microtime(true);
$request = $_REQUEST;
$this->profiler->set($start_time, 'start');
$this->profiler->set(microtime(true), 'classinit');
@ -536,54 +447,55 @@ class App
try {
// Missing DB connection: ERROR
if ($this->mode->has(App\Mode::LOCALCONFIGPRESENT) && !$this->mode->has(App\Mode::DBAVAILABLE)) {
if ($this->mode->has(Mode::LOCALCONFIGPRESENT) && !$this->mode->has(Mode::DBAVAILABLE)) {
throw new HTTPException\InternalServerErrorException($this->l10n->t('Apologies but the website is unavailable at the moment.'));
}
if (!$this->mode->isInstall()) {
// Force SSL redirection
if ($this->config->get('system', 'force_ssl') &&
(empty($server['HTTPS']) || $server['HTTPS'] === 'off') &&
(empty($server['HTTP_X_FORWARDED_PROTO']) || $server['HTTP_X_FORWARDED_PROTO'] === 'http') &&
!empty($server['REQUEST_METHOD']) &&
$server['REQUEST_METHOD'] === 'GET') {
(empty($serverVars['HTTPS']) || $serverVars['HTTPS'] === 'off') &&
(empty($serverVars['HTTP_X_FORWARDED_PROTO']) || $serverVars['HTTP_X_FORWARDED_PROTO'] === 'http') &&
!empty($serverVars['REQUEST_METHOD']) &&
$serverVars['REQUEST_METHOD'] === 'GET') {
System::externalRedirect($this->baseURL . '/' . $this->args->getQueryString());
}
Core\Hook::callAll('init_1');
$eventDispatcher->dispatch(new Event(Event::INIT));
}
DID::routeRequest($this->args->getCommand(), $server);
DID::routeRequest($this->args->getCommand(), $serverVars);
if ($this->mode->isNormal() && !$this->mode->isBackend()) {
$requester = HTTPSignature::getSigner('', $server);
$requester = HTTPSignature::getSigner('', $serverVars);
if (!empty($requester)) {
OpenWebAuth::addVisitorCookieForHandle($requester);
}
}
// ZRL
if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !$this->session->getLocalUserId()) {
if (!empty($queryVars['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !$this->session->getLocalUserId()) {
// Only continue when the given profile link seems valid.
// Valid profile links contain a path with "/profile/" and no query parameters
if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') &&
strpos(parse_url($_GET['zrl'], PHP_URL_PATH) ?? '', '/profile/') !== false) {
$this->auth->setUnauthenticatedVisitor($_GET['zrl']);
if ((parse_url($queryVars['zrl'], PHP_URL_QUERY) == '') &&
strpos(parse_url($queryVars['zrl'], PHP_URL_PATH) ?? '', '/profile/') !== false) {
$this->auth->setUnauthenticatedVisitor($queryVars['zrl']);
OpenWebAuth::zrlInit();
} else {
// Someone came with an invalid parameter, maybe as a DDoS attempt
// We simply stop processing here
$this->logger->debug('Invalid ZRL parameter.', ['zrl' => $_GET['zrl']]);
$this->logger->debug('Invalid ZRL parameter.', ['zrl' => $queryVars['zrl']]);
throw new HTTPException\ForbiddenException();
}
}
if (!empty($_GET['owt']) && $this->mode->isNormal()) {
$token = $_GET['owt'];
if (!empty($queryVars['owt']) && $this->mode->isNormal()) {
$token = $queryVars['owt'];
OpenWebAuth::init($token);
}
if (!$this->mode->isBackend()) {
$auth->withSession($this);
$this->auth->withSession();
}
if ($this->session->isUnauthenticated()) {
@ -600,12 +512,12 @@ class App
// but we need "view" module for stylesheet
if ($this->mode->isInstall() && $moduleName !== 'install') {
$this->baseURL->redirect('install');
} else {
Core\Update::check($this->getBasePath(), false);
Core\Addon::loadAddons();
Core\Hook::loadHooks();
}
Core\Update::check($this->appHelper->getBasePath(), false);
$addonHelper->loadAddons();
Core\Hook::loadHooks();
// Compatibility with Hubzilla
if ($moduleName == 'rpost') {
$this->baseURL->redirect('compose');
@ -648,12 +560,12 @@ class App
$page['page_title'] = $moduleName;
// The "view" module is required to show the theme CSS
if (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') {
$module = $router->getModule(Maintenance::class);
if (!$this->mode->isInstall() && !$this->mode->has(Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') {
$module = $this->createModuleInstance(Maintenance::class);
} else {
// determine the module class and save it to the module instance
// @todo there's an implicit dependency due SESSION::start(), so it has to be called here (yet)
$module = $router->getModule();
$module = $this->createModuleInstance(null);
}
// Display can change depending on the requested language, so it shouldn't be cached whole
@ -661,7 +573,15 @@ class App
// Processes data from GET requests
$httpinput = $httpInput->process();
$input = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST);
if (!is_array($httpinput['variables'])) {
$httpinput['variables'] = [];
}
if (!is_array($httpinput['files'])) {
$httpinput['files'] = [];
}
$input = array_merge($httpinput['variables'], $httpinput['files'], $request);
// Let the module run its internal process (init, get, post, ...)
$timestamp = microtime(true);
@ -670,37 +590,45 @@ class App
// Wrapping HTML responses in the theme template
if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
$response = $page->run($this, $this->session, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $nav, $this->session->getLocalUserId());
$response = $page->run($this->appHelper, $this->session, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $nav, $this->session->getLocalUserId());
}
$this->logger->debug('Request processed sucessfully', ['response' => $response->getStatusCode(), 'address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]);
$this->logSlowCalls(microtime(true) - $request_start, $response->getStatusCode(), $requeststring, $server['HTTP_USER_AGENT'] ?? '');
$this->logger->debug('Request processed sucessfully', ['response' => $response->getStatusCode(), 'address' => $serverVars['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $serverVars['HTTP_REFERER'] ?? '', 'user-agent' => $serverVars['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]);
$this->logSlowCalls(microtime(true) - $request_start, $response->getStatusCode(), $requeststring, $serverVars['HTTP_USER_AGENT'] ?? '');
System::echoResponse($response);
} catch (HTTPException $e) {
$this->logger->debug('Request processed with exception', ['response' => $e->getCode(), 'address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]);
$this->logSlowCalls(microtime(true) - $request_start, $e->getCode(), $requeststring, $server['HTTP_USER_AGENT'] ?? '');
$this->logger->debug('Request processed with exception', ['response' => $e->getCode(), 'address' => $serverVars['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $serverVars['HTTP_REFERER'] ?? '', 'user-agent' => $serverVars['HTTP_USER_AGENT'] ?? '', 'duration' => number_format(microtime(true) - $request_start, 3)]);
$this->logSlowCalls(microtime(true) - $request_start, $e->getCode(), $requeststring, $serverVars['HTTP_USER_AGENT'] ?? '');
$httpException->rawContent($e);
}
$page->logRuntime($this->config, 'runFrontend');
}
/**
* Automatically redirects to relative or absolute URL
* Should only be used if it isn't clear if the URL is either internal or external
*
* @param string $toUrl The target URL
*
* @throws HTTPException\InternalServerErrorException
*/
public function redirect(string $toUrl)
private function createModuleInstance(?string $moduleClass = null): ICanHandleRequests
{
if (!empty(parse_url($toUrl, PHP_URL_SCHEME))) {
Core\System::externalRedirect($toUrl);
} else {
$this->baseURL->redirect($toUrl);
/** @var Router $router */
$router = $this->container->create(Router::class);
$moduleClass = $moduleClass ?? $router->getModuleClass();
$parameters = $router->getParameters();
$dice_profiler_threshold = $this->config->get('system', 'dice_profiler_threshold', 0);
$stamp = microtime(true);
/** @var ICanHandleRequests $module */
$module = $this->container->create($moduleClass, $parameters);
if ($dice_profiler_threshold > 0) {
$dur = floatval(microtime(true) - $stamp);
if ($dur >= $dice_profiler_threshold) {
$this->logger->notice('Dice module creation lasts too long.', ['duration' => round($dur, 3), 'module' => $moduleClass, 'parameters' => $parameters]);
}
}
return $module;
}
/**
* Log slow page executions
*

View file

@ -17,8 +17,7 @@ use Psr\Http\Message\UriInterface;
use Psr\Log\LoggerInterface;
/**
* A class which checks and contains the basic
* environment for the BaseURL (url, urlpath, ssl_policy, hostname, scheme)
* A class which checks and contains the basic environment for the BaseURL (url)
*/
class BaseURL extends Uri implements UriInterface
{
@ -43,8 +42,7 @@ class BaseURL extends Uri implements UriInterface
/* Relative script path to the web server root
* Not all of those $_SERVER properties can be present, so we do by inverse priority order
*/
$relativeScriptPath =
($server['REDIRECT_URL'] ?? '') ?:
$relativeScriptPath = ($server['REDIRECT_URL'] ?? '') ?:
($server['REDIRECT_URI'] ?? '') ?:
($server['REDIRECT_SCRIPT_URL'] ?? '') ?:
($server['SCRIPT_URL'] ?? '') ?:
@ -103,6 +101,8 @@ class BaseURL extends Uri implements UriInterface
* @throws HTTPException\TemporaryRedirectException
*
* @throws HTTPException\InternalServerErrorException In Case the given URL is not relative to the Friendica node
*
* @return never
*/
public function redirect(string $toUrl = '', bool $ssl = false)
{

View file

@ -210,7 +210,7 @@ class Mode
public function isInstall(): bool
{
return !$this->has(Mode::LOCALCONFIGPRESENT) ||
!$this->has(MODE::DBAVAILABLE);
!$this->has(Mode::DBAVAILABLE);
}
/**

View file

@ -11,23 +11,24 @@ use ArrayAccess;
use DOMDocument;
use DOMXPath;
use Friendica\App;
use Friendica\AppHelper;
use Friendica\Content\Nav;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Model\UserSession;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Module\Response;
use Friendica\DI;
use Friendica\Event\HtmlFilterEvent;
use Friendica\Network\HTTPException;
use Friendica\Util\Images;
use Friendica\Util\Network;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use GuzzleHttp\Psr7\Utils;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Http\Message\ResponseInterface;
/**
@ -70,6 +71,8 @@ class Page implements ArrayAccess
*/
private $basePath;
private EventDispatcherInterface $eventDispatcher;
private $timestamp = 0;
private $method = '';
private $module = '';
@ -78,10 +81,11 @@ class Page implements ArrayAccess
/**
* @param string $basepath The Page basepath
*/
public function __construct(string $basepath)
public function __construct(string $basepath, EventDispatcherInterface $eventDispatcher)
{
$this->timestamp = microtime(true);
$this->basePath = $basepath;
$this->eventDispatcher = $eventDispatcher;
}
public function setLogging(string $method, string $module, string $command)
@ -102,7 +106,7 @@ class Page implements ArrayAccess
$load = number_format(System::currentLoad(), 2);
$runtime = number_format(microtime(true) - $this->timestamp, 3);
if ($runtime > $config->get('system', 'runtime_loglimit')) {
Logger::debug('Runtime', ['method' => $this->method, 'module' => $this->module, 'runtime' => $runtime, 'load' => $load, 'origin' => $origin, 'signature' => $signature, 'request' => $_SERVER['REQUEST_URI'] ?? '']);
DI::logger()->debug('Runtime', ['method' => $this->method, 'module' => $this->module, 'runtime' => $runtime, 'load' => $load, 'origin' => $origin, 'signature' => $signature, 'request' => $_SERVER['REQUEST_URI'] ?? '']);
}
}
@ -176,7 +180,6 @@ class Page implements ArrayAccess
* - Infinite scroll data
* - head.tpl template
*
* @param App $app The Friendica App instance
* @param Arguments $args The Friendica App Arguments
* @param L10n $l10n The l10n language instance
* @param IManageConfigValues $config The Friendica configuration
@ -185,31 +188,26 @@ class Page implements ArrayAccess
*
* @throws HTTPException\InternalServerErrorException
*/
private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, int $localUID)
{
$interval = ($localUID ? $pConfig->get($localUID, 'system', 'update_interval') : 40000);
// If the update is 'deactivated' set it to the highest integer number (~24 days)
if ($interval < 0) {
$interval = 2147483647;
}
if ($interval < 10000) {
$interval = 40000;
}
private function initHead(
AppHelper $appHelper,
Arguments $args,
L10n $l10n,
IManageConfigValues $config,
IManagePersonalConfigValues $pConfig,
int $localUID
) {
// Default title: current module called
if (empty($this->page['title']) && $args->getModuleName()) {
$this->page['title'] = ucfirst($args->getModuleName());
$this->page['title'] = $l10n->t(ucfirst($args->getModuleName()));
}
// Prepend the sitename to the page title
$this->page['title'] = $config->get('config', 'sitename', '') . (!empty($this->page['title']) ? ' | ' . $this->page['title'] : '');
// Append the sitename to the page title
$this->page['title'] = (!empty($this->page['title']) ? $this->page['title'] . ' | ' : '') . $config->get('config', 'sitename', '');
if (!empty(Renderer::$theme['stylesheet'])) {
$stylesheet = Renderer::$theme['stylesheet'];
} else {
$stylesheet = $app->getCurrentThemeStylesheetPath();
$stylesheet = $appHelper->getCurrentThemeStylesheetPath();
}
$this->registerStylesheet($stylesheet);
@ -224,7 +222,9 @@ class Page implements ArrayAccess
$touch_icon = 'images/friendica-192.png';
}
Hook::callAll('head', $this->page['htmlhead']);
$this->page['htmlhead'] = $this->eventDispatcher->dispatch(
new HtmlFilterEvent(HtmlFilterEvent::HEAD, $this->page['htmlhead'])
)->getHtml();
$tpl = Renderer::getMarkupTemplate('head.tpl');
/* put the head template at the beginning of page['htmlhead']
@ -263,7 +263,7 @@ class Page implements ArrayAccess
'$local_user' => $localUID,
'$generator' => 'Friendica' . ' ' . App::VERSION,
'$update_interval' => $interval,
'$update_content' => (int)$pConfig->get($localUID, 'system', 'update_content'),
'$shortcut_icon' => $shortcut_icon,
'$touch_icon' => $touch_icon,
'$block_public' => intval($config->get('system', 'block_public')),
@ -313,7 +313,6 @@ class Page implements ArrayAccess
* - Registered footer scripts (through App->registerFooterScript())
* - footer.tpl template
*
* @param App $app The Friendica App instance
* @param Mode $mode The Friendica runtime mode
* @param L10n $l10n The l10n instance
*
@ -347,11 +346,14 @@ class Page implements ArrayAccess
]);
}
Hook::callAll('footer', $this->page['footer']);
$this->page['footer'] = $this->eventDispatcher->dispatch(
new HtmlFilterEvent(HtmlFilterEvent::FOOTER, $this->page['footer'])
)->getHtml();
$tpl = Renderer::getMarkupTemplate('footer.tpl');
$this->page['footer'] = Renderer::replaceMacros($tpl, [
'$footerScripts' => array_unique($this->footerScripts),
'$close' => $l10n->t('Close'),
]) . $this->page['footer'];
}
@ -371,7 +373,9 @@ class Page implements ArrayAccess
{
// initialise content region
if ($mode->isNormal()) {
Hook::callAll('page_content_top', $this->page['content']);
$this->page['content'] = $this->eventDispatcher->dispatch(
new HtmlFilterEvent(HtmlFilterEvent::PAGE_CONTENT_TOP, $this->page['content'])
)->getHtml();
}
$this->page['content'] .= (string)$response->getBody();
@ -399,7 +403,6 @@ class Page implements ArrayAccess
/**
* Executes the creation of the current page and prints it to the screen
*
* @param App $app The Friendica App
* @param BaseURL $baseURL The Friendica Base URL
* @param Arguments $args The Friendica App arguments
* @param Mode $mode The current node mode
@ -414,8 +417,20 @@ class Page implements ArrayAccess
* @throws HTTPException\InternalServerErrorException
* @throws HTTPException\ServiceUnavailableException
*/
public function run(App $app, UserSession $session, BaseURL $baseURL, Arguments $args, Mode $mode, ResponseInterface $response, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig, Nav $nav, int $localUID)
{
public function run(
AppHelper $appHelper,
UserSession $session,
BaseURL $baseURL,
Arguments $args,
Mode $mode,
ResponseInterface $response,
L10n $l10n,
Profiler $profiler,
IManageConfigValues $config,
IManagePersonalConfigValues $pconfig,
Nav $nav,
int $localUID
) {
$moduleName = $args->getModuleName();
$this->command = $moduleName;
@ -430,7 +445,7 @@ class Page implements ArrayAccess
$this->initContent($response, $mode);
// Load current theme info after module has been initialized as theme could have been set in module
$currentTheme = $app->getCurrentTheme();
$currentTheme = $appHelper->getCurrentTheme();
$theme_info_file = 'view/theme/' . $currentTheme . '/theme.php';
if (file_exists($theme_info_file)) {
require_once $theme_info_file;
@ -438,7 +453,7 @@ class Page implements ArrayAccess
if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) {
$func = str_replace('-', '_', $currentTheme) . '_init';
$func($app);
$func($appHelper);
}
/* Create the page head after setting the language
@ -448,7 +463,7 @@ class Page implements ArrayAccess
* all the module functions have executed so that all
* theme choices made by the modules can take effect.
*/
$this->initHead($app, $args, $l10n, $config, $pconfig, $localUID);
$this->initHead($appHelper, $args, $l10n, $config, $pconfig, $localUID);
/* Build the page ending -- this is stuff that goes right before
* the closing </body> tag
@ -458,7 +473,9 @@ class Page implements ArrayAccess
$profiler->set(microtime(true) - $timestamp, 'aftermath');
if (!$mode->isAjax()) {
Hook::callAll('page_end', $this->page['content']);
$this->page['content'] = $this->eventDispatcher->dispatch(
new HtmlFilterEvent(HtmlFilterEvent::PAGE_END, $this->page['content'])
)->getHtml();
}
// Add the navigation (menu) template
@ -534,7 +551,7 @@ class Page implements ArrayAccess
}
// Theme templates expect $a as an App instance
$a = $app;
$a = $appHelper;
// Used as is in view/php/default.php
$lang = $l10n->getCurrentLang();

View file

@ -7,13 +7,11 @@
namespace Friendica\App;
use Dice\Dice;
use FastRoute\DataGenerator\GroupCountBased;
use FastRoute\Dispatcher;
use FastRoute\RouteCollector;
use FastRoute\RouteParser\Std;
use Friendica\Capabilities\ICanHandleRequests;
use Friendica\Core\Addon;
use Friendica\Core\Addon\AddonHelper;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -21,6 +19,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Lock\Capability\ICanLock;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Event\CollectRoutesEvent;
use Friendica\LegacyModule;
use Friendica\Module\HTTPException\MethodNotAllowed;
use Friendica\Module\HTTPException\PageNotFound;
@ -30,6 +29,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Network\HTTPException\MethodNotAllowedException;
use Friendica\Network\HTTPException\NotFoundException;
use Friendica\Util\Router\FriendicaGroupCountBased;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
/**
@ -86,15 +86,13 @@ class Router
/** @var LoggerInterface */
private $logger;
private EventDispatcherInterface $eventDispatcher;
private AddonHelper $addonHelper;
/** @var bool */
private $isLocalUser;
/** @var float */
private $dice_profiler_threshold;
/** @var Dice */
private $dice;
/** @var string */
private $baseRoutesFilepath;
@ -113,11 +111,10 @@ class Router
* @param IManageConfigValues $config
* @param Arguments $args
* @param LoggerInterface $logger
* @param Dice $dice
* @param IHandleUserSessions $userSession
* @param RouteCollector|null $routeCollector
*/
public function __construct(array $server, string $baseRoutesFilepath, L10n $l10n, ICanCache $cache, ICanLock $lock, IManageConfigValues $config, Arguments $args, LoggerInterface $logger, Dice $dice, IHandleUserSessions $userSession, RouteCollector $routeCollector = null)
public function __construct(array $server, string $baseRoutesFilepath, L10n $l10n, ICanCache $cache, ICanLock $lock, IManageConfigValues $config, Arguments $args, LoggerInterface $logger, EventDispatcherInterface $eventDispatcher, AddonHelper $addonHelper, IHandleUserSessions $userSession, RouteCollector $routeCollector = null)
{
$this->baseRoutesFilepath = $baseRoutesFilepath;
$this->l10n = $l10n;
@ -125,11 +122,11 @@ class Router
$this->lock = $lock;
$this->args = $args;
$this->config = $config;
$this->dice = $dice;
$this->server = $server;
$this->logger = $logger;
$this->eventDispatcher = $eventDispatcher;
$this->addonHelper = $addonHelper;
$this->isLocalUser = !empty($userSession->getLocalUserId());
$this->dice_profiler_threshold = $config->get('system', 'dice_profiler_threshold', 0);
$this->routeCollector = $routeCollector ?? new RouteCollector(new Std(), new GroupCountBased());
@ -156,10 +153,12 @@ class Router
$this->addRoutes($routeCollector, $routes);
$this->routeCollector = $routeCollector;
// Add routes from addons
Hook::callAll('route_collection', $this->routeCollector);
$routeCollector = $this->eventDispatcher->dispatch(
new CollectRoutesEvent(CollectRoutesEvent::COLLECT_ROUTES, $routeCollector),
)->getRouteCollector();
$this->routeCollector = $routeCollector;
return $this;
}
@ -302,7 +301,7 @@ class Router
} catch (NotFoundException $e) {
$moduleName = $this->args->getModuleName();
// Then we try addon-provided modules that we wrap in the LegacyModule class
if (Addon::isEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) {
if ($this->addonHelper->isAddonEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) {
//Check if module is an app and if public access to apps is allowed or not
$privateapps = $this->config->get('config', 'private_addons', false);
if (!$this->isLocalUser && Hook::isAddonApp($moduleName) && $privateapps) {
@ -328,23 +327,9 @@ class Router
}
}
public function getModule(?string $module_class = null): ICanHandleRequests
public function getParameters(): array
{
$moduleClass = $module_class ?? $this->getModuleClass();
$stamp = microtime(true);
try {
/** @var ICanHandleRequests $module */
return $this->dice->create($moduleClass, $this->parameters);
} finally {
if ($this->dice_profiler_threshold > 0) {
$dur = floatval(microtime(true) - $stamp);
if ($dur >= $this->dice_profiler_threshold) {
$this->logger->notice('Dice module creation lasts too long.', ['duration' => round($dur, 3), 'module' => $moduleClass, 'parameters' => $this->parameters]);
}
}
}
return $this->parameters;
}
/**

139
src/AppHelper.php Normal file
View file

@ -0,0 +1,139 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica;
use Exception;
use Friendica\Core\Config\ValueObject\Cache;
/**
* Helper for our main application structure for the life of this page.
*
* Primarily deals with the URL that got us here
* and tries to make some sense of it, and
* stores our page contents and config storage
* and anything else that might need to be passed around
* before we spit the page out.
*
*/
interface AppHelper
{
/**
* Set the profile owner ID
*/
public function setProfileOwner(int $owner_id);
/**
* Get the profile owner ID
*/
public function getProfileOwner(): int;
/**
* Set the timezone
*
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
*/
public function setTimeZone(string $timezone);
/**
* Get the timezone name
*/
public function getTimeZone(): string;
/**
* Set the contact ID
*/
public function setContactId(int $contact_id);
/**
* Get the contact ID
*/
public function getContactId(): int;
/**
* Set workerqueue information
*
* @param array<string,mixed> $queue
*/
public function setQueue(array $queue);
/**
* Fetch workerqueue information
*
* @return array<string,mixed> Worker queue
*/
public function getQueue();
/**
* Fetch a specific workerqueue field
*
* @param string $index Work queue record to fetch
*
* @return mixed|null Work queue item or NULL if not found
*/
public function getQueueValue(string $index);
/**
* Returns the current theme name. May be overridden by the mobile theme name.
*
* @return string Current theme name or empty string in installation phase
* @throws Exception
*/
public function getCurrentTheme(): string;
/**
* Returns the current mobile theme name.
*
* @return string Mobile theme name or empty string if installer
* @throws Exception
*/
public function getCurrentMobileTheme(): string;
/**
* Setter for current theme name
*
* @param string $theme Name of current theme
*/
public function setCurrentTheme(string $theme);
/**
* Setter for current mobile theme name
*
* @param string $theme Name of current mobile theme
*/
public function setCurrentMobileTheme(string $theme);
public function setThemeInfoValue(string $index, $value);
public function getThemeInfo();
public function getThemeInfoValue(string $index, $default = null);
/**
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @return string Current theme's stylesheet path
* @throws Exception
*/
public function getCurrentThemeStylesheetPath(): string;
/**
* Returns the current config cache of this node
*
* @return Cache
*/
public function getConfigCache();
/**
* The basepath of this app
*
* @return string Base path from configuration
*/
public function getBasePath(): string;
public function redirect(string $toUrl);
}

400
src/AppLegacy.php Normal file
View file

@ -0,0 +1,400 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica;
use DateTimeZone;
use Exception;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Database\Database;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
/**
* Helper for our main application structure for the life of this page.
*
* Primarily deals with the URL that got us here
* and tries to make some sense of it, and
* stores our page contents and config storage
* and anything else that might need to be passed around
* before we spit the page out.
*
* @internal
*/
final class AppLegacy implements AppHelper
{
private $profile_owner = 0;
private $timezone = '';
private $contact_id = 0;
private $queue = [];
/** @var string The name of the current theme */
private $currentTheme;
/** @var string The name of the current mobile theme */
private $currentMobileTheme;
// Allow themes to control internal parameters
// by changing App values in theme.php
private $theme_info = [
'videowidth' => 425,
'videoheight' => 350,
];
/**
* @var Database The Friendica database connection
*/
private $database;
/**
* @var IManageConfigValues The config
*/
private $config;
/**
* @var Mode The Mode of the Application
*/
private $mode;
/**
* @var BaseURL
*/
private $baseURL;
/**
* @var L10n The translator
*/
private $l10n;
/**
* @var IManagePersonalConfigValues
*/
private $pConfig;
/**
* @var IHandleUserSessions
*/
private $session;
public function __construct(
Database $database,
IManageConfigValues $config,
Mode $mode,
BaseURL $baseURL,
L10n $l10n,
IManagePersonalConfigValues $pConfig,
IHandleUserSessions $session
) {
$this->database = $database;
$this->config = $config;
$this->mode = $mode;
$this->l10n = $l10n;
$this->baseURL = $baseURL;
$this->pConfig = $pConfig;
$this->session = $session;
}
/**
* Set the profile owner ID
*/
public function setProfileOwner(int $owner_id): void
{
$this->profile_owner = $owner_id;
}
/**
* Get the profile owner ID
*/
public function getProfileOwner(): int
{
return $this->profile_owner;
}
/**
* Set the timezone
*
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
*/
public function setTimeZone(string $timezone): void
{
$this->timezone = (new DateTimeZone($timezone))->getName();
DateTimeFormat::setLocalTimeZone($this->timezone);
}
/**
* Get the timezone name
*/
public function getTimeZone(): string
{
return $this->timezone;
}
/**
* Set the contact ID
*/
public function setContactId(int $contact_id): void
{
$this->contact_id = $contact_id;
}
/**
* Get the contact ID
*/
public function getContactId(): int
{
return $this->contact_id;
}
/**
* Set workerqueue information
*
* @param array<string,mixed> $queue
*/
public function setQueue(array $queue): void
{
$this->queue = $queue;
}
/**
* Fetch workerqueue information
*
* @return array<string,mixed> Worker queue
*/
public function getQueue(): array
{
return $this->queue;
}
/**
* Fetch a specific workerqueue field
*
* @param string $index Work queue record to fetch
*
* @return mixed|null Work queue item or NULL if not found
*/
public function getQueueValue(string $index)
{
return $this->queue[$index] ?? null;
}
/**
* Returns the current theme name. May be overridden by the mobile theme name.
*
* @return string Current theme name or empty string in installation phase
* @throws Exception
*/
public function getCurrentTheme(): string
{
if ($this->mode->isInstall()) {
return '';
}
// Specific mobile theme override
if (($this->mode->isMobile() || $this->mode->isTablet()) && $this->session->get('show-mobile', true)) {
$user_mobile_theme = $this->getCurrentMobileTheme();
// --- means same mobile theme as desktop
if (!empty($user_mobile_theme) && $user_mobile_theme !== '---') {
return $user_mobile_theme;
}
}
if (!$this->currentTheme) {
$this->computeCurrentTheme();
}
return $this->currentTheme;
}
/**
* Returns the current mobile theme name.
*
* @return string Mobile theme name or empty string if installer
* @throws Exception
*/
public function getCurrentMobileTheme(): string
{
if ($this->mode->isInstall()) {
return '';
}
if (is_null($this->currentMobileTheme)) {
$this->computeCurrentMobileTheme();
}
return $this->currentMobileTheme;
}
/**
* Setter for current theme name
*
* @param string $theme Name of current theme
*/
public function setCurrentTheme(string $theme): void
{
$this->currentTheme = $theme;
}
/**
* Setter for current mobile theme name
*
* @param string $theme Name of current mobile theme
*/
public function setCurrentMobileTheme(string $theme): void
{
$this->currentMobileTheme = $theme;
}
public function setThemeInfoValue(string $index, $value): void
{
$this->theme_info[$index] = $value;
}
public function getThemeInfo(): array
{
return $this->theme_info;
}
public function getThemeInfoValue(string $index, $default = null)
{
return $this->theme_info[$index] ?? $default;
}
/**
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @return string Current theme's stylesheet path
* @throws Exception
*/
public function getCurrentThemeStylesheetPath(): string
{
return Theme::getStylesheetPath($this->getCurrentTheme());
}
/**
* Returns the current config cache of this node
*/
public function getConfigCache(): Cache
{
return $this->config->getCache();
}
/**
* The basepath of this app
*
* @return string Base path from configuration
*/
public function getBasePath(): string
{
return $this->config->get('system', 'basepath');
}
/**
* Computes the current theme name based on the node settings, the page owner settings and the user settings
*
* @throws Exception
*/
private function computeCurrentTheme()
{
$system_theme = $this->config->get('system', 'theme');
if (!$system_theme) {
throw new Exception($this->l10n->t('No system theme config value set.'));
}
// Sane default
$this->setCurrentTheme($system_theme);
$page_theme = null;
$profile_owner = $this->getProfileOwner();
// Find the theme that belongs to the user whose stuff we are looking at
if (!empty($profile_owner) && ($profile_owner != $this->session->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $profile_owner]);
if ($this->database->isResult($user) && !$this->session->getLocalUserId()) {
$page_theme = $user['theme'];
}
}
$theme_name = $page_theme ?: $this->session->get('theme', $system_theme);
$theme_name = Strings::sanitizeFilePathItem($theme_name);
if ($theme_name
&& in_array($theme_name, Theme::getAllowedList())
&& (file_exists('view/theme/' . $theme_name . '/style.css')
|| file_exists('view/theme/' . $theme_name . '/style.php'))
) {
$this->setCurrentTheme($theme_name);
}
}
/**
* Computes the current mobile theme name based on the node settings, the page owner settings and the user settings
*/
private function computeCurrentMobileTheme()
{
$system_mobile_theme = $this->config->get('system', 'mobile-theme', '');
// Sane default
$this->setCurrentMobileTheme($system_mobile_theme);
$page_mobile_theme = null;
$profile_owner = $this->getProfileOwner();
// Find the theme that belongs to the user whose stuff we are looking at
if (!empty($profile_owner) && ($profile_owner != $this->session->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
if (!$this->session->getLocalUserId()) {
$page_mobile_theme = $this->pConfig->get($profile_owner, 'system', 'mobile-theme');
}
}
$mobile_theme_name = $page_mobile_theme ?: $this->session->get('mobile-theme', $system_mobile_theme);
$mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name);
if ($mobile_theme_name == '---'
||
in_array($mobile_theme_name, Theme::getAllowedList())
&& (file_exists('view/theme/' . $mobile_theme_name . '/style.css')
|| file_exists('view/theme/' . $mobile_theme_name . '/style.php'))
) {
$this->setCurrentMobileTheme($mobile_theme_name);
}
}
/**
* Automatically redirects to relative or absolute URL
* Should only be used if it isn't clear if the URL is either internal or external
*
* @param string $toUrl The target URL
*
* @throws InternalServerErrorException
*/
public function redirect(string $toUrl)
{
if (!empty(parse_url($toUrl, PHP_URL_SCHEME))) {
System::externalRedirect($toUrl);
} else {
$this->baseURL->redirect($toUrl);
}
}
}

View file

@ -24,7 +24,7 @@ class BaseCollection extends \ArrayIterator
* @param BaseEntity[] $entities
* @param int|null $totalCount
*/
public function __construct(array $entities = [], int $totalCount = null)
public function __construct(array $entities = [], ?int $totalCount = null)
{
parent::__construct($entities);
@ -89,7 +89,9 @@ class BaseCollection extends \ArrayIterator
*/
public function map(callable $callback): BaseCollection
{
return new static(array_map($callback, $this->getArrayCopy()), $this->getTotalCount());
$class = get_class($this);
return new $class(array_map($callback, $this->getArrayCopy()), $this->getTotalCount());
}
/**
@ -100,26 +102,27 @@ class BaseCollection extends \ArrayIterator
* @return BaseCollection
* @see array_filter()
*/
public function filter(callable $callback = null, int $flag = 0): BaseCollection
public function filter(?callable $callback = null, int $flag = 0): BaseCollection
{
return new static(array_filter($this->getArrayCopy(), $callback, $flag));
$class = get_class($this);
return new $class(array_filter($this->getArrayCopy(), $callback, $flag));
}
/**
* Reverse the orders of the elements in the collection
*
* @return $this
*/
public function reverse(): BaseCollection
{
return new static(array_reverse($this->getArrayCopy()), $this->getTotalCount());
$class = get_class($this);
return new $class(array_reverse($this->getArrayCopy()), $this->getTotalCount());
}
/**
* Split the collection in smaller collections no bigger than the provided length
*
* @param int $length
* @return static[]
*/
public function chunk(int $length): array
{
@ -127,9 +130,14 @@ class BaseCollection extends \ArrayIterator
throw new \RangeException('BaseCollection->chunk(): Size parameter expected to be greater than 0');
}
return array_map(function ($array) {
return new static($array);
}, array_chunk($this->getArrayCopy(), $length));
return array_map(
function ($array) {
$class = get_class($this);
return new $class($array);
},
array_chunk($this->getArrayCopy(), $length)
);
}

View file

@ -7,7 +7,7 @@
namespace Friendica;
use Friendica\Network\HTTPException;
use Friendica\Network\HTTPException\InternalServerErrorException;
/**
* The Entity classes directly inheriting from this abstract class are meant to represent a single business entity.
@ -29,12 +29,12 @@ abstract class BaseEntity extends BaseDataTransferObject
/**
* @param string $name
* @return mixed
* @throws HTTPException\InternalServerErrorException
* @throws InternalServerErrorException
*/
public function __get(string $name)
{
if (!property_exists($this, $name)) {
throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' in Entity ' . static::class);
throw new InternalServerErrorException('Unknown property ' . $name . ' in Entity ' . static::class);
}
return $this->$name;
@ -43,12 +43,12 @@ abstract class BaseEntity extends BaseDataTransferObject
/**
* @param mixed $name
* @return bool
* @throws HTTPException\InternalServerErrorException
* @throws InternalServerErrorException
*/
public function __isset($name): bool
{
if (!property_exists($this, $name)) {
throw new HTTPException\InternalServerErrorException('Unknown property ' . $name . ' of type ' . gettype($name) . ' in Entity ' . static::class);
throw new InternalServerErrorException('Unknown property ' . $name . ' of type ' . gettype($name) . ' in Entity ' . static::class);
}
return !empty($this->$name);

View file

@ -15,7 +15,7 @@ use Psr\Log\LoggerInterface;
* The Model classes inheriting from this abstract class are meant to represent a single database record.
* The associated table name has to be provided in the child class, and the table is expected to have a unique `id` field.
*
* @property int id
* @property int $id
*/
abstract class BaseModel extends BaseDataTransferObject
{
@ -41,8 +41,6 @@ abstract class BaseModel extends BaseDataTransferObject
private $originalData = [];
/**
* @param Database $dba
* @param LoggerInterface $logger
* @param array $data Table row attributes
*/
public function __construct(Database $dba, LoggerInterface $logger, array $data = [])

View file

@ -12,7 +12,6 @@ use Friendica\Capabilities\ICanHandleRequests;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Model\User;
use Friendica\Module\Response;
@ -164,6 +163,19 @@ abstract class BaseModule implements ICanHandleRequests
{
}
/**
* Module GET method to process submitted data
*
* Extend this method if the module is supposed to process GET requests.
* Doesn't display any content
*
* @param string[] $request The $_REQUEST content
* @return void
*/
protected function get(array $request = [])
{
}
/**
* {@inheritDoc}
*/
@ -210,17 +222,20 @@ abstract class BaseModule implements ICanHandleRequests
switch ($this->args->getMethod()) {
case Router::DELETE:
$this->delete($request);
return $this->response->generate();
break;
case Router::PATCH:
$this->patch($request);
return $this->response->generate();
break;
case Router::POST:
Core\Hook::callAll($this->args->getModuleName() . '_mod_post', $request);
$this->post($request);
return $this->response->generate();
break;
case Router::PUT:
$this->put($request);
return $this->response->generate();
break;
case Router::GET:
$this->get($request);
break;
}
$timestamp = microtime(true);
@ -245,10 +260,10 @@ abstract class BaseModule implements ICanHandleRequests
$this->response->setStatus($e->getCode(), $e->getMessage());
$this->response->addContent($httpException->content($e));
} finally {
$this->profiler->set(microtime(true) - $timestamp, 'content');
}
$this->profiler->set(microtime(true) - $timestamp, 'content');
return $this->response->generate();
}
@ -269,7 +284,7 @@ abstract class BaseModule implements ICanHandleRequests
$request[$parameter] = $this->getRequestValue($input, $parameter, $defaultvalue);
}
foreach ($input ?? [] as $parameter => $value) {
foreach ($input as $parameter => $value) {
if ($parameter == 'pagename') {
continue;
}
@ -396,8 +411,8 @@ abstract class BaseModule implements ICanHandleRequests
public static function checkFormSecurityTokenRedirectOnError(string $err_redirect, string $typename = '', string $formname = 'form_security_token')
{
if (!self::checkFormSecurityToken($typename, $formname)) {
Logger::notice('checkFormSecurityToken failed: user ' . DI::userSession()->getLocalUserNickname() . ' - form element ' . $typename);
Logger::debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
DI::logger()->notice('checkFormSecurityToken failed: user ' . DI::userSession()->getLocalUserNickname() . ' - form element ' . $typename);
DI::logger()->debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
DI::sysmsg()->addNotice(self::getFormSecurityStandardErrorMessage());
DI::baseUrl()->redirect($err_redirect);
}
@ -406,8 +421,8 @@ abstract class BaseModule implements ICanHandleRequests
public static function checkFormSecurityTokenForbiddenOnError(string $typename = '', string $formname = 'form_security_token')
{
if (!self::checkFormSecurityToken($typename, $formname)) {
Logger::notice('checkFormSecurityToken failed: user ' . DI::userSession()->getLocalUserNickname() . ' - form element ' . $typename);
Logger::debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
DI::logger()->notice('checkFormSecurityToken failed: user ' . DI::userSession()->getLocalUserNickname() . ' - form element ' . $typename);
DI::logger()->debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
@ -456,7 +471,7 @@ abstract class BaseModule implements ICanHandleRequests
* @param string $content
* @param string $type
* @param string|null $content_type
* @return void
* @return never
* @throws HTTPException\InternalServerErrorException
*/
public function httpExit(string $content, string $type = Response::TYPE_HTML, ?string $content_type = null)
@ -493,11 +508,11 @@ abstract class BaseModule implements ICanHandleRequests
* @param mixed $content
* @param string $content_type
* @param int $options A combination of json_encode() binary flags
* @return void
* @return never
* @throws HTTPException\InternalServerErrorException
* @see json_encode()
*/
public function jsonExit($content, string $content_type = 'application/json', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
public function jsonExit($content, string $content_type = 'application/json; charset=utf-8', int $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)
{
$this->httpExit(json_encode($content, $options), ICanCreateResponses::TYPE_JSON, $content_type);
}
@ -508,7 +523,7 @@ abstract class BaseModule implements ICanHandleRequests
* @param int $httpCode
* @param mixed $content
* @param string $content_type
* @return void
* @return never
* @throws HTTPException\InternalServerErrorException
*/
public function jsonError(int $httpCode, $content, string $content_type = 'application/json')

View file

@ -130,17 +130,33 @@ abstract class BaseRepository
}
/**
* @param array $condition
* @param array $params
* @return BaseEntity
* Selects the fields of the first row as array
*
* @throws NotFoundException
*
* @return array The resulted fields as array
*/
final protected function _selectFirstRowAsArray(array $condition, array $params = []): array
{
$fields = $this->db->selectFirst(static::$table_name, [], $condition, $params);
if (!$this->db->isResult($fields)) {
throw new NotFoundException();
}
return $fields;
}
/**
* @deprecated 2025.05 Use `\Friendica\BaseRepository::_selectFirstRowAsArray()` instead
*
* @throws NotFoundException
*/
protected function _selectOne(array $condition, array $params = []): BaseEntity
{
$fields = $this->db->selectFirst(static::$table_name, [], $condition, $params);
if (!$this->db->isResult($fields)) {
throw new NotFoundException();
}
@trigger_error('`' . __METHOD__ . '()` is deprecated since 2025.05 and will be removed after 5 months, use `\Friendica\BaseRepository::_selectFirstRowAsArray()` instead.', E_USER_DEPRECATED);
$fields = $this->_selectFirstRowAsArray( $condition, $params);
return $this->factory->createFromTableRow($fields);
}

View file

@ -7,8 +7,8 @@
namespace Friendica\Collection\Api\Mastodon;
use Friendica\Api\Entity\Mastodon\Field;
use Friendica\BaseCollection;
use Friendica\Object\Api\Mastodon\Field;
class Fields extends BaseCollection
{

View file

@ -8,10 +8,9 @@
namespace Friendica\Console;
use Console_Table;
use Friendica\App;
use Friendica\Content\Pager;
use Friendica\App\Mode;
use Friendica\Core\L10n;
use Friendica\Core\Addon as AddonCore;
use Friendica\Core\Addon\AddonHelper;
use Friendica\Database\Database;
use Friendica\Util\Strings;
use RuntimeException;
@ -24,7 +23,7 @@ class Addon extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -35,6 +34,7 @@ class Addon extends \Asika\SimpleConsole\Console
* @var Database
*/
private $dba;
private AddonHelper $addonHelper;
protected function getHelp()
{
@ -57,15 +57,16 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, L10n $l10n, Database $dba, array $argv = null)
public function __construct(Mode $appMode, L10n $l10n, Database $dba, AddonHelper $addonHelper, array $argv = null)
{
parent::__construct($argv);
$this->appMode = $appMode;
$this->l10n = $l10n;
$this->dba = $dba;
$this->addonHelper = $addonHelper;
AddonCore::loadAddons();
$this->addonHelper->loadAddons();
}
protected function doExecute(): int
@ -122,28 +123,30 @@ HELP;
$this->out($this->getHelp());
return false;
}
foreach (AddonCore::getAvailableList() as $addon) {
$addon_name = $addon[0];
$enabled = AddonCore::isEnabled($addon_name) ? "enabled" : "disabled";
switch ($subCmd) {
case 'all':
$table->addRow([$addon_name, $enabled]);
break;
case 'enabled':
if (!$enabled) {
continue 2;
}
$table->addRow([$addon_name]);
case 'disabled':
if ($enabled) {
continue 2;
}
$table->addRow([$addon_name]);
break;
foreach ($this->addonHelper->getAvailableAddons() as $addonId) {
$enabled = $this->addonHelper->isAddonEnabled($addonId);
if ($subCmd === 'all') {
$table->addRow([$addonId, $enabled ? 'enabled' : 'disabled']);
continue;
}
if ($subCmd === 'enabled' && $enabled === true) {
$table->addRow([$addonId]);
continue;
}
if ($subCmd === 'disabled' && $enabled === false) {
$table->addRow([$addonId]);
continue;
}
}
$this->out($table->getTable());
return 0;
}
/**
@ -161,11 +164,11 @@ HELP;
throw new RuntimeException($this->l10n->t('Addon not found'));
}
if (AddonCore::isEnabled($addon)) {
if ($this->addonHelper->isAddonEnabled($addon)) {
throw new RuntimeException($this->l10n->t('Addon already enabled'));
}
AddonCore::install($addon);
$this->addonHelper->installAddon($addon);
return 0;
}
@ -185,11 +188,11 @@ HELP;
throw new RuntimeException($this->l10n->t('Addon not found'));
}
if (!AddonCore::isEnabled($addon)) {
if (!$this->addonHelper->isAddonEnabled($addon)) {
throw new RuntimeException($this->l10n->t('Addon already disabled'));
}
AddonCore::uninstall($addon);
$this->addonHelper->uninstallAddon($addon);
return 0;
}

View file

@ -7,7 +7,7 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Model\Contact;
@ -28,7 +28,7 @@ class ArchiveContact extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -57,7 +57,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null)
public function __construct(Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null)
{
parent::__construct($argv);

View file

@ -8,8 +8,8 @@
namespace Friendica\Console;
use Asika\SimpleConsole\Console;
use Friendica\App;
use Friendica\App\BaseURL;
use Exception;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Installer;
@ -20,7 +20,7 @@ use RuntimeException;
class AutomaticInstallation extends Console
{
/** @var App\Mode */
/** @var Mode */
private $appMode;
/** @var \Friendica\Core\Config\ValueObject\Cache */
private $configCache;
@ -86,7 +86,7 @@ Examples
HELP;
}
public function __construct(App\Mode $appMode, Cache $configCache, IManageConfigValues $config, Database $dba, array $argv = null)
public function __construct(Mode $appMode, Cache $configCache, IManageConfigValues $config, Database $dba, array $argv = null)
{
parent::__construct($argv);

View file

@ -8,7 +8,7 @@
namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Cache\Capability\ICanCache;
use RuntimeException;
@ -25,7 +25,7 @@ class Cache extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
@ -68,7 +68,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, ICanCache $cache, array $argv = null)
public function __construct(Mode $appMode, ICanCache $cache, array $argv = null)
{
parent::__construct($argv);
@ -85,7 +85,7 @@ HELP;
$this->out('Options: ' . var_export($this->options, true));
}
if (!$this->appMode->has(App\Mode::DBAVAILABLE)) {
if (!$this->appMode->has(Mode::DBAVAILABLE)) {
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
}

View file

@ -10,6 +10,7 @@ namespace Friendica\Console;
use Friendica\App\BaseURL;
use Friendica\Contact\Avatar;
use Friendica\Core\L10n;
use Friendica\Database\Database;
use Friendica\Model\Contact;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -21,12 +22,12 @@ class ClearAvatarCache extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var $dba Friendica\Database\Database
* @var Database
*/
private $dba;
/**
* @var $baseurl Friendica\App\BaseURL
* @var BaseURL
*/
private $baseUrl;

View file

@ -8,7 +8,7 @@
namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
use RuntimeException;
@ -38,7 +38,7 @@ class Config extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -80,7 +80,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, IManageConfigValues $config, array $argv = null)
public function __construct(Mode $appMode, IManageConfigValues $config, array $argv = null)
{
parent::__construct($argv);

View file

@ -8,7 +8,8 @@
namespace Friendica\Console;
use Console_Table;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\DI;
use Friendica\Model\Contact as ContactModel;
use Friendica\Model\User as UserModel;
@ -25,11 +26,11 @@ class Contact extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
* @var IPConfig
* @var IManagePersonalConfigValues
*/
private $pConfig;
@ -55,7 +56,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, array $argv = null)
public function __construct(Mode $appMode, ?array $argv = null)
{
parent::__construct($argv);
@ -83,13 +84,13 @@ HELP;
switch ($command) {
case 'add':
return $this->addContact();
return ($this->addContact()) ? 0 : 1;
case 'remove':
return $this->removeContact();
return ($this->removeContact()) ? 0 : 1;
case 'search':
return $this->searchContact();
return ($this->searchContact()) ? 0 : 1;
case 'terminate':
return $this->terminateContact();
return ($this->terminateContact()) ? 0 : 1;
default:
throw new \Asika\SimpleConsole\CommandArgsException('Wrong command.');
}
@ -158,9 +159,10 @@ HELP;
if ($result['success']) {
$this->out('User ' . $user['nickname'] . ' now connected to ' . $url . ', contact ID ' . $result['cid']);
} else {
throw new RuntimeException($result['message']);
return true;
}
throw new RuntimeException($result['message']);
}
/**
@ -204,7 +206,7 @@ HELP;
/**
* Marks a contact for removal
*/
private function removeContact()
private function removeContact(): bool
{
$cid = $this->getArgument(1);
if (empty($cid)) {
@ -216,6 +218,8 @@ HELP;
}
ContactModel::remove($cid);
return true;
}
/**

224
src/Console/Daemon.php Normal file
View file

@ -0,0 +1,224 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
declare(strict_types=1);
namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException;
use Asika\SimpleConsole\Console;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Core\System;
use Friendica\Core\Update;
use Friendica\Core\Worker;
use Friendica\Database\Database;
use Friendica\System\Daemon as SysDaemon;
use Friendica\Util\BasePath;
use Friendica\Util\DateTimeFormat;
use Psr\Log\LoggerInterface;
use RuntimeException;
/**
* Console command for interacting with the daemon
*/
final class Daemon extends Console
{
private Mode $mode;
private IManageConfigValues $config;
private IManageKeyValuePairs $keyValue;
private BasePath $basePath;
private System $system;
private LoggerInterface $logger;
private Database $dba;
private SysDaemon $daemon;
/**
* @param Mode $mode
* @param IManageConfigValues $config
* @param IManageKeyValuePairs $keyValue
* @param BasePath $basePath
* @param System $system
* @param LoggerInterface $logger
* @param Database $dba
* @param SysDaemon $daemon
* @param array|null $argv
*/
public function __construct(Mode $mode, IManageConfigValues $config, IManageKeyValuePairs $keyValue, BasePath $basePath, System $system, LoggerInterface $logger, Database $dba, SysDaemon $daemon, array $argv = null)
{
parent::__construct($argv);
$this->mode = $mode;
$this->config = $config;
$this->keyValue = $keyValue;
$this->basePath = $basePath;
$this->system = $system;
$this->logger = $logger;
$this->dba = $dba;
$this->daemon = $daemon;
}
protected function getHelp(): string
{
return <<<HELP
Daemon - Interact with the Friendica daemon
Synopsis
bin/console daemon start [-h|--help|-?] [-v] [-f]
bin/console daemon stop [-h|--help|-?] [-v]
bin/console daemon status [-h|--help|-?] [-v]
Description
Interact with the Friendica daemon
Options
-h|--help|-? Show help information
-v Show more debug information.
-f|--foreground Runs the daemon in the foreground
Examples
bin/console daemon start -f
Starts the daemon in the foreground
bin/console daemon status
Gets the status of the daemon
HELP;
}
protected function doExecute()
{
if ($this->mode->isInstall()) {
throw new RuntimeException("Friendica isn't properly installed yet");
}
$this->mode->setExecutor(Mode::DAEMON);
$this->config->reload();
if (empty($this->config->get('system', 'pidfile'))) {
throw new RuntimeException(
<<< TXT
Please set system.pidfile in config/local.config.php. For example:
'system' => [
'pidfile' => '/path/to/daemon.pid',
],
TXT
);
}
$pidfile = $this->config->get('system', 'pidfile');
$daemonMode = $this->getArgument(0);
$foreground = $this->getOption(['f', 'foreground']) ?? false;
if (empty($daemonMode)) {
throw new CommandArgsException("Please use either 'start', 'stop' or 'status'");
}
$this->daemon->init($pidfile);
if ($daemonMode == 'status') {
if ($this->daemon->isRunning()) {
$this->out(sprintf("Daemon process %s is running (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
} else {
$this->out(sprintf("Daemon process %s isn't running (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
}
return 0;
}
if ($daemonMode == 'stop') {
if (!$this->daemon->isRunning()) {
$this->out(sprintf("Daemon process %s isn't running (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
return 0;
}
if ($this->daemon->stop()) {
$this->keyValue->set('worker_daemon_mode', false);
$this->out(sprintf("Daemon process %s was killed (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
return 0;
}
return 1;
}
if ($this->daemon->isRunning()) {
$this->out(sprintf("Daemon process %s is already running (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
return 1;
}
if ($daemonMode == "start") {
$this->out("Starting Friendica daemon");
$this->daemon->start(function () {
$wait_interval = intval($this->config->get('system', 'cron_interval', 5)) * 60;
$do_cron = true;
$last_cron = 0;
$path = $this->basePath->getPath();
// Now running as a daemon.
while (true) {
// Check the database structure and possibly fixes it
Update::check($path, true);
if (!$do_cron && ($last_cron + $wait_interval) < time()) {
$this->logger->info('Forcing cron worker call.', ['pid' => $this->daemon->getPid()]);
$do_cron = true;
}
if ($do_cron || (!$this->system->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
Worker::spawnWorker($do_cron);
} else {
$this->logger->info('Cool down for 5 seconds', ['pid' => $this->daemon->getPid()]);
sleep(5);
}
if ($do_cron) {
// We force a reconnect of the database connection.
// This is done to ensure that the connection don't get lost over time.
$this->dba->reconnect();
$last_cron = time();
}
$start = time();
$this->logger->info('Sleeping', ['pid' => $this->daemon->getPid(), 'until' => gmdate(DateTimeFormat::MYSQL, $start + $wait_interval)]);
do {
$seconds = (time() - $start);
// logarithmic wait time calculation.
// Background: After jobs had been started, they often fork many workers.
// To not waste too much time, the sleep period increases.
$arg = (($seconds + 1) / ($wait_interval / 9)) + 1;
$sleep = min(1000000, round(log10($arg) * 1000000, 0));
$this->daemon->sleep((int)$sleep);
$timeout = ($seconds >= $wait_interval);
} while (!$timeout && !Worker\IPC::JobsExists());
if ($timeout) {
$do_cron = true;
$this->logger->info('Woke up after $wait_interval seconds.', ['pid' => $this->daemon->getPid(), 'sleep' => $wait_interval]);
} else {
$do_cron = false;
$this->logger->info('Worker jobs are calling to be forked.', ['pid' => $this->daemon->getPid()]);
}
}
}, $foreground);
return 0;
}
$this->err('Invalid command');
$this->out($this->getHelp());
return 1;
}
}

View file

@ -7,7 +7,7 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\AppHelper;
/**
* When I installed docblox, I had the experience that it does not generate any output at all.
@ -33,14 +33,14 @@ class DocBloxErrorChecker extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/** @var App */
private $app;
/** @var string */
private $basePath;
public function __construct(App $app, array $argv = null)
public function __construct(AppHelper $appHelper, array $argv = null)
{
parent::__construct($argv);
$this->app = $app;
$this->basePath = $appHelper->getBasePath();
}
protected function getHelp()
@ -73,7 +73,7 @@ HELP;
throw new \RuntimeException('DocBlox isn\'t available.');
}
$dir = $this->app->getBasePath();
$dir = $this->basePath;
//stack for dirs to search
$dirstack = [];

View file

@ -7,12 +7,11 @@
namespace Friendica\Console;
use Friendica\App;
use Asika\SimpleConsole\CommandArgsException;
use Friendica\App\Mode;
use Friendica\Core\L10n;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Util\Strings;
use RuntimeException;
/**
@ -23,13 +22,17 @@ class FixAPDeliveryWorkerTaskParameters extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
* @var Database
*/
private $dba;
/**
* @var L10n
*/
private $l10n;
/**
* @var int
*/
@ -62,7 +65,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null)
public function __construct(Mode $appMode, Database $dba, L10n $l10n, array $argv = null)
{
parent::__construct($argv);
@ -80,7 +83,7 @@ HELP;
}
if (count($this->args) > 0) {
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
throw new CommandArgsException('Too many arguments');
}
if ($this->appMode->isInstall()) {

View file

@ -7,7 +7,7 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\L10n;
use Friendica\Model\Contact;
@ -22,7 +22,7 @@ class GlobalCommunityBlock extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -48,7 +48,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, L10n $l10n, $argv = null)
public function __construct(Mode $appMode, L10n $l10n, $argv = null)
{
parent::__construct($argv);

View file

@ -0,0 +1,161 @@
<?php
// Copyright (C) 2010-2025, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
declare(strict_types=1);
namespace Friendica\Console;
use Asika\SimpleConsole\Console;
use Friendica\App\Mode;
use Friendica\Core\Addon\AddonHelper;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Protocol\ATProtocol\Jetstream;
use Friendica\System\Daemon as SysDaemon;
use RuntimeException;
/**
* Console command for interacting with the daemon
*/
final class JetstreamDaemon extends Console
{
private Mode $mode;
private IManageConfigValues $config;
private IManageKeyValuePairs $keyValue;
private SysDaemon $daemon;
private Jetstream $jetstream;
private AddonHelper $addonHelper;
/**
* @param Mode $mode
* @param IManageConfigValues $config
* @param IManageKeyValuePairs $keyValue
* @param SysDaemon $daemon
* @param Jetstream $jetstream
* @param array|null $argv
*/
public function __construct(Mode $mode, IManageConfigValues $config, IManageKeyValuePairs $keyValue, SysDaemon $daemon, Jetstream $jetstream, AddonHelper $addonHelper, array $argv = null)
{
parent::__construct($argv);
$this->mode = $mode;
$this->config = $config;
$this->keyValue = $keyValue;
$this->jetstream = $jetstream;
$this->daemon = $daemon;
$this->addonHelper = $addonHelper;
}
protected function getHelp(): string
{
return <<<HELP
jetstream - Interact with the Jetstream daemon
Synopsis
bin/console jetstream start [-h|--help|-?] [-v] [-f]
bin/console jetstream stop [-h|--help|-?] [-v]
bin/console jetstream status [-h|--help|-?] [-v]
Description
Interact with the Jetstream daemon
Options
-h|--help|-? Show help information
-v Show more debug information.
-f|--foreground Runs the daemon in the foreground
Examples
bin/console jetstream start -f
Starts the daemon in the foreground
bin/console jetstream status
Gets the status of the daemon
HELP;
}
protected function doExecute()
{
if ($this->mode->isInstall()) {
throw new RuntimeException("Friendica isn't properly installed yet");
}
$this->config->reload();
if (empty($this->config->get('jetstream', 'pidfile'))) {
throw new RuntimeException(
<<< TXT
Please set jetstream.pidfile in config/local.config.php. For example:
'jetstream' => [
'pidfile' => '/path/to/jetstream.pid',
],
TXT
);
}
$this->addonHelper->loadAddons();
Hook::loadHooks();
if (!$this->addonHelper->isAddonEnabled('bluesky')) {
throw new RuntimeException("Bluesky has to be enabled.\n");
}
$pidfile = $this->config->get('jetstream', 'pidfile');
$daemonMode = $this->getArgument(0);
$foreground = $this->getOption(['f', 'foreground']) ?? false;
if (empty($daemonMode)) {
throw new RuntimeException("Please use either 'start', 'stop' or 'status'");
}
$this->daemon->init($pidfile);
if ($daemonMode == 'status') {
if ($this->daemon->isRunning()) {
$this->out(sprintf("Daemon process %s is running (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
} else {
$this->out(sprintf("Daemon process %s isn't running (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
}
return 0;
}
if ($daemonMode == 'stop') {
if (!$this->daemon->isRunning()) {
$this->out(sprintf("Daemon process %s isn't running (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
return 0;
}
if ($this->daemon->stop()) {
$this->keyValue->set('worker_daemon_mode', false);
$this->out(sprintf("Daemon process %s was killed (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
return 0;
}
return 1;
}
if ($this->daemon->isRunning()) {
$this->out(sprintf("Daemon process %s is already running (%s)", $this->daemon->getPid(), $this->daemon->getPidfile()));
return 1;
}
if ($daemonMode == "start") {
$this->out("Starting Jetstream daemon");
$this->daemon->start(function () {
$this->jetstream->listen();
}, $foreground);
return 0;
}
$this->err('Invalid command');
$this->out($this->getHelp());
return 1;
}
}

View file

@ -8,7 +8,7 @@
namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Lock\Capability\ICanLock;
use RuntimeException;
@ -23,7 +23,7 @@ class Lock extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
@ -62,7 +62,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, ICanLock $lock, array $argv = null)
public function __construct(Mode $appMode, ICanLock $lock, array $argv = null)
{
parent::__construct($argv);
@ -79,7 +79,7 @@ HELP;
$this->out('Options: ' . var_export($this->options, true));
}
if (!$this->appMode->has(App\Mode::DBAVAILABLE)) {
if (!$this->appMode->has(Mode::DBAVAILABLE)) {
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
}

View file

@ -7,7 +7,7 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
/**
@ -18,7 +18,7 @@ class Maintenance extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -55,7 +55,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, IManageConfigValues $config, $argv = null)
public function __construct(Mode $appMode, IManageConfigValues $config, $argv = null)
{
parent::__construct($argv);

View file

@ -19,7 +19,7 @@ class MergeContacts extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var $dba Database
* @var Database
*/
private $dba;

View file

@ -9,13 +9,13 @@ namespace Friendica\Console;
use Friendica\App\BaseURL;
use Friendica\Contact\Avatar;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Database\Database;
use Friendica\Model\Contact;
use Friendica\Model\Photo;
use Friendica\Util\Images;
use Friendica\Object\Image;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Protocol;
/**
* tool to move cached avatars to the avatar file cache.
@ -25,12 +25,12 @@ class MoveToAvatarCache extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var $dba Friendica\Database\Database
* @var Database
*/
private $dba;
/**
* @var $baseurl Friendica\App\BaseURL
* @var BaseURL
*/
private $baseUrl;
@ -115,6 +115,10 @@ HELP;
private function storeAvatar(string $resourceid, array $contact, bool $quit_on_invalid)
{
$photo = false;
$imgdata = false;
$image = null;
$valid = !empty($resourceid);
if ($valid) {
$this->out('1', false);
@ -143,7 +147,7 @@ HELP;
}
}
if ($valid) {
if ($valid && $image instanceof Image) {
$this->out('4', false);
$fields = Avatar::storeAvatarByImage($contact, $image);
} else {

View file

@ -7,7 +7,8 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\AppHelper;
use stdClass;
/**
* Read a strings.php file and create messages.po in the same directory
@ -20,14 +21,14 @@ class PhpToPo extends \Asika\SimpleConsole\Console
private $normBaseMsgIds = [];
const NORM_REGEXP = "|[\\\]|";
/** @var App */
private $app;
/** @var AppHelper */
private $appHelper;
public function __construct(App $app, array $argv = null)
public function __construct(AppHelper $appHelper, array $argv = null)
{
parent::__construct($argv);
$this->app = $app;
$this->appHelper = $appHelper;
}
protected function getHelp()
@ -66,7 +67,8 @@ HELP;
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
}
$a = $this->app;
$a = new stdClass();
$a->strings = [];
$phpfile = realpath($this->getArgument(0));

View file

@ -175,11 +175,11 @@ HELP;
* @param string $string
* @param array|string $node
*/
private static function parse(string $string, &$node = [])
private static function parse(string $string, &$node)
{
// Removes extra outward parentheses
if (strpos($string, '(') === 0 && strrpos($string, ')') === strlen($string) - 1) {
$string = substr($string, 1, -1);
$string = (string) substr($string, 1, -1);
}
$q = strpos($string, '?');

View file

@ -7,10 +7,11 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Core\L10n;
use Friendica\Core\Update;
use Friendica\DI;
/**
* Performs database post updates
@ -20,7 +21,7 @@ class PostUpdate extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -31,6 +32,10 @@ class PostUpdate extends \Asika\SimpleConsole\Console
* @var L10n
*/
private $l10n;
/**
* @var string
*/
private $basePath;
protected function getHelp()
{
@ -46,19 +51,18 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, IManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null)
public function __construct(Mode $appMode, IManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null)
{
parent::__construct($argv);
$this->appMode = $appMode;
$this->keyValue = $keyValue;
$this->l10n = $l10n;
$this->basePath = DI::appHelper()->getBasePath();
}
protected function doExecute(): int
{
$a = \Friendica\DI::app();
if ($this->getOption($this->helpOptions)) {
$this->out($this->getHelp());
return 0;
@ -79,7 +83,7 @@ HELP;
}
echo $this->l10n->t('Check for pending update actions.') . "\n";
Update::run($a->getBasePath(), true, false, true, false);
Update::run($this->basePath, true, false, true, false);
echo $this->l10n->t('Done.') . "\n";
echo $this->l10n->t('Execute pending post updates.') . "\n";

View file

@ -8,6 +8,7 @@
namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException;
use Friendica\Database\Database;
use Friendica\Model\APContact;
use Friendica\Protocol\ActivityPub\Transmitter;
use Friendica\Protocol\Relay as ProtocolRelay;
@ -23,7 +24,7 @@ class Relay extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var $dba Friendica\Database\Database
* @var Database
*/
private $dba;

View file

@ -192,5 +192,7 @@ HELP;
} while ($moved);
$this->out(sprintf(date('[Y-m-d H:i:s] ') . 'Moved %d files total', $total));
return 0;
}
}

View file

@ -8,7 +8,7 @@
namespace Friendica\Console;
use Console_Table;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Content\Pager;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
@ -26,7 +26,7 @@ class User extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -74,7 +74,7 @@ HELP;
return $help;
}
public function __construct(App\Mode $appMode, L10n $l10n, IManagePersonalConfigValues $pConfig, array $argv = null)
public function __construct(Mode $appMode, L10n $l10n, IManagePersonalConfigValues $pConfig, array $argv = null)
{
parent::__construct($argv);
@ -106,23 +106,23 @@ HELP;
case 'password':
return $this->password();
case 'add':
return $this->addUser();
return ($this->addUser()) ? 0 : 1;
case 'allow':
return $this->pendingUser(true);
return ($this->pendingUser(true)) ? 0 : 1;
case 'deny':
return $this->pendingUser(false);
return ($this->pendingUser(false)) ? 0 : 1;
case 'block':
return $this->blockUser(true);
return ($this->blockUser(true)) ? 0 : 1;
case 'unblock':
return $this->blockUser(false);
return ($this->blockUser(false)) ? 0 : 1;
case 'delete':
return $this->deleteUser();
return ($this->deleteUser()) ? 0 : 1;
case 'list':
return $this->listUser();
return ($this->listUser()) ? 0 : 1;
case 'search':
return $this->searchUser();
return ($this->searchUser()) ? 0 : 1;
case 'config':
return $this->configUser();
return ($this->configUser()) ? 0 : 1;
default:
throw new \Asika\SimpleConsole\CommandArgsException('Wrong command.');
}
@ -178,7 +178,7 @@ HELP;
*
* @throws \Exception
*/
private function password()
private function password(): int
{
$user = $this->getUserByNick(1);
@ -212,7 +212,7 @@ HELP;
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
private function addUser()
private function addUser(): bool
{
$name = $this->getArgument(1);
$nick = $this->getArgument(2);
@ -512,5 +512,7 @@ HELP;
$this->out($this->getHelp());
return false;
}
return true;
}
}

96
src/Console/Worker.php Normal file
View file

@ -0,0 +1,96 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
declare(strict_types=1);
namespace Friendica\Console;
use Asika\SimpleConsole\Console;
use Friendica\App\Mode;
use Friendica\Core\Update;
use Friendica\Core\Worker as CoreWorker;
use Friendica\Core\Worker\Repository\Process as ProcessRepository;
use Friendica\Util\BasePath;
/**
* Console command for starting worker
*/
final class Worker extends Console
{
private Mode $mode;
private BasePath $basePath;
private ProcessRepository $processRepo;
/**
* @param Mode $mode
* @param BasePath $basePath
* @param ProcessRepository $processRepo
* @param array|null $argv
*/
public function __construct(Mode $mode, BasePath $basePath, ProcessRepository $processRepo, array $argv = null)
{
parent::__construct($argv);
$this->mode = $mode;
$this->basePath = $basePath;
$this->processRepo = $processRepo;
}
protected function getHelp(): string
{
return <<<HELP
Worker - Start a worker
Synopsis
bin/console worker [-h|--help|-?] [-v] [-n|--no_cron] [-s|--spawn]
Description
Start a worker process
Options
-h|--help|-? Show help information
-v Show more debug information.
-n|--no_cron Don't executes the Cronjob
-s|--spawn Spawn an additional worker
Examples
bin/console worker -n
Starts the worker without executing other recurring tasks
bin/console worker -s
Starts the worker and immediately spawn another worker process
HELP;
}
protected function doExecute()
{
$this->mode->setExecutor(Mode::WORKER);
// Check the database structure and possibly fixes it
Update::check($this->basePath->getPath(), true);
// Quit when in maintenance
if (!$this->mode->has(Mode::MAINTENANCEDISABLED)) {
return;
}
$spawn = $this->getOption(['s', 'spawn'], false);
if ($spawn) {
CoreWorker::spawnWorker();
exit();
}
$run_cron = !$this->getOption(['n', 'no_cron'], false);
$process = $this->processRepo->create(getmypid(), 'worker.php');
CoreWorker::processQueue($run_cron, $process);
CoreWorker::unclaimProcess($process);
$this->processRepo->delete($process);
}
}

View file

@ -7,7 +7,6 @@
namespace Friendica\Contact;
use Friendica\Core\Logger;
use Friendica\DI;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
@ -47,36 +46,36 @@ class Avatar
if (($avatar != $contact['avatar']) || $force) {
self::deleteCache($contact);
Logger::debug('Avatar file name changed', ['new' => $avatar, 'old' => $contact['avatar']]);
DI::logger()->debug('Avatar file name changed', ['new' => $avatar, 'old' => $contact['avatar']]);
} elseif (self::isCacheFile($contact['photo']) && self::isCacheFile($contact['thumb']) && self::isCacheFile($contact['micro'])) {
$fields['photo'] = $contact['photo'];
$fields['thumb'] = $contact['thumb'];
$fields['micro'] = $contact['micro'];
Logger::debug('Using existing cache files', ['uri-id' => $contact['uri-id'], 'fields' => $fields]);
DI::logger()->debug('Using existing cache files', ['uri-id' => $contact['uri-id'], 'fields' => $fields]);
return $fields;
}
try {
$fetchResult = HTTPSignature::fetchRaw($avatar, 0, [HttpClientOptions::ACCEPT_CONTENT => [HttpClientAccept::IMAGE]]);
} catch (\Exception $exception) {
Logger::notice('Avatar is invalid', ['avatar' => $avatar, 'exception' => $exception]);
DI::logger()->notice('Avatar is invalid', ['avatar' => $avatar, 'exception' => $exception]);
return $fields;
}
if (!$fetchResult->isSuccess()) {
Logger::debug('Fetching was unsuccessful', ['avatar' => $avatar]);
DI::logger()->debug('Fetching was unsuccessful', ['avatar' => $avatar]);
return $fields;
}
$img_str = $fetchResult->getBodyString();
if (empty($img_str)) {
Logger::debug('Avatar is invalid', ['avatar' => $avatar]);
DI::logger()->debug('Avatar is invalid', ['avatar' => $avatar]);
return $fields;
}
$image = new Image($img_str, $fetchResult->getContentType(), $avatar);
if (!$image->isValid()) {
Logger::debug('Avatar picture is invalid', ['avatar' => $avatar]);
DI::logger()->debug('Avatar picture is invalid', ['avatar' => $avatar]);
return $fields;
}
@ -89,7 +88,7 @@ class Avatar
$fields['thumb'] = self::storeAvatarCache($image, $filename, Proxy::PIXEL_THUMB, $timestamp);
$fields['micro'] = self::storeAvatarCache($image, $filename, Proxy::PIXEL_MICRO, $timestamp);
Logger::debug('Storing new avatar cache', ['uri-id' => $contact['uri-id'], 'fields' => $fields]);
DI::logger()->debug('Storing new avatar cache', ['uri-id' => $contact['uri-id'], 'fields' => $fields]);
return $fields;
}
@ -155,36 +154,36 @@ class Avatar
if (!file_exists($dirpath)) {
if (!@mkdir($dirpath, $dir_perm) && !file_exists($dirpath)) {
Logger::warning('Directory could not be created', ['directory' => $dirpath]);
DI::logger()->warning('Directory could not be created', ['directory' => $dirpath]);
}
} elseif ((($old_perm = fileperms($dirpath) & 0777) != $dir_perm) && !chmod($dirpath, $dir_perm)) {
Logger::warning('Directory permissions could not be changed', ['directory' => $dirpath, 'old' => $old_perm, 'new' => $dir_perm]);
DI::logger()->warning('Directory permissions could not be changed', ['directory' => $dirpath, 'old' => $old_perm, 'new' => $dir_perm]);
}
if ((($old_group = filegroup($dirpath)) != $group) && !chgrp($dirpath, $group)) {
Logger::warning('Directory group could not be changed', ['directory' => $dirpath, 'old' => $old_group, 'new' => $group]);
DI::logger()->warning('Directory group could not be changed', ['directory' => $dirpath, 'old' => $old_group, 'new' => $group]);
}
}
if (!file_put_contents($filepath, $image->asString())) {
Logger::warning('File could not be created', ['file' => $filepath]);
DI::logger()->warning('File could not be created', ['file' => $filepath]);
}
$old_perm = fileperms($filepath) & 0666;
$old_group = filegroup($filepath);
if (($old_perm != $file_perm) && !chmod($filepath, $file_perm)) {
Logger::warning('File permissions could not be changed', ['file' => $filepath, 'old' => $old_perm, 'new' => $file_perm]);
DI::logger()->warning('File permissions could not be changed', ['file' => $filepath, 'old' => $old_perm, 'new' => $file_perm]);
}
if (($old_group != $group) && !chgrp($filepath, $group)) {
Logger::warning('File group could not be changed', ['file' => $filepath, 'old' => $old_group, 'new' => $group]);
DI::logger()->warning('File group could not be changed', ['file' => $filepath, 'old' => $old_group, 'new' => $group]);
}
DI::profiler()->stopRecording();
if (!file_exists($filepath)) {
Logger::warning('Avatar cache file could not be stored', ['file' => $filepath]);
DI::logger()->warning('Avatar cache file could not be stored', ['file' => $filepath]);
return '';
}
@ -235,9 +234,6 @@ class Avatar
/**
* Delete locally cached avatar pictures of a contact
*
* @param string $avatar
* @return bool
*/
public static function deleteCache(array $contact): bool
{
@ -260,7 +256,7 @@ class Avatar
$localFile = self::getCacheFile($avatar);
if (!empty($localFile)) {
@unlink($localFile);
Logger::debug('Unlink avatar', ['avatar' => $avatar, 'local' => $localFile]);
DI::logger()->debug('Unlink avatar', ['avatar' => $avatar, 'local' => $localFile]);
}
}
@ -280,11 +276,11 @@ class Avatar
if (!file_exists($basepath)) {
// We only automatically create the folder when it is in the web root
if (strpos($basepath, DI::basePath()) !== 0) {
Logger::warning('Base directory does not exist', ['directory' => $basepath]);
DI::logger()->warning('Base directory does not exist', ['directory' => $basepath]);
return '';
}
if (!mkdir($basepath, 0775)) {
Logger::warning('Base directory could not be created', ['directory' => $basepath]);
DI::logger()->warning('Base directory could not be created', ['directory' => $basepath]);
return '';
}
}

View file

@ -19,7 +19,7 @@ use Friendica\BaseEntity;
* @property-read string $request
* @property-read string $photo
* @property-read string $note
* @property-read \DateTime created
* @property-read \DateTime $created
* @property-read int|null $id
*/
class FriendSuggest extends BaseEntity

Some files were not shown because too many files have changed in this diff Show more