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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 09:01:28 2025 UTC