Fix minor grammatical error: "per-say" to "per se". Thanks EvulOrange!
[htmlpurifier-web.git] / download.xhtml
blob5f42d645b50625f21b6d87529ec0e26a2923ba7f
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
4 <!ENTITY % htmlpurifier.current SYSTEM "current.ent"> %htmlpurifier.current;
5 ]>
6 <html
7 xmlns="http://www.w3.org/1999/xhtml"
8 xmlns:xi="http://www.w3.org/2001/XInclude"
9 xml:lang="en">
10 <head>
11 <title>Download - HTML Purifier</title>
12 <xi:include href="common-meta.xml" xpointer="xpointer(/*/node())" />
13 <meta name="description" content="Download HTML Purifier, the standards-compliant HTML filter library." />
14 <meta name="keywords" content="HTMLPurifier, HTML Purifier, HTML, filter, filtering, standards, compliant, w3c, download, zip, tarball, tgz, sig, gpg, gnupg, sha1, hash, checksum" />
15 </head>
16 <body>
18 <xi:include href="common-header.xml" xpointer="xpointer(/*/node())" />
19 <h1 id="title">Download</h1>
21 <div id="content">
23 <p>
24 The current version of HTML Purifier is
25 <strong>&htmlpurifier.current.version;</strong>, released on
26 &htmlpurifier.current.release-date;, and is compatible with
27 <abbr>PHP</abbr> 4.3.2 and up. This library is open-source,
28 licensed under the <a href="http://www.gnu.org/licenses/lgpl.html"><abbr>LGPL</abbr>
29 v2.1+</a>. We offer multiple ways of downloading
30 and installing HTML Purifier.
31 </p>
33 <div id="toc" class="floated" />
35 <h2 id="Standard">Standard</h2>
37 <p>
38 We offer the standard zip and tarball downloads. Download them,
39 unzip them, and with a few simple <a href="#Installation">installation</a> steps get
40 to using HTML Purifier right away:
41 </p>
43 <ul>
44 <li><a class="download" href="&url.dl.tar.gz;">HTML Purifier &htmlpurifier.current.version; (.tar.gz)</a> [<a href="&url.dl.tar.gz.sig;">sig</a>]</li>
45 <li><a class="download" href="&url.dl.zip;">HTML Purifier &htmlpurifier.current.version; (.zip)</a> [<a href="&url.dl.zip.sig;">sig</a>]</li>
46 <li><a class="download" href="&url.dl-strict.tar.gz;">HTML Purifier &htmlpurifier.current.version; PHP5-strict (.tar.gz)</a> [<a href="&url.dl-strict.tar.gz.sig;">sig</a>]</li>
47 <li><a class="download" href="&url.dl-strict.zip;">HTML Purifier &htmlpurifier.current.version; PHP5-strict (.zip)</a> [<a href="&url.dl-strict.zip.sig;">sig</a>]</li>
48 </ul>
50 <p>
51 The <abbr>PHP</abbr>5-strict version is exactly the same
52 as the regular version with a few tweaks
53 to prevent it from complaining with
54 <a href="http://php.net/manual/en/ref.errorfunc.php#e-strict">E_STRICT</a>
55 warnings.
56 </p>
58 <h3 id="SHA1"><acronym>SHA-1</acronym> checksums</h3>
60 <p>
61 Here are the <acronym>SHA-1</acronym> checksums you can use to
62 verify the integrity of your HTML Purifier download:
63 </p>
65 <pre class="long">
66 a2690b2d84904410441f5d6018488f76f734ed96 htmlpurifier-2.0.1-strict.tar.gz
67 3be5346e6e5b21f16b3abab84d743887d4dbce3b htmlpurifier-2.0.1-strict.zip
68 3812bc2159baf1248829c014d8d643f0cd3dd959 htmlpurifier-2.0.1.tar.gz
69 7c08b6bdaa75a8f9834fadf66756cd0f7a18eb4c htmlpurifier-2.0.1.zip
70 </pre>
72 <h3 id="GnuPG">GnuPG signatures</h3>
74 <p>
75 There are <tt>.sig</tt> files which you can use to cryptographically verify
76 that the release is from me, Edward Z. Yang. You can find
77 my <a href="http://www.thewritingpot.com/gpgpubkey.asc">public key
78 here (0x869C48DA)</a>. My key's fingerprint is:
79 <tt>3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA</tt>.
80 </p>
82 <p>Verify files with this command:</p>
84 <pre class="command">gpg --verify <strong>$filename</strong>.sig</pre>
86 <h2 id="PEAR"><acronym>PEAR</acronym></h2>
88 <p>
89 HTML Purifier is also available via a <acronym>PEAR</acronym> channel.
90 The <acronym>PEAR</acronym> installer is an incredibly powerful and robust
91 way to install <abbr>PHP</abbr> packages, and
92 does not have to be limited to packages found on
93 <a href="http://pear.php.net/">pear.php.net</a>. With
94 <acronym>PEAR</acronym>, installing is as simple as these
95 two commands in your shell:
96 </p>
98 <pre class="command">pear channel-discover htmlpurifier.org
99 pear install hp/HTMLPurifier</pre>
102 ...and then including this code in your application:
103 </p>
105 <pre>require_once 'HTMLPurifier.php';</pre>
108 Because <acronym>PEAR</acronym> already has the proper include paths set up, including
109 <code>HTMLPurifier.auto.php</code> is unnecessary (in fact, it will fail,
110 since that file is not packaged with the <acronym>PEAR</acronym> distribution.)
111 </p>
114 Note that the <abbr>PHP</abbr>5-strict version is <em>not</em> available
115 via <acronym>PEAR</acronym>.
116 </p>
118 <h2 id="Subversion">Subversion</h2>
121 For those who like to live on the edge, you can also grab the latest
122 developmental code from our Subversion
123 repository. Simply execute this command in your shell (you must have
124 Subversion installed):
125 </p>
127 <pre class="command">svn co http://htmlpurifier.org/svnroot/htmlpurifier/trunk ./</pre>
130 Code in the trunk actually tends to be quite stable on <abbr>PHP</abbr>5:
131 a combination of extensive unit-testing and atomic commits means that
132 the most recent version will almost never be broken. It should be noted,
133 however, that <abbr>PHP</abbr>4 testing is more sporadic and occasionally
134 code involving object copying will break in <abbr>PHP</abbr>4. Also,
135 the strict branch is not updated prior to release time.
136 </p>
139 For the less adventurous, you can take
140 a peek at specific files by <a href="http://htmlpurifier.org/svnroot/htmlpurifier/trunk/">browsing
141 anonymously</a> at the repository root or using
142 <a href="http://htmlpurifier.org/viewvc.cgi/htmlpurifier/trunk/">ViewVC to
143 view the repository</a>.
144 </p>
147 We do not currently offer nightly builds, mainly because no one has
148 really asked for them. There is no <q>build</q> process to HTML Purifier:
149 a checkout from the Subversion repository is ready to go immediately.
150 </p>
152 <h2 id="Installation">Installation</h2>
154 <h3>File permissions</h3>
157 <strong>Starting with HTML Purifier 2.0.0, it is vital that you set
158 proper directory permissions for where HTML Purifier writes out
159 some temporary files.</strong> Specifically, HTML Purifier will write
160 out cache files for HTMLDefinition in the subdirectories of
161 <code>HTMLPurifier/DefinitionCache/Serializer</code>. If you are in
162 the <code>library/</code> folder of HTML Purifier, you can set the
163 appropriate permissions using:
164 </p>
166 <pre class="command">chmod -R 0755 HTMLPurifier/DefinitionCache/Serializer</pre>
169 If the above command doesn't work, you may need to assign write permissions
170 to all. This may be necessary if your webserver runs as nobody, but is
171 not recommended since it means any other user can write files in the
172 directory. Use:
173 </p>
175 <pre class="command">chmod -R 0777 HTMLPurifier/DefinitionCache/Serializer</pre>
178 You can also chmod files via your <abbr>FTP</abbr> client; this option
179 is usually accessible by right clicking the corresponding directory and
180 then selecting <q>chmod</q> or <q>file permissions</q>.
181 </p>
184 If you are unable or unwilling to give write permissions to the cache
185 directory, you can either disable the cache (and suffer a performance
186 hit):
187 </p>
189 <pre>$config->set('Core', 'DefinitionCache', null);</pre>
192 Or move the cache directory somewhere else (no trailing slash):
193 </p>
195 <pre>$config->set('Cache', 'SerializerPath', '/home/user/absolute/path');</pre>
198 If there is a demand for it, future versions will also support
199 <a href="http://danga.com/memcached/">memcached</a>
200 as a caching system.
201 </p>
203 <h3>Quick install</h3>
205 <p>If your website is in UTF-8 and XHTML Transitional, use this code:</p>
207 <pre>&lt;?php
208 require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
210 $purifier = new HTMLPurifier();
211 $clean_html = $purifier->purify($dirty_html);
212 ?&gt;</pre>
214 <p>If your website is in a different encoding or doctype, use this code:</p>
216 <pre>&lt;?php
217 require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
219 $config = HTMLPurifier_Config::createDefault();
220 $config->set('Core', 'Encoding', <strong>'ISO-8859-1'</strong>); // replace with your encoding
221 $config->set('HTML', 'Doctype', <strong>'HTML 4.01 Transitional'</strong>); // replace with your doctype
222 $purifier = new HTMLPurifier($config);
224 $clean_html = $purifier->purify($dirty_html);
225 ?&gt;</pre>
228 For detailed installation instructions, read the
229 <a href="http://htmlpurifier.org/svnroot/htmlpurifier/tags/&htmlpurifier.current.version;/INSTALL"><code>INSTALL</code></a>
230 document.
231 </p>
233 <h2 id="MailingList">Mailing list</h2>
236 You can be notified of new releases by a low-traffic announce list. Subscribe
237 here:
238 </p>
240 <form method="post" action="http://scripts.dreamhost.com/add_list.cgi">
241 <div>
242 <label for="name">Name</label>: <input type="text" name="name" id="name" />
243 <label for="email">E-mail</label>: <input type="text" name="email" id="email" />
244 </div>
245 <div>
246 <input type="submit" name="submit" value="Suscribe to Announcement List" />
247 <input type="submit" name="unsub" value="Unsubscribe" />
248 </div>
249 <input type="hidden" name="list" value="admin@htmlpurifier.org" />
250 <input type="hidden" name="domain" value="htmlpurifier.org" />
251 <input type="hidden" name="emailit" value="1" />
252 </form>
255 We take your privacy very seriously and will not use emails submitted
256 to this web form for any other purposes.
257 </p>
259 <h2 id="History">History</h2>
262 Previous releases can be obtained by browsing
263 the <a href="releases/">release directory</a>
264 or checking code out of the
265 <a href="http://htmlpurifier.org/svnroot/htmlpurifier/tags/">tags/
266 directory</a>. However, they are not supported and should not be used
267 in live environments. If you are having trouble upgrading, pop over
268 to <a href="http://htmlpurifier.org/phorum/">the forums</a> and get help.
269 </p>
271 </div>
273 </body>
274 </html>