On prend la configuration dans le fichier ini

This commit is contained in:
Michael RICOIS 2012-02-09 12:44:00 +00:00
parent 99ba700276
commit 3f7061b48d
2 changed files with 4 additions and 41 deletions

View File

@ -12,20 +12,16 @@ Class Ciblage
public $nb_results = 5000;
public $max_results = 500000;
public $mysql_host = '192.168.78.230';
public $mysql_user = 'sphinx';
public $mysql_password = 'indexer';
public $mysql_database = 'jo';
public $sphinx_host = '192.168.78.252';
public $sphinx_port = 3312;
public $sphinx_match = SPH_MATCH_EXTENDED2;
public $sphinx_sort = SPH_SORT_EXTENDED;
public function __construct($structure, $need = false)
{
$configuration = Zend_Registry::get('configuration');
//Instantiation Sphinx
$this->sphinx = new SphinxClient();
$this->sphinx->SetServer($this->sphinx_host, $this->sphinx_port);
$this->sphinx->SetServer($configuration->sphinx->host, intval($configuration->sphinx->port));
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
$this->sphinx->ResetFilters();
foreach($structure as $key => $valeur)

View File

@ -1,33 +0,0 @@
<?php
define('MYSQL_HOST', '192.168.78.230');
define('MYSQL_USER', 'sphinx');
define('MYSQL_PASS', 'indexer');
define('MYSQL_DEFAULT_DB', 'jo');
Class ConfigurationGenerique
{
public static $debug = true;
public static $redevance_insee = 3.295;
public static $api = '2.0.2';
public function __construct(){set_limit(0);}
}
Class ConfigurationCiblage extends ConfigurationGenerique
{
public static $index = 'ciblage';
public static $nb_results = 5000;
public static $max_results = 500000;
public static $mysql_host = MYSQL_HOST;
public static $mysql_user = MYSQL_USER;
public static $mysql_password = MYSQL_PASS;
public static $mysql_database = MYSQL_DEFAULT_DB;
public static $sphinx_host = '192.168.78.252';
public static $sphinx_port = 3312;
public static $sphinx_match = SPH_MATCH_EXTENDED2;
public static $sphinx_sort = SPH_SORT_EXTENDED;
}