[RCD] Help trying to do a search with only the framework.
thomas at roundcube.net
Thu Apr 23 08:30:47 CEST 2015
On Mon, Apr 20, 2015 at 4:20 PM, Rodrigo Santellan <rsantellan at gmail.com> wrote:
> Now the search is working, but is bringing all the mbox content not only the
> search. If I run per example 'delivery' on roundcube in my ISP I get 6
> result but on my search bring all the stuff.
> This is my search method:
> public function search($folder, $criteria, $pager = 1, $quantity = 1000)
> [... lots of PHP code ...]
I'm lacking time and interest in reading through all of your code.
However, I suspect you're passing just an empty string to the
rcube_imap::search() function at some point.
Enable IMAP debug logging (in Roundcube config set
$config['imap_debug'] = true; or with $storage->set_debug(true)) and
check what IMAP commands are actually sent to your IMAP server and
what's the reply from it. The entire IMAP communication is logged into
the 'imap' log file in your Roundcube logs directory.
If that doesn't help, please reduce your code to a simple test case
showing that the Roundcube framework doesn't work as expected.
> On Fri, Apr 17, 2015 at 5:00 AM, Thomas Bruederli <thomas at roundcube.net>
>> On Tue, Apr 14, 2015 at 9:45 PM, Rodrigo Santellan <rsantellan at gmail.com>
>> > Hi,
>> Hello Rodrigo
>> > I'm trying to do a search with only the framework framework. I has been
>> > trying to separate the component so they can be used on another
>> > framework,
>> > I'm using it now in Symonfony2 but planing to use in another ones.
>> > So far I identified the class rcube_imap_search that will do the search.
>> Please note that this class is only a helper class for internal use.
>> > I created a helper with static methods that I'm rewriting to not use
>> > globals.
>> > On the file RouncubeHelper I create a connection to the IMAP server. My
>> > problem is that when I try to do the actual search with the method
>> > search it
>> > always come empty.
>> > What I'm missing? If I'm using only one folder is a good practice to
>> > call
>> > to:
>> > $searchRcube = new \rcube_imap_search(array('skip_deleted' => true),
>> > $this->rcube->get_storage()->conn);
>> > $data = $searchRcube->exec(array($folder), $criteria, null, 'date');
>> > Like that?
>> In order to execute a search (or any other IMAP operation), you should
>> use the methods of the rcube_imap instance you get via
>> rcube::get_storage(). For searching that would be rcube_imap::search()
>> . See an example how to execute the search in the Roundcube webmail
>> code .
>> Kind regards,
>> Roundcube Development discussion mailing list
>> dev at lists.roundcube.net
> Roundcube Development discussion mailing list
> dev at lists.roundcube.net
More information about the dev