Skip to content

Commit

Permalink
1.7.1
Browse files Browse the repository at this point in the history
* [*] changed behaviour
  • Loading branch information
KarelWintersky committed Nov 7, 2020
1 parent 0a3c4d7 commit bca4fad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions interfaces/SphinxToolkitFoolzInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Arris\Toolkit;

use Closure;
use Foolz\SphinxQL\Drivers\ConnectionInterface;
use Foolz\SphinxQL\Drivers\ResultSetInterface;
use Foolz\SphinxQL\Exception\ConnectionException;
use Foolz\SphinxQL\Exception\DatabaseException;
Expand Down Expand Up @@ -30,6 +31,8 @@ public static function init(string $sphinx_connection_host, string $sphinx_conne

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

Expand Down Expand Up @@ -121,13 +124,14 @@ public static function rt_TruncateIndex(string $index_name, bool $is_reconfigure
* @throws SphinxQLException
*/
public static function rt_RebuildAbstractIndex(PDO $pdo_connection, string $sql_source_table, string $sphinx_index, Closure $make_updateset_method, string $condition = '');

/**
* Создает инстанс на основе сохраненного в классе коннекшена
*
* @param ConnectionInterface $connection
* @return SphinxQL
*/
public static function getInstance();
public static function getInstance($connection);

/**
* Возвращает META-информацию (после запроса)
Expand Down
8 changes: 4 additions & 4 deletions src/SphinxToolkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ public static function initConnection()
/**
* @inheritDoc
*/
public static function getInstance()
public static function getInstance($connection)
{
return (new SphinxQL(self::$spql_connection));
return (new SphinxQL($connection));
}

/**
Expand All @@ -384,7 +384,7 @@ public static function getInstance()
public static function createInstance()
{
self::$spql_connection = self::initConnection();
self::$spql_instance = self::getInstance();
self::$spql_instance = self::getInstance(self::$spql_connection);

return self::$spql_instance;
}
Expand Down Expand Up @@ -523,7 +523,7 @@ public static function rt_RebuildAbstractIndex(PDO $pdo_connection, string $sql_

public static function showMeta()
{
(new Helper(self::$spql_connection))->showMeta()->execute()->fetchAllAssoc();
return (new Helper(self::$spql_connection))->showMeta()->execute()->fetchAllAssoc();
}

/**
Expand Down

0 comments on commit bca4fad

Please sign in to comment.