<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>smoketests/cacheConfig.php</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -40,6 +40,9 @@ NEWS ( CHANGELOG and HISTORY )                                     HTMLPurifier
 ! You can now maintain your own configuration schema directories by
   creating a config-schema.php file or passing an extra argument. Check
   docs/dev-config-schema.html for more details.
+! Added HTMLPurifier_Config-&gt;serialize() method, which lets you save away
+  your configuration in a compact serial file, which you can unserialize
+  and use directly without having to go through the overhead of setup.
 - Fix bug where URIDefinition would not get cleared if it's directives got
   changed.
 - Fix fatal error in HTMLPurifier_Encoder on certain platforms (probably NetBSD 5.0)</diff>
      <filename>NEWS</filename>
    </modified>
    <modified>
      <diff>@@ -20,9 +20,6 @@ afraid to cast your vote for the next feature to be implemented!
 - Think about allowing explicit order of operations hooks for transforms
 - Add &quot;register&quot; field to config schemas to eliminate dependence on
   naming conventions
-- Make it easy for people to cache their entire configuration (so that
-  they have one script they run to change configuration, and then a stub
-  loader to get that configuration)
 - Add examples to everything (make built-in which also automatically
   gives output)
 </diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -564,6 +564,17 @@ class HTMLPurifier_Config
         trigger_error($msg . $extra, $no);
     }
 
+    /**
+     * Returns a serialized form of the configuration object that can
+     * be reconstituted.
+     */
+    public function serialize() {
+        $this-&gt;getDefinition('HTML');
+        $this-&gt;getDefinition('CSS');
+        $this-&gt;getDefinition('URI');
+        return serialize($this);
+    }
+
 }
 
 // vim: et sw=4 sts=4</diff>
      <filename>library/HTMLPurifier/Config.php</filename>
    </modified>
    <modified>
      <diff>@@ -451,6 +451,13 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness
         $this-&gt;assertIdentical($subconfig-&gt;get('Phantom.Latemasked'), 100);
     }
 
+    function testSerialize() {
+        $config = HTMLPurifier_Config::createDefault();
+        $config-&gt;set('HTML.Allowed', 'a');
+        $config2 = unserialize($config-&gt;serialize());
+        $this-&gt;assertIdentical($config, $config2);
+    }
+
 }
 
 // vim: et sw=4 sts=4</diff>
      <filename>tests/HTMLPurifier/ConfigTest.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>77b60a4206db5e0d854b47ad4985773381d8ebb1</id>
    </parent>
  </parents>
  <author>
    <name>Edward Z. Yang</name>
    <email>edwardzyang@thewritingpot.com</email>
  </author>
  <url>http://github.com/ezyang/htmlpurifier/commit/6e66dc9cad741771aa53f3935bb89b2e7bda0bb6</url>
  <id>6e66dc9cad741771aa53f3935bb89b2e7bda0bb6</id>
  <committed-date>2009-05-29T21:25:14-07:00</committed-date>
  <authored-date>2009-05-29T21:25:14-07:00</authored-date>
  <message>Add HTMLPurifier_config-&gt;serialize()
Signed-off-by: Edward Z. Yang &lt;edwardzyang@thewritingpot.com&gt;</message>
  <tree>89207c4f3b29918c5bc0a14f3df2b88e0641cb46</tree>
  <committer>
    <name>Edward Z. Yang</name>
    <email>edwardzyang@thewritingpot.com</email>
  </committer>
</commit>
