From 3c24bed412235cf8c7a3f16b46fed18004abf87b Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 26 Aug 2017 06:04:21 +0000 Subject: [PATCH] New class "System" --- boot.php | 1 + include/Contact.php | 1 + include/Photo.php | 1 + include/Smilies.php | 1 + include/api.php | 1 + include/auth.php | 1 + include/bb2diaspora.php | 1 + include/bbcode.php | 1 + include/contact_widgets.php | 1 + include/conversation.php | 1 + include/dbstructure.php | 1 + include/delivery.php | 1 + include/dfrn.php | 1 + include/diaspora.php | 1 + include/enotify.php | 1 + include/event.php | 1 + include/follow.php | 1 + include/identity.php | 1 + include/items.php | 1 + include/like.php | 1 + include/message.php | 1 + include/nav.php | 1 + include/network.php | 1 + include/oauth.php | 1 + include/oembed.php | 1 + include/ostatus.php | 1 + include/plugin.php | 1 + include/poller.php | 1 + include/pubsubpublish.php | 1 + include/redir.php | 1 + include/security.php | 1 + include/socgraph.php | 1 + include/tags.php | 1 + include/text.php | 1 + include/threads.php | 1 + include/uimport.php | 1 + index.php | 1 + mod/admin.php | 1 + mod/allfriends.php | 1 + mod/bookmarklet.php | 1 + mod/cal.php | 1 + mod/contacts.php | 1 + mod/content.php | 1 + mod/delegate.php | 1 + mod/dfrn_confirm.php | 1 + mod/dfrn_poll.php | 1 + mod/dfrn_request.php | 1 + mod/dirfind.php | 1 + mod/display.php | 1 + mod/editpost.php | 1 + mod/events.php | 1 + mod/fbrowser.php | 1 + mod/fetch.php | 1 + mod/filerm.php | 1 + mod/follow.php | 1 + mod/friendica.php | 1 + mod/group.php | 1 + mod/hcard.php | 1 + mod/help.php | 1 + mod/home.php | 1 + mod/ignored.php | 1 + mod/install.php | 1 + mod/invite.php | 1 + mod/item.php | 1 + mod/like.php | 1 + mod/localtime.php | 3 +- mod/lostpass.php | 1 + mod/manage.php | 1 + mod/manifest.php | 1 + mod/match.php | 1 + mod/message.php | 1 + mod/mood.php | 1 + mod/msearch.php | 1 + mod/navigation.php | 1 + mod/network.php | 1 + mod/nodeinfo.php | 1 + mod/noscrape.php | 1 + mod/notice.php | 1 + mod/notify.php | 1 + mod/oexchange.php | 1 + mod/openid.php | 1 + mod/opensearch.php | 1 + mod/ostatus_subscribe.php | 1 + mod/p.php | 1 + mod/photos.php | 1 + mod/ping.php | 1 + mod/poke.php | 1 + mod/profile.php | 1 + mod/profile_photo.php | 1 + mod/profiles.php | 1 + mod/proxy.php | 1 + mod/randprof.php | 1 + mod/redir.php | 1 + mod/register.php | 1 + mod/regmod.php | 1 + mod/removeme.php | 1 + mod/repair_ostatus.php | 1 + mod/rsd_xml.php | 3 +- mod/settings.php | 1 + mod/starred.php | 1 + mod/subthread.php | 1 + mod/suggest.php | 1 + mod/tagger.php | 1 + mod/tagrm.php | 1 + mod/toggle_mobile.php | 1 + mod/uexport.php | 1 + mod/videos.php | 1 + mod/wall_upload.php | 1 + mod/xrd.php | 1 + src/Core/System.php | 75 ++++++++++++++++++++++++++++++ src/Network/Probe.php | 1 + view/theme/duepuntozero/config.php | 1 + view/theme/frio/config.php | 1 + view/theme/frio/theme.php | 1 + view/theme/frost-mobile/theme.php | 1 + view/theme/frost/theme.php | 1 + view/theme/quattro/config.php | 1 + view/theme/quattro/theme.php | 1 + view/theme/smoothly/theme.php | 1 + view/theme/vier/config.php | 1 + view/theme/vier/theme.php | 1 + 121 files changed, 197 insertions(+), 2 deletions(-) create mode 100644 src/Core/System.php diff --git a/boot.php b/boot.php index 358e884947..216a93496e 100644 --- a/boot.php +++ b/boot.php @@ -21,6 +21,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); use Friendica\App; +use Friendica\Core\System; use Friendica\Core\Config; use Friendica\Util\Lock; diff --git a/include/Contact.php b/include/Contact.php index f69454e39e..0dbe2ca133 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -1,6 +1,7 @@ friendica items permanent-url compatibility */ use Friendica\App; +use Friendica\Core\System; function notice_init(App $a) { diff --git a/mod/notify.php b/mod/notify.php index e380681934..f2a73ea2a8 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -1,6 +1,7 @@ use Friendica\App; +use Friendica\Core\System; define('PROXY_DEFAULT_TIME', 86400); // 1 Day diff --git a/mod/randprof.php b/mod/randprof.php index 8d9083ada4..7bdd9e4ee0 100644 --- a/mod/randprof.php +++ b/mod/randprof.php @@ -1,6 +1,7 @@ '; killme(); -} \ No newline at end of file +} diff --git a/mod/settings.php b/mod/settings.php index f13e89cd16..c09b4397df 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1,6 +1,7 @@ get_baseurl($ssl); + } + + /** + * @brief Removes the baseurl from an url. This avoids some mixed content problems. + * + * @param string $orig_url + * + * @return string The cleaned url + */ + function removedBaseUrl($orig_url) { + self::init(); + return self::$a->remove_baseurl($orig_url); + } + + /// @todo Move the following functions from boot.php + /* + function get_guid($size = 16, $prefix = "") + function killme() + function goaway($s) + function local_user() + function public_contact() + function remote_user() + function notice($s) + function info($s) + function is_site_admin() + function random_digits($digits) + function get_server() + function get_temppath() + function get_cachefile($file, $writemode = true) + function get_itemcachepath() + function get_spoolpath() + function current_load() + */ +} diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 5168e4c262..a8e9e642a3 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -9,6 +9,7 @@ namespace Friendica\Network; */ use Friendica\App; +use Friendica\Core\System; use Friendica\Core\Config; use dbm; diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php index b1ec4bae53..c2bb1a0706 100644 --- a/view/theme/duepuntozero/config.php +++ b/view/theme/duepuntozero/config.php @@ -5,6 +5,7 @@ */ use Friendica\App; +use Friendica\Core\System; function theme_content(App $a) { if (!local_user()) { diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 229e863e93..eaa2585ad9 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -1,6 +1,7 @@ sourcename = 'Friendica mobile web'; diff --git a/view/theme/frost/theme.php b/view/theme/frost/theme.php index b09153876d..a3f4e011dd 100644 --- a/view/theme/frost/theme.php +++ b/view/theme/frost/theme.php @@ -10,6 +10,7 @@ */ use Friendica\App; +use Friendica\Core\System; function frost_init(App $a) { $a->videowidth = 400; diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index 47210012ca..9b3a65e3d2 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -5,6 +5,7 @@ */ use Friendica\App; +use Friendica\Core\System; function theme_content(App $a) { if (!local_user()) { diff --git a/view/theme/quattro/theme.php b/view/theme/quattro/theme.php index 5647fd493a..624e869043 100644 --- a/view/theme/quattro/theme.php +++ b/view/theme/quattro/theme.php @@ -8,6 +8,7 @@ */ use Friendica\App; +use Friendica\Core\System; function quattro_init(App $a) { $a->page['htmlhead'] .= ''; diff --git a/view/theme/smoothly/theme.php b/view/theme/smoothly/theme.php index 00f1147211..ab049b03b7 100644 --- a/view/theme/smoothly/theme.php +++ b/view/theme/smoothly/theme.php @@ -11,6 +11,7 @@ */ use Friendica\App; +use Friendica\Core\System; function smoothly_init(App $a) { set_template_engine($a, 'smarty3'); diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php index 0747770d36..5a20e131b9 100644 --- a/view/theme/vier/config.php +++ b/view/theme/vier/config.php @@ -5,6 +5,7 @@ */ use Friendica\App; +use Friendica\Core\System; function theme_content(App $a) { if (!local_user()) { diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index 298f0df57f..ee1751e4a0 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -10,6 +10,7 @@ */ use Friendica\App; +use Friendica\Core\System; require_once "include/plugin.php"; require_once "include/socgraph.php";