File tree Expand file tree Collapse file tree
lib/Phpfastcache/Drivers/Solr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ before_install:
3737 # - ./bin/ci/scripts/install_arangodb.sh;
3838 - composer install
3939 - composer require phwoolcon/ci-pecl-cacher -n
40+ - " ./bin/ci/scripts/install_solr.sh || echo \" Solr install failed\" "
4041 - " ./bin/ci/scripts/install_arangodb.sh || echo \" Arangodb install failed\" "
4142 - " ./bin/ci/scripts/install_ssdb.sh || echo \" SSDB install failed\" "
4243 - " ./bin/ci/scripts/install_couchdb.sh || echo \" Couchdb install failed\" "
Original file line number Diff line number Diff line change 1+ curl -sSL https://raw.githubusercontent.com/PHPSocialNetwork/travis-solr/master/travis-solr.sh | SOLR_COLLECTION=phpfastcache SOLR_VERSION=8.11.1 bash
Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ class Config extends ConfigurationOption
3838
3939 protected int $ port = 8983 ;
4040
41- protected string $ coreName = '' ;
41+ protected string $ coreName = 'phpfastcache ' ;
42+
43+ protected string $ endpointName = 'phpfastcache ' ;
4244
4345 protected string $ scheme = 'http ' ;
4446
@@ -194,4 +196,24 @@ public function setMappingSchema(array $mappingSchema): Config
194196 $ this ->mappingSchema = $ mappingSchema ;
195197 return $ this ;
196198 }
199+
200+ /**
201+ * @return string
202+ */
203+ public function getEndpointName (): string
204+ {
205+ return $ this ->endpointName ;
206+ }
207+
208+ /**
209+ * @param string $endpointName
210+ * @return Config
211+ * @throws PhpfastcacheLogicException
212+ */
213+ public function setEndpointName (string $ endpointName ): Config
214+ {
215+ $ this ->enforceLockedProperty (__FUNCTION__ );
216+ $ this ->endpointName = $ endpointName ;
217+ return $ this ;
218+ }
197219}
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ protected function driverConnect(): bool
6060 $ this ->mappingSchema = $ this ->getConfig ()->getMappingSchema ();
6161 $ this ->instance = new SolariumClient (new SolariumCurlAdapter (), $ this ->getConfig ()->getEventDispatcher (), [
6262 'endpoint ' => [
63- ' phpfastcache ' => [
63+ $ this -> getConfig ()-> getEndpointName () => [
6464 'scheme ' => $ this ->getConfig ()->getScheme (),
6565 'host ' => $ this ->getConfig ()->getHost (),
6666 'port ' => $ this ->getConfig ()->getPort (),
@@ -73,7 +73,7 @@ protected function driverConnect(): bool
7373 try {
7474 $ this ->instance ->ping ($ this ->instance ->createPing ());
7575 } catch (SolariumExceptionInterface $ e ) {
76- throw new PhpfastcacheDriverConnectException (' Failed to connect to Solr server with the following error: ' . $ e ->getMessage (), 0 , $ e );
76+ throw new PhpfastcacheDriverConnectException ($ e ->getMessage (), 0 , $ e );
7777 }
7878
7979 return false ;
You can’t perform that action at this time.
0 commit comments