mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
The main goal was to move the functions out of the already overcrowded `boot.php`. While I would ideally have liked to move them properly under a namespace under `Zotlabs\`, that would break too much existing code at this point. Thus leaving it in include and under the global namespace for now.
61 lines
1.2 KiB
PHP
61 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Helper functions for getting info about the observer.
|
|
*
|
|
* SPDX-FileCopyrightText: 2025 The Hubzilla Community
|
|
* SPDX-FileContributor: Harald Eilertsen <haraldei@anduin.net>
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/**
|
|
* Get the unique hash identifying the current observer.
|
|
*
|
|
* Observer can be a local or remote channel.
|
|
*
|
|
* @return string Unique hash of observer, otherwise empty string if no
|
|
* observer
|
|
*/
|
|
function get_observer_hash() {
|
|
$observer = App::get_observer();
|
|
if (is_array($observer)) {
|
|
return $observer['xchan_hash'];
|
|
}
|
|
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* Get the guid of the current observer.
|
|
*
|
|
* Observer can be a local or remote channel.
|
|
*
|
|
* @return string The GUID of the observer, otherwise empty string if no
|
|
* observer
|
|
*/
|
|
function get_observer_guid() {
|
|
$observer = App::get_observer();
|
|
if (is_array($observer)) {
|
|
return $observer['xchan_guid'];
|
|
}
|
|
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* Get the name of the current observer.
|
|
*
|
|
* Observer can be a local or remote channel.
|
|
*
|
|
* @return string The name of the observer, otherwise empty string if no
|
|
* observer
|
|
*/
|
|
function get_observer_name() {
|
|
$observer = App::get_observer();
|
|
if (is_array($observer)) {
|
|
return $observer['xchan_name'];
|
|
}
|
|
|
|
return '';
|
|
}
|