BlueOrange
Member
EDIT: I've managed to solve this myself, by looking around the forums and seeing what is done for people creating threads and users via "external" scripts. My solution is:
	
	
	
		
I've been developing a API of sorts and within this API I would like to get the options from a custom addon. How would I do so?
I've tried the following, but nothing is returned when GetAPIKey is called:
	
	
	
		
Am I missing something? The option was created in the addon options in debug mode too.
Thanks
				
			
		PHP:
	
	function GetAPIKey() {
    $dir = $_SERVER["DOCUMENT_ROOT"];
    require("$dir/src/XF.php");
    XF::start($dir);
    $options = XF::options();
    return "$options->BridgeAPIKey";
}
	I've been developing a API of sorts and within this API I would like to get the options from a custom addon. How would I do so?
I've tried the following, but nothing is returned when GetAPIKey is called:
		PHP:
	
	public static function GetAPIKey() {
    $options = \XF::options();
    return $options["BridgeAPIKey"];
}
public static function GetAPIKey() {
    $options = \XF::options();
    return $options->BridgeAPIKey;
}
	Am I missing something? The option was created in the addon options in debug mode too.
Thanks
			
				Last edited: