Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_plugin_config()

Description

Return plugin config stored in plugins table for a given plugin name.

Queries the plugins table for a stored config value and, if found,
unserializes the data and returns the result. If config isn't found
returns null.

@see set_plugin_config

Parameters

ColumnTypeDefaultDescription
$name string Plugin name

Return

mixed|null Returns config data or null if no config.

Location

include/plugin_functions.php lines 305 to 328

Definition

 
function get_plugin_config($name){
    global 
$mysql_charset;

    
# Need verbatim queries here
    
$configs ps_query("SELECT config, config_json from plugins where name = ?", array("s"$name), 'plugins');
    
$configs $configs[0] ?? [];
    if (!
array_key_exists('config'$configs) || is_null($configs['config_json']))
        {
        return 
null;
        }
    elseif (
array_key_exists('config_json'$configs) && function_exists('json_decode'))
        {
        if (!isset(
$mysql_charset))
            {
            
$configs['config_json'] = iconv('ISO-8859-1''UTF-8'$configs['config_json']);
            }
            return 
json_decode($configs['config_json'], true);

        }
    else
        {
        return 
unserialize(base64_decode($configs['config']));
        }
}

This article was last updated 13th December 2024 14:35 Europe/London time based on the source file dated 29th November 2024 10:35 Europe/London time.