diff options
author | Mario <mario@mariovavti.com> | 2024-04-30 06:59:20 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-04-30 06:59:20 +0000 |
commit | ce15852b9a57a6c77531186ed24a389ebce8524e (patch) | |
tree | ad04cef0d545c5e5e24e76060b6c32d65363d48e /doc/en/dev-function-overview.md | |
parent | 48cec945051d259a06871d937ad998a1bd3e22ec (diff) | |
parent | 7c34a3676d294c9a1acc69f71ab3061074509160 (diff) | |
download | volse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.tar.gz volse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.tar.bz2 volse-hubzilla-ce15852b9a57a6c77531186ed24a389ebce8524e.zip |
Merge branch 'rework-help-module' into 'dev'
Rework Help module + begin tests for Setup module
See merge request hubzilla/core!2120
Diffstat (limited to 'doc/en/dev-function-overview.md')
-rw-r--r-- | doc/en/dev-function-overview.md | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/doc/en/dev-function-overview.md b/doc/en/dev-function-overview.md new file mode 100644 index 000000000..4dccc8cef --- /dev/null +++ b/doc/en/dev-function-overview.md @@ -0,0 +1,51 @@ +$Projectname development - some useful basic functions +====================================================== + + + +* get_account_id() + +Returns numeric account_id if authenticated or 0. It is possible to be authenticated and not connected to a channel. + +* local_channel() + +Returns authenticated numeric channel_id if authenticated and connected to a channel or 0. Sometimes referred to as $uid in the code. + +* remote_channel() + +Returns authenticated string hash of Red global identifier, if authenticated via remote auth, or an empty string. + +* App::get_observer() + +returns an xchan structure representing the current viewer if authenticated (locally or remotely). + +* get_config($family,$key), get_pconfig($uid,$family,$key) + +Returns the config setting for $family and $key or false if unset. + +Deprecated: Use Zotlabs\Lib\Config::Get instead. + +* set_config($family,$key,$value), set_pconfig($uid,$family,$key,$value) + +Sets the value of config setting for $family and $key to $value. Returns $value. The config versions operate on system-wide settings. The pconfig versions get/set the values for a specific integer uid (channel_id). + +Deprecated: Use Zotlabs\Lib\Config::Set instead. + +* dbesc() + +Always escape strings being used in DB queries. This function returns the escaped string. Integer DB parameters should all be proven integers by wrapping with intval() + +* q($sql,$var1...) + +Perform a DB query with the SQL statement $sql. printf style arguments %s and %d are replaced with variable arguments, which should each be appropriately dbesc() or intval(). SELECT queries return an array of results or false if SQL or DB error. Other queries return true if the command was successful or false if it wasn't. + +* t($string) + +Returns the translated variant of $string for the current language or $string (default 'en' language) if the language is unrecognised or a translated version of the string does not exist. + +* x($var), $x($array,$key) + +Shorthand test to see if variable $var is set and is not empty. Tests vary by type. Returns false if $var or $key is not set. +If variable is set, returns 1 if has 'non-zero' value, otherwise returns 0. -- e.g. x('') or x(0) returns 0; + +#include doc/macros/main_footer.bb; |