Gdn_ConfigurationSource::parseString PHP Method

parseString() public static method

public static parseString ( $String, $Name ) : boolean
$String
$Name
return boolean
    public static function parseString($String, $Name)
    {
        // Define the variable properly.
        ${$Name} = null;
        // Parse the string
        if (!empty($String)) {
            $String = trim(str_replace(array('<?php', '<?', '?>'), '', $String));
            $Parsed = eval($String);
            if ($Parsed === false) {
                return false;
            }
        }
        // Make sure the config variable is here and is an array.
        if (is_null(${$Name}) || !is_array(${$Name})) {
            ${$Name} = array();
        }
        return ${$Name};
    }