mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
NEW Update to use proxied DB instead of self-proxied
This commit is contained in:
parent
685148f6fb
commit
e7420a584d
@ -1,32 +1,6 @@
|
|||||||
---
|
---
|
||||||
Name: fulltextsearchmysql
|
Name: fulltextsearchproxydb
|
||||||
After:
|
|
||||||
- 'databaseconnectors'
|
|
||||||
---
|
---
|
||||||
SilverStripe\Core\Injector\Injector:
|
TractorCow\SilverStripeProxyDB\ProxyDBFactory:
|
||||||
MySQLDatabase:
|
extensions:
|
||||||
class: SilverStripe\FullTextSearch\Search\Captures\SearchManipulateCapture_MySQLDatabase
|
- SilverStripe\FullTextSearch\Search\Extensions\ProxyDBExtension
|
||||||
MySQLPDODatabase:
|
|
||||||
class: SilverStripe\FullTextSearch\Search\Captures\SearchManipulateCapture_MySQLDatabase
|
|
||||||
|
|
||||||
---
|
|
||||||
Name: fulltextsearchpostgresql
|
|
||||||
After:
|
|
||||||
- 'postgresqlconnectors'
|
|
||||||
---
|
|
||||||
SilverStripe\Core\Injector\Injector:
|
|
||||||
PostgrePDODatabase:
|
|
||||||
class: SilverStripe\FullTextSearch\Search\Captures\SearchManipulateCapture_PostgreSQLDatabase
|
|
||||||
PostgreSQLDatabase:
|
|
||||||
class: SilverStripe\FullTextSearch\Search\Captures\SearchManipulateCapture_PostgreSQLDatabase
|
|
||||||
|
|
||||||
---
|
|
||||||
Name: fulltextsearchsqlite
|
|
||||||
After:
|
|
||||||
- 'sqlite3connectors'
|
|
||||||
---
|
|
||||||
SilverStripe\Core\Injector\Injector:
|
|
||||||
SQLite3PDODatabase:
|
|
||||||
class: SilverStripe\FullTextSearch\Search\Captures\SearchManipulateCapture_SQLite3Database
|
|
||||||
SQLite3Database:
|
|
||||||
class: SilverStripe\FullTextSearch\Search\Captures\SearchManipulateCapture_SQLite3Database
|
|
||||||
|
@ -24,7 +24,8 @@
|
|||||||
"silverstripe/framework": "^4.0",
|
"silverstripe/framework": "^4.0",
|
||||||
"monolog/monolog": "~1.15",
|
"monolog/monolog": "~1.15",
|
||||||
"ptcinc/solr-php-client": "^1.0",
|
"ptcinc/solr-php-client": "^1.0",
|
||||||
"symfony/process": "^3.2"
|
"symfony/process": "^3.2",
|
||||||
|
"tractorcow/silverstripe-proxy-db" : "~0.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"silverstripe/cms": "^4.0",
|
"silverstripe/cms": "^4.0",
|
||||||
|
@ -5,6 +5,10 @@ namespace SilverStripe\FullTextSearch\Search\Captures;
|
|||||||
use SilverStripe\ORM\Connect\MySQLDatabase;
|
use SilverStripe\ORM\Connect\MySQLDatabase;
|
||||||
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
|
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 3.1...4.0 Please use tractorcow/silverstripe-proxy-db to proxy the database connector instead
|
||||||
|
*/
|
||||||
|
|
||||||
class SearchManipulateCapture_MySQLDatabase extends MySQLDatabase
|
class SearchManipulateCapture_MySQLDatabase extends MySQLDatabase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -9,6 +9,10 @@ if (!class_exists(PostgreSQLDatabase::class)) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 3.1...4.0 Please use tractorcow/silverstripe-proxy-db to proxy the database connector instead
|
||||||
|
*/
|
||||||
|
|
||||||
class SearchManipulateCapture_PostgreSQLDatabase extends PostgreSQLDatabase
|
class SearchManipulateCapture_PostgreSQLDatabase extends PostgreSQLDatabase
|
||||||
{
|
{
|
||||||
public $isManipulationCapture = true;
|
public $isManipulationCapture = true;
|
||||||
|
@ -9,6 +9,10 @@ if (!class_exists(SQLite3Database::class)) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 3.1...4.0 Please use tractorcow/silverstripe-proxy-db to proxy the database connector instead
|
||||||
|
*/
|
||||||
|
|
||||||
class SearchManipulateCapture_SQLite3Database extends SQLite3Database
|
class SearchManipulateCapture_SQLite3Database extends SQLite3Database
|
||||||
{
|
{
|
||||||
|
|
||||||
|
19
src/Search/Extensions/ProxyDBExtension.php
Normal file
19
src/Search/Extensions/ProxyDBExtension.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SilverStripe\FullTextSearch\Search\Extensions;
|
||||||
|
|
||||||
|
use SilverStripe\Core\Extension;
|
||||||
|
use TractorCow\ClassProxy\Generators\ProxyGenerator;
|
||||||
|
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
|
||||||
|
|
||||||
|
class ProxyDBExtension extends Extension
|
||||||
|
{
|
||||||
|
public function updateProxy(ProxyGenerator &$proxy)
|
||||||
|
{
|
||||||
|
$proxy = $proxy->addMethod('manipulate', function ($args, $next) {
|
||||||
|
$manipulation = $args[0];
|
||||||
|
SearchUpdater::handle_manipulation($manipulation);
|
||||||
|
return $next(...$args);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user