php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62026 Second param in setRankingMode, according to docs, should be optional
Submitted: 2012-05-14 14:12 UTC Modified: 2012-05-14 15:14 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: dorantor at gmail dot com Assigned: tony2001 (profile)
Status: Closed Package: sphinx (PECL)
PHP Version: Irrelevant OS: Archlinux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dorantor at gmail dot com
New email:
PHP Version: OS:

 

 [2012-05-14 14:12 UTC] dorantor at gmail dot com
Description:
------------
Here, http://sphinxsearch.com/docs/manual-2.0.4.html#api-func-setrankingmode,
documentation says that second param is optional:
function SetRankingMode ( $ranker, $rankexpr="" )

Second param have to be optional, otherwise it breaks the backwards 
compatibility.


Test script:
---------------
<?php
$cl = new SphinxClient();
$cl->setRankingMode(SPH_RANK_WORDCOUNT);

Expected result:
----------------
Nothing.

Actual result:
--------------
PHP Warning:  SphinxClient::setRankingMode() expects exactly 2 parameters, 1 
given in /sphinx.php on line 3

Warning: SphinxClient::setRankingMode() expects exactly 2 parameters, 1 given in 
/sphinx.php on line 3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-14 14:26 UTC] tony2001@php.net
Please try this patch:
http://dev.daylessday.org/diff/bug62026.diff
 [2012-05-14 14:26 UTC] tony2001@php.net
-Status: Open +Status: Feedback
 [2012-05-14 14:27 UTC] dorantor at gmail dot com
-Status: Feedback +Status: Open
 [2012-05-14 14:27 UTC] dorantor at gmail dot com
Almost forgot to add versions info:


$ sphinx-search
Sphinx 2.0.4-id64-release (r3135)


$ pecl list
Installed packages, channel pecl.php.net:
=========================================
Package  Version State
sphinx   1.2.0   stable


libsphinxclient is from
http://sphinxsearch.com/files/sphinx-2.0.4-release.tar.gz

Installed like this:
$ wget http://sphinxsearch.com/files/sphinx-2.0.4-release.tar.gz \
&& tar -zxf sphinx-2.0.4-release.tar.gz \
&& cd sphinx-2.0.4-release/api/libsphinxclient/ \
&& ./configure && sudo make install
 [2012-05-14 14:47 UTC] tony2001@php.net
-Status: Open +Status: Feedback
 [2012-05-14 15:07 UTC] dorantor at gmail dot com
-Status: Feedback +Status: Open
 [2012-05-14 15:07 UTC] dorantor at gmail dot com
With this patch everything working as expected. 

Waiting for next release with this patch :)
 [2012-05-14 15:14 UTC] tony2001@php.net
Automatic comment from SVN on behalf of tony2001
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=325687
Log: fix bug #62026 (Second param in setRankingMode should be optional)
 [2012-05-14 15:14 UTC] tony2001@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: tony2001
 [2012-05-14 15:14 UTC] tony2001@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Ok, patch applied, thanks for your help.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 04:03:23 2021 UTC