Sphinx version
This commit is contained in:
parent
445b032338
commit
768e646e23
@ -813,33 +813,28 @@ function clientSphinx(&$formR)
|
||||
case 'ent':
|
||||
$host = SPHINX_ENT_HOST;
|
||||
$port = SPHINX_ENT_PORT;
|
||||
$version = defined('SPHINX_ENT_VERSION') ? SPHINX_ENT_VERSION : 1;
|
||||
$version = SPHINX_ENT_VERSION;
|
||||
break;
|
||||
case 'dir':
|
||||
$version = defined('SPHINX_DIR_VERSION') ? SPHINX_DIR_VERSION : 1;
|
||||
$version = SPHINX_DIR_VERSION;
|
||||
$host = SPHINX_DIR_HOST;
|
||||
$port = SPHINX_DIR_PORT;
|
||||
break;
|
||||
case 'histo':
|
||||
$version = defined('SPHINX_HISTO_VERSION') ? SPHINX_HISTO_VERSION : 1;
|
||||
$version = SPHINX_HISTO_VERSION;
|
||||
$host = SPHINX_HISTO_HOST;
|
||||
$port = SPHINX_HISTO_PORT;
|
||||
break;
|
||||
case 'act':
|
||||
$version = defined('SPHINX_ACT_VERSION') ? SPHINX_ACT_VERSION : 1;
|
||||
$version = SPHINX_ACT_VERSION;
|
||||
$host = SPHINX_ACT_HOST;
|
||||
$port = SPHINX_ACT_PORT;
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($version) {
|
||||
case 1:
|
||||
require_once 'SphinxSearch/sphinxapi-0.9.9.php';
|
||||
break;
|
||||
case 2:
|
||||
require_once 'SphinxSearch/sphinxapi-2.2.9.php';
|
||||
break;
|
||||
}
|
||||
$sphinxapiPath = 'SphinxSearch';
|
||||
$sphinxapiFile = 'sphinxapi-'.$version.'.php';
|
||||
require_once $sphinxapiPath.'/'.$sphinxapiFile;
|
||||
|
||||
// Client Sphinx
|
||||
$sphinx = new SphinxClient();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -768,7 +768,7 @@ class SphinxClient
|
||||
/// set matching mode
|
||||
function SetMatchMode ( $mode )
|
||||
{
|
||||
trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
|
||||
//trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
|
||||
assert ( $mode==SPH_MATCH_ALL
|
||||
|| $mode==SPH_MATCH_ANY
|
||||
|| $mode==SPH_MATCH_PHRASE
|
||||
|
@ -1,24 +1,32 @@
|
||||
<?php
|
||||
|
||||
//
|
||||
// $Id: sphinxapi.php 4522 2014-01-30 11:00:18Z tomat $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (c) 2001-2014, Andrew Aksyonoff
|
||||
// Copyright (c) 2008-2014, Sphinx Technologies Inc
|
||||
// Copyright (c) 2001-2016, Andrew Aksyonoff
|
||||
// Copyright (c) 2008-2016, Sphinx Technologies Inc
|
||||
// All rights reserved
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License. You should have
|
||||
// received a copy of the GPL license along with this program; if you
|
||||
// it under the terms of the GNU Library General Public License. You should
|
||||
// have received a copy of the LGPL license along with this program; if you
|
||||
// did not, you can find it at http://www.gnu.org/
|
||||
//
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// WARNING
|
||||
// We strongly recommend you to use SphinxQL instead of the API
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// WARNING!!!
|
||||
//
|
||||
// As of 2015, we strongly recommend to use either SphinxQL or REST APIs
|
||||
// rather than the native SphinxAPI.
|
||||
//
|
||||
// While both the native SphinxAPI protocol and the existing APIs will
|
||||
// continue to exist, and perhaps should not even break (too much), exposing
|
||||
// all the new features via multiple different native API implementations
|
||||
// is too much of a support complication for us.
|
||||
//
|
||||
// That said, you're welcome to overtake the maintenance of any given
|
||||
// official API, and remove this warning ;)
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// PHP version of Sphinx searchd client (PHP API)
|
||||
@ -760,7 +768,7 @@ class SphinxClient
|
||||
/// set matching mode
|
||||
function SetMatchMode ( $mode )
|
||||
{
|
||||
trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
|
||||
//trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
|
||||
assert ( $mode==SPH_MATCH_ALL
|
||||
|| $mode==SPH_MATCH_ANY
|
||||
|| $mode==SPH_MATCH_PHRASE
|
||||
@ -1828,5 +1836,5 @@ class SphinxClient
|
||||
}
|
||||
|
||||
//
|
||||
// $Id: sphinxapi.php 4522 2014-01-30 11:00:18Z tomat $
|
||||
// $Id$
|
||||
//
|
File diff suppressed because it is too large
Load Diff
@ -760,7 +760,7 @@ class SphinxClient
|
||||
/// set matching mode
|
||||
function SetMatchMode ( $mode )
|
||||
{
|
||||
trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
|
||||
//trigger_error ( 'DEPRECATED: Do not call this method or, even better, use SphinxQL instead of an API', E_USER_DEPRECATED );
|
||||
assert ( $mode==SPH_MATCH_ALL
|
||||
|| $mode==SPH_MATCH_ANY
|
||||
|| $mode==SPH_MATCH_PHRASE
|
||||
|
@ -1099,15 +1099,15 @@ class Interne extends Scores_Ws_Server
|
||||
|
||||
$tabFiltres = array();
|
||||
|
||||
if ($annee<>'' && $annee*1>=1953 && $annee*1<=date('Y')*1)
|
||||
$tabFiltres = array('annee1'=>$annee);
|
||||
|
||||
if (SPHINX_HISTO_VERSION == 1){
|
||||
require_once 'SphinxSearch/sphinxapi-0.9.9.php';
|
||||
} elseif (SPHINX_HISTO_VERSION == 2){
|
||||
require_once 'SphinxSearch/sphinxapi-2.2.9.php';
|
||||
if ($annee != '' && $annee*1 >= 1953 && $annee*1 <= date('Y')*1) {
|
||||
$tabFiltres = array('annee1' => $annee);
|
||||
}
|
||||
|
||||
$version = SPHINX_HISTO_VERSION;
|
||||
$sphinxapiPath = 'SphinxSearch';
|
||||
$sphinxapiFile = 'sphinxapi-'.$version.'.php';
|
||||
require_once $sphinxapiPath.'/'.$sphinxapiFile;
|
||||
|
||||
$cl = new SphinxClient();
|
||||
$cl->SetServer (SPHINX_HISTO_HOST, SPHINX_HISTO_PORT);
|
||||
$cl->SetConnectTimeout(1);
|
||||
|
Loading…
Reference in New Issue
Block a user