Cleanup namepaces, variables uses

This commit is contained in:
Romain Neutron
2012-09-28 16:06:28 +02:00
parent 372861deb4
commit 1700565862
232 changed files with 593 additions and 1446 deletions

View File

@@ -10,7 +10,6 @@
*/
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Configuration;
/**
*
@@ -362,8 +361,6 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
*/
protected function query()
{
$registry = $this->app['phraseanet.registry'];
$dateLog = date("Y-m-d H:i:s");
$nbanswers = 0;
@@ -408,7 +405,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
, $sbas_id
, $this->colls[$sbas_id]
, $this->arrayq[$sbas_id]
, $registry->get('GV_sit')
, $this->app['phraseanet.registry']->get('GV_sit')
, (string) $this->app['phraseanet.user']->get_id()
, false
, $this->opt_search_type == 1 ? PHRASEA_MULTIDOC_REGONLY : PHRASEA_MULTIDOC_DOCONLY

View File

@@ -1725,16 +1725,15 @@ class searchEngine_adapter_phrasea_queryParser
public function addsimple($t, $type, $nodetype, $pnum, $tree, $depth)
{
$nok = 0;
$registry = $this->app['phraseanet.registry'];
$w = $t["VALUE"];
if ($w != "?" && $w != "*") { // on laisse passer les 'isolés' pour les traiter plus tard comme des mots vides
for ($i = 0; $i < strlen($w); $i ++ ) {
$c = substr($w, $i, 1);
if ($c == "?" || $c == "*") {
if ($nok < $registry->get('GV_min_letters_truncation')) {
if ($nok < $this->app['phraseanet.registry']->get('GV_min_letters_truncation')) {
if ($this->errmsg != "")
$this->errmsg .= sprintf("\\n");
$this->errmsg .= _('qparser:: Formulation incorrecte, necessite plus de caractere : ') . "<br>" . $registry->get('GV_min_letters_truncation');
$this->errmsg .= _('qparser:: Formulation incorrecte, necessite plus de caractere : ') . "<br>" . $this->app['phraseanet.registry']->get('GV_min_letters_truncation');
return(null);
}

View File

@@ -11,7 +11,6 @@ require_once __DIR__ . '/../../../../vendor/sphinx/sphinxapi.php';
*/
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Configuration;
/**
*
@@ -59,12 +58,11 @@ class searchEngine_adapter_sphinx_engine extends searchEngine_adapter_abstract i
public function __construct(Application $app)
{
$this->app = $app;
$registry = $this->app['phraseanet.registry'];
$this->sphinx = new SphinxClient ();
$this->sphinx->SetArrayResult(true);
$this->sphinx->SetServer($registry->get('GV_sphinx_host'), (int) $registry->get('GV_sphinx_port'));
$this->sphinx->SetServer($this->app['phraseanet.registry']->get('GV_sphinx_host'), (int) $this->app['phraseanet.registry']->get('GV_sphinx_port'));
$this->sphinx->SetConnectTimeout(1);
return $this;