FIX Implement correct namespace for PostgreSQL and add to Travis matrix

This commit is contained in:
Robbie Averill 2017-11-30 14:43:17 +13:00
parent 8deccf0882
commit e47ab9c07d
3 changed files with 6 additions and 8 deletions

View File

@ -9,7 +9,7 @@ matrix:
- php: 5.6
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
env: DB=MYSQL PHPUNIT_TEST=1
env: DB=PGSQL PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
- php: 7.1
@ -24,6 +24,7 @@ before_script:
- composer validate
- composer require --no-update symbiote/silverstripe-queuedjobs ^4.0
- 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 install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile

View File

@ -5,13 +5,12 @@ namespace SilverStripe\FullTextSearch\Captures;
use SilverStripe\PostgreSQL\PostgreSQLDatabase;
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
if (!class_exists('PostgreSQLDatabase')) {
if (!class_exists(PostgreSQLDatabase::class)) {
return;
}
class SearchManipulateCapture_PostgreSQLDatabase extends PostgreSQLDatabase
{
public $isManipulationCapture = true;
public function manipulate($manipulation)

View File

@ -5,6 +5,7 @@ namespace SilverStripe\FullTextSearch\Search\Updaters;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\ORM\Connect\Database;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DB;
use SilverStripe\FullTextSearch\Search\FullTextSearch;
@ -43,10 +44,7 @@ class SearchUpdater
*/
public static function bind_manipulation_capture()
{
global $databaseConfig;
$current = DB::get_conn();
if (!$current || !$current->getSelectedDatabase() || @$current->isManipulationCapture) {
return;
} // If not yet set, or its already captured, just return
@ -59,8 +57,8 @@ class SearchUpdater
return;
}
/** @var SS_Database $captured */
$captured = new $dbClass($databaseConfig);
/** @var Database $captured */
$captured = new $dbClass();
$captured->setConnector($current->getConnector());
$captured->setQueryBuilder($current->getQueryBuilder());