Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

include_plugin_config()

Parameters

ColumnTypeDefaultDescription
$plugin_name
$config ""
$config_json ""

Location

include/plugin_functions.php lines 1438 to 1480

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 $configpath;}
    
$configpath $pluginpath "/config/config.php";
    if (
file_exists($configpath)) {include $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;
        }
    
debug_track_vars('end@include_plugin_config'get_defined_vars());
    }

This article was last updated 14th May 2021 22:35 Europe/London time based on the source file dated 10th May 2021 17:30 Europe/London time.