#!/usr/bin/php open('w'); $multiline = false; foreach ($hash as $key => $value) { $multiline = $multiline || (strpos($value, "\n") !== false); if ($multiline) { $file->put("--$key--" . PHP_EOL); $file->put(str_replace("\n", PHP_EOL, $value) . PHP_EOL); } else { if ($key == 'ID') { $file->put("$value" . PHP_EOL); } else { $file->put("$key: $value" . PHP_EOL); } } } $file->close(); } $schema = HTMLPurifier_ConfigSchema::instance(); $adapter = new ConfigSchema_StringHashReverseAdapter($schema); foreach ($schema->info as $ns => $ns_array) { saveHash($adapter->get($ns)); foreach ($ns_array as $dir => $x) { saveHash($adapter->get($ns, $dir)); } }