+ /**
+ * @brief Retrieves the Friendica instance base URL
+ *
+ * This function assembles the base URL from multiple parts:
+ * - Protocol is determined either by the request or a combination of
+ * system.ssl_policy and the $ssl parameter.
+ * - Host name is determined either by system.hostname or inferred from request
+ * - Path is inferred from SCRIPT_NAME
+ *
+ * Caches the result (depending on $ssl value) for performance.
+ *
+ * Note: $ssl parameter value doesn't directly correlate with the resulting protocol
+ *
+ * @param bool $ssl Whether to append http or https under SSL_POLICY_SELFSIGN
+ * @return string Friendica server base URL
+ */