HTMLPurifier help needed - dumb newbie question - SOLVED |
[eluser]Unknown[/eluser]
Hi all, I'm following Jim O'halloran's intro tutorial (and also this http://mindloop.be/htmlpurifier-and-the-...framework/) and I'm hitting this error Code: Fatal error: Class 'HTMLPurifier_Config' not found in /var/www/ci/system/application/libraries/HTMLPurifier.php on line 91 I've got the same error for both examples, and since no one else has had this problem I'm sure it's cos I'm doing something dumb. what I've done is : downloaded a fresh HTMLpurifier (4.0.0 standard dist) from http://htmlpurifier.org/download copy the HTMLpurifier.php file to the system/application/libraries directory copied the HTMLPurifier directory to the system/application/libraries directory added the following line to the top of the HTMLpurifier.php file Code: set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() ); (I've actually tried a few other things, but that was just hacking and hoping) Seem's like I've got something wrong with my pathing, but I've not got enough of a handle to work out what. Let me know what other info you need to help ? Oh, and its CI 1.7.2 Thanks
[eluser]Unknown[/eluser]
Solved. it was a problem with loading classes in subdirectories from the application/library directory this post pointed me in the right direction - http://ellislab.com/forums/viewthread/127569/ After understanding the problem I discovered that HTMLPurifier has a standalone version. I downloaded it and copied both the HTMLPurifier.standalone.php and the standalone directory to the application/library directory and it mostly worked. I had to change the syntax a little due to Jims version using a deprecated syntax. Code: $purifier_config->set('Cache', 'SerializerPath', BASEPATH .'cache'); Code: $purifier_config->set('Cache.SerializerPath',BASEPATH .'cache' ); and I needed to change the perms on the standalone/HTMLPurifier/DefinitionCache/Serializer directory, and now it works (at least till HTMLPurifier v5).
[eluser]Thorpe Obazee[/eluser]
Anyway here's another implementation but as a helper: http://htmlpurifier.org/phorum/read.php?2,3100 |
Welcome Guest, Not a member yet? Register Sign In |