tags:

views:

30

answers:

2

Hi, I am trying to use Searchable Behaviour hosted here: http://code.google.com/p/searchable-behaviour-for-cakephp/ To initialize the search_index table with existing data, I have used this: http://code.google.com/p/searchable-behaviour-for-cakephp/issues/detail?id=1&q=controller Reply No. 2 which creates the class SearchController.

The code was working fine on my local test server which runs PHP5. However, the server has PHP 4 and when I tried the code on server it gives this error:

Fatal error: Cannot redeclare class searchcontroller in LONG_PATH/cake/app/models/behaviors/searchable.php on line 2

Does it really has to do something with the PHP version or have I done some logical mistake?

A: 

Not sure, but you could try my Searchable plugin instead

neilcrookes
A: 

I just changed the name of the search Initialization controller and it worked. Looks like there is a Search Class created with Searchable behaviour.

Also, while using searchable plugin for CakePHP 4.x.x, if html_entity_decode and iconv are giving problems(as they did to me), use ut8_decode for decoding in place of html_en... and just comment out the iconv. The result may look ugly, but it works for most cases.

Mayank