Exemple #1
0
function SaveArray($vArray)
{
    global $buffer;
    // Every array starts with chr(1)+"{"
    $buffer .= "{";
    // Go through the given array
    reset($vArray);
    while (true) {
        $Current = current($vArray);
        $MyKey = addslashes(strval(key($vArray)));
        if (is_array($Current)) {
            $buffer .= $MyKey . "";
            SaveArray($Current);
            $buffer .= "";
        } else {
            $Current = addslashes($Current);
            $buffer .= "{$MyKey}{$Current}";
        }
        ++$i;
        while (next($vArray) === false) {
            if (++$i > count($vArray)) {
                break;
            }
        }
        if ($i > count($vArray)) {
            break;
        }
    }
    $buffer .= "}";
}
 function save()
 {
     return SaveArray($this->data, $this->file);
 }
 function save()
 {
     $this->all_settings[$this->name] = $this->settings;
     return SaveArray($this->all_settings, KNIFE_PATH . "/data/settings.php");
 }