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

include_plugin_config()

Description

Includes configuration files for a specified plugin.

Parameters

ColumnTypeDefaultDescription
$plugin_name string The name of the plugin whose configuration files are to be included.
$config string "" Optional serialized base64-encoded configuration string.
$config_json string "" Optional JSON-encoded configuration string.

Return

void This function does not return a value; it modifies global variables.

Location

include/plugin_functions.php lines 1487 to 1528

Definition

 
function include_plugin_config($plugin_name,$config="",$config_json="")
{
    global 
$mysql_charset;

    
$pluginpath get_plugin_path($plugin_name);

    
$configpath $pluginpath "/config/config.default.php";
    if (
file_exists($configpath)) {
        include_once 
$configpath;
    }

    
$configpath $pluginpath "/config/config.php";
    if (
file_exists($configpath)) {
        include_once 
$configpath;
    }

    if (
$config_json != "" && function_exists('json_decode')) {
        if (!isset(
$mysql_charset)) {
            
$config_json iconv('ISO-8859-1''UTF-8'$config_json);
        }

        
$config_json json_decode($config_jsontrue);
        if (
$config_json) {
            foreach (
$config_json as $key => $value) {
                $
$key $value;
            }
        }
    } elseif (
$config != "") {
        
$config unserialize(base64_decode($config));
        foreach (
$config as $key => $value) {
            $
$key $value;
        }
    }

    
# Copy config variables to global scope.
    
unset($plugin_name$config$config_json$configpath);
    
$vars get_defined_vars();
    foreach (
$vars as $name => $value) {
        global $
$name;
        $
$name $value;
    }
}

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