function opf_dump_var($var, $spacing = "")
{
    $result = "";
    if (is_string($var)) {
        if (strpos($var, 'a:') === 0) {
            $var = unserialize($var);
        }
    }
    if (is_array($var)) {
        $result = "array (\n";
        $numeric_keys = true;
        foreach (array_keys($var) as $key) {
            if (!is_numeric($key)) {
                $numeric_keys = false;
            }
        }
        foreach ($var as $key => $value) {
            if (!is_numeric($key)) {
                $result .= "{$spacing}    \"{$key}\" => " . opf_dump_var($value, "{$spacing}    ") . ",\n";
            } else {
                if ($numeric_keys) {
                    $result .= "{$spacing}    {$key} => " . opf_dump_var($value, "{$spacing}    ") . ",\n";
                }
            }
        }
        $result .= "{$spacing})";
    } else {
        if (is_string($var)) {
            $result = "'" . opf_escape_string($var) . "'";
        } else {
            $result = "{$var}";
        }
    }
    return $result;
}
        $export_message = sprintf($text_failed, $archive->errorInfo(true));
        rm_full_dir($temp_dir . $temp_name);
        return FALSE;
    }
} else {
    // inline-filter
    // create a plugin-filter
    $filter['plugin'] = $temp_name;
    $filter_func = $filter['func'];
    $filter['func'] = '';
    $filter['file'] = '{OPF:PLUGIN_PATH}/filter.php';
    // get human readable dump
    $filter_dump = opf_dump_var($filter);
    // get filter-data serialised
    $filter_ser = serialize($filter);
    $filter_ser = opf_escape_string($filter_ser);
    $file_info = <<<EOD
<?php
\$plugin_directory   = '{$temp_name}';
\$plugin_name        = '{$filter['name']}';
\$plugin_version     = '';
\$plugin_status      = '';
\$plugin_platform    = '';
\$plugin_author      = '';
\$plugin_license     = '';
\$plugin_description = '';
EOD;
    $file_index = <<<EOD
<?php
@header('HTTP/1.1 301 Moved Permanently',TRUE,301);
exit(header('Location: ../index.php'));