Libzot
- Full name:
\Zotlabs\Lib\Libzot
Methods
new_uid
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$channel_nick |
string | a unique nickname of controlling entity |
make_xchan_hash
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$guid |
string | |
$pubkey |
string |
get_hublocs
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$hash |
string | - xchan_hash |
Return Value:
of hubloc (hub location structures)
build_packet
public static build_packet(array $channel, string $type = 'activity', array $recipients = null, array $msg = [], string $encoding = 'activitystreams', string $remote_key = null, string $methods = ''): mixed
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$channel |
array | sender channel structure |
$type |
string | packet type: one of 'ping', 'pickup', 'purge', 'refresh', 'keychange', 'force_refresh', 'notify', 'auth_check' |
$recipients |
array | envelope recipients, array of portable_id's; empty for public posts |
$msg |
array | optional message |
$encoding |
string | optional encoding, default 'activitystreams' |
$remote_key |
string | optional public site key of target hub used to encrypt entire packet NOTE: remote_key and encrypted packets are required for 'auth_check' packets, optional for all others |
$methods |
string | optional comma separated list of encryption methods @ref best_algorithm() |
best_algorithm
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$methods |
string | Comma separated list of encryption methods |
Return Value:
first match from our site method preferences Crypto::methods() array of a method which is common to both sites; or 'aes256cbc' if no matches are found.
zot
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$url |
string | |
$data |
string | |
$channel |
array | (required if using zot6 delivery) |
$crypto |
array | (required if encrypted httpsig, requires hubloc_sitekey and site_crypto elements) |
Return Value:
see z_post_url() for returned data format
See Also:
- \Zotlabs\Lib\z_post_url() -
refresh
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$them |
array | => xchan structure of sender |
$channel |
array | => local channel structure of target recipient, required for "friending" operations |
$force |
bool | (optional) default false |
Return Value:
-
- \b true if successful
-
- otherwise \b false
gethub
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$arr |
array | an associative array which must contain: \e string \b id => id of conversant \e string \b id_sig => id signed with conversant's private key \e string \b location => URL of the origination hub of this communication \e string \b location_sig => URL signed with conversant's private key * \e string \b site_id => URL signed with conversant's private key |
$multiple |
bool | (optional) default false |
Return Value:
-
- null if site is blacklisted or not found
-
- otherwise an array with an hubloc record
valid_hub
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$sender |
string | |
$site_id |
string |
register_hub
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$id |
string |
Return Value:
An associative array with * \e boolean \b success * \e string \b message (optional, unused) error string only if success is false
import_xchan
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$arr |
array | => json_decoded discovery packet |
Return Value:
An associative array with: * \e boolean \b success boolean true or false * \e string \b message (optional) error string only if success is false
process_response
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$hub |
string | - url of site we just contacted |
$arr |
array | - output of z_post_url() |
$outq |
array | - The queue structure attached to this request |
fetch
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$arr |
array | decrypted and json decoded notify packet from remote site |
Return Value:
from zot_import()
See Also:
- \Zotlabs\Lib\zot_import() -
import
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$arr |
array | 'pickup' structure returned from remote site |
is_top_level
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$env |
array | |
$act |
object |
find_parent
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$env |
mixed | |
$act |
mixed |
find_parent_owner_hashes
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$env |
mixed | |
$act |
mixed |
public_recips
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$msg |
array | |
$act |
object |
process_delivery
public static process_delivery(string $sender, mixed $act, array $arr, array $deliveries, bool $relay, bool $public = false, bool $request = false, bool $force = false, mixed $is_collection_operation = false): array
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$sender |
string | |
$act |
mixed | |
$arr |
array | |
$deliveries |
array | |
$relay |
bool | |
$public |
bool | (optional) default false |
$request |
bool | (optional) default false |
$force |
bool | (optional) default false - should only be set for manual fetch |
$is_collection_operation |
mixed |
fetch_conversation
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$channel |
mixed | |
$mid |
mixed | |
$force |
mixed |
remove_community_tag
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$sender |
string | |
$arr |
array | an associative array \e int \b verb \e int \b obj_type * \e int \b mid |
$uid |
int |
update_imported_item
public static update_imported_item(string $sender, array $item, array $orig, int $uid, bool $tag_delivery): void|array
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$sender |
string | |
$item |
array | |
$orig |
array | |
$uid |
int | |
$tag_delivery |
bool |
See Also:
- \Zotlabs\Lib\item_store_update() -
delete_imported_item
public static delete_imported_item(string $sender, mixed $act, array $item, int $uid, bool $relay): bool|int
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$sender |
string | * * \e string \b hash a xchan_hash |
$act |
mixed | |
$item |
array | |
$uid |
int | |
$relay |
bool |
Return Value:
post_id
encode_locations
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$channel |
array | an associative array which must contain * \e string \b channel_hash the hash of the channel |
Return Value:
an array with associative arrays
See Also:
- \Zotlabs\Lib\self::get_hublocs() -
import_site
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$arr |
array |
Return Value:
true if updated or inserted
get_rpost_path
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$observer |
array | * * \e string \b xchan_url |
import_author_zot
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$x |
array |
Return Value:
return false or a hash
zotinfo
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$arr |
mixed |
site_info
- This method is static.
update_hub_connected
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$hub |
array | |
$site_id |
string | (optional, default empty) |
Return Value:
hubloc_url
sign
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
string | |
$key |
string | |
$alg |
string | (optional) default 'sha256' |
verify
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
mixed | |
$sig |
mixed | |
$key |
mixed |
is_zot_request
- This method is static.
zot_record_preferred
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$arr |
mixed | |
$check |
mixed |
update_cached_hubloc
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$hubloc |
mixed |
Automatically generated on 2025-03-19