mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
FIX Implement correct namespace for PostgreSQL and add to Travis matrix
This commit is contained in:
parent
8deccf0882
commit
e47ab9c07d
@ -9,7 +9,7 @@ matrix:
|
|||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
|
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
|
||||||
- php: 7.0
|
- php: 7.0
|
||||||
env: DB=MYSQL PHPUNIT_TEST=1
|
env: DB=PGSQL PHPUNIT_TEST=1
|
||||||
- php: 7.1
|
- php: 7.1
|
||||||
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
|
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
|
||||||
- php: 7.1
|
- php: 7.1
|
||||||
@ -24,6 +24,7 @@ before_script:
|
|||||||
- composer validate
|
- composer validate
|
||||||
- composer require --no-update symbiote/silverstripe-queuedjobs ^4.0
|
- composer require --no-update symbiote/silverstripe-queuedjobs ^4.0
|
||||||
- if [[ $SUBSITES ]]; then composer require --no-update silverstripe/subsites 2.0.x-dev; fi
|
- if [[ $SUBSITES ]]; then composer require --no-update silverstripe/subsites 2.0.x-dev; fi
|
||||||
|
- if [[ $DB == "PGSQL" ]]; then composer require --no-update silverstripe/postgresql 2.0.x-dev; fi
|
||||||
- composer require --no-update silverstripe/installer 4.0.x-dev
|
- composer require --no-update silverstripe/installer 4.0.x-dev
|
||||||
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
|
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
|
||||||
|
|
||||||
|
@ -5,13 +5,12 @@ namespace SilverStripe\FullTextSearch\Captures;
|
|||||||
use SilverStripe\PostgreSQL\PostgreSQLDatabase;
|
use SilverStripe\PostgreSQL\PostgreSQLDatabase;
|
||||||
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
|
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
|
||||||
|
|
||||||
if (!class_exists('PostgreSQLDatabase')) {
|
if (!class_exists(PostgreSQLDatabase::class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SearchManipulateCapture_PostgreSQLDatabase extends PostgreSQLDatabase
|
class SearchManipulateCapture_PostgreSQLDatabase extends PostgreSQLDatabase
|
||||||
{
|
{
|
||||||
|
|
||||||
public $isManipulationCapture = true;
|
public $isManipulationCapture = true;
|
||||||
|
|
||||||
public function manipulate($manipulation)
|
public function manipulate($manipulation)
|
||||||
|
@ -5,6 +5,7 @@ namespace SilverStripe\FullTextSearch\Search\Updaters;
|
|||||||
use SilverStripe\Core\Config\Configurable;
|
use SilverStripe\Core\Config\Configurable;
|
||||||
use SilverStripe\Core\Injector\Injector;
|
use SilverStripe\Core\Injector\Injector;
|
||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
|
use SilverStripe\ORM\Connect\Database;
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
use SilverStripe\ORM\DB;
|
use SilverStripe\ORM\DB;
|
||||||
use SilverStripe\FullTextSearch\Search\FullTextSearch;
|
use SilverStripe\FullTextSearch\Search\FullTextSearch;
|
||||||
@ -43,10 +44,7 @@ class SearchUpdater
|
|||||||
*/
|
*/
|
||||||
public static function bind_manipulation_capture()
|
public static function bind_manipulation_capture()
|
||||||
{
|
{
|
||||||
global $databaseConfig;
|
|
||||||
|
|
||||||
$current = DB::get_conn();
|
$current = DB::get_conn();
|
||||||
|
|
||||||
if (!$current || !$current->getSelectedDatabase() || @$current->isManipulationCapture) {
|
if (!$current || !$current->getSelectedDatabase() || @$current->isManipulationCapture) {
|
||||||
return;
|
return;
|
||||||
} // If not yet set, or its already captured, just return
|
} // If not yet set, or its already captured, just return
|
||||||
@ -59,8 +57,8 @@ class SearchUpdater
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var SS_Database $captured */
|
/** @var Database $captured */
|
||||||
$captured = new $dbClass($databaseConfig);
|
$captured = new $dbClass();
|
||||||
|
|
||||||
$captured->setConnector($current->getConnector());
|
$captured->setConnector($current->getConnector());
|
||||||
$captured->setQueryBuilder($current->getQueryBuilder());
|
$captured->setQueryBuilder($current->getQueryBuilder());
|
||||||
|
Loading…
Reference in New Issue
Block a user