Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit bca4fad

Browse files
1.7.1
* [*] changed behaviour
1 parent 0a3c4d7 commit bca4fad

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

interfaces/SphinxToolkitFoolzInterface.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Arris\Toolkit;
44

55
use Closure;
6+
use Foolz\SphinxQL\Drivers\ConnectionInterface;
67
use Foolz\SphinxQL\Drivers\ResultSetInterface;
78
use Foolz\SphinxQL\Exception\ConnectionException;
89
use Foolz\SphinxQL\Exception\DatabaseException;
@@ -30,6 +31,8 @@ public static function init(string $sphinx_connection_host, string $sphinx_conne
3031

3132
/**
3233
* Создает коннекшен и устанавливает параметры подключения: хост и порт
34+
*
35+
* @return ConnectionInterface
3336
*/
3437
public static function initConnection();
3538

@@ -121,13 +124,14 @@ public static function rt_TruncateIndex(string $index_name, bool $is_reconfigure
121124
* @throws SphinxQLException
122125
*/
123126
public static function rt_RebuildAbstractIndex(PDO $pdo_connection, string $sql_source_table, string $sphinx_index, Closure $make_updateset_method, string $condition = '');
124-
127+
125128
/**
126129
* Создает инстанс на основе сохраненного в классе коннекшена
127130
*
131+
* @param ConnectionInterface $connection
128132
* @return SphinxQL
129133
*/
130-
public static function getInstance();
134+
public static function getInstance($connection);
131135

132136
/**
133137
* Возвращает META-информацию (после запроса)

src/SphinxToolkit.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ public static function initConnection()
373373
/**
374374
* @inheritDoc
375375
*/
376-
public static function getInstance()
376+
public static function getInstance($connection)
377377
{
378-
return (new SphinxQL(self::$spql_connection));
378+
return (new SphinxQL($connection));
379379
}
380380

381381
/**
@@ -384,7 +384,7 @@ public static function getInstance()
384384
public static function createInstance()
385385
{
386386
self::$spql_connection = self::initConnection();
387-
self::$spql_instance = self::getInstance();
387+
self::$spql_instance = self::getInstance(self::$spql_connection);
388388

389389
return self::$spql_instance;
390390
}
@@ -523,7 +523,7 @@ public static function rt_RebuildAbstractIndex(PDO $pdo_connection, string $sql_
523523

524524
public static function showMeta()
525525
{
526-
(new Helper(self::$spql_connection))->showMeta()->execute()->fetchAllAssoc();
526+
return (new Helper(self::$spql_connection))->showMeta()->execute()->fetchAllAssoc();
527527
}
528528

529529
/**

0 commit comments

Comments
 (0)