Skip to content

Commit

Permalink
Moved Mongodb and Solr to their own extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Geolim4 committed Jan 7, 2024
1 parent 11281ff commit 67602ba
Show file tree
Hide file tree
Showing 21 changed files with 34 additions and 1,477 deletions.
6 changes: 5 additions & 1 deletion .github/ISSUE_TEMPLATE/bug-report-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ body:
attributes:
label: Which extension is this issue about ?
options:
- Arangodb
- Couchbasev4
- Couchdb
- Mongodb
- Solr
validations:
required: true
- type: dropdown
Expand Down Expand Up @@ -68,7 +72,7 @@ body:
The connector and/or SDK version + the database version if applicable, ex:
- Couchbase 7.1.0 + PECL Extension 3.2.2
- Redis 7.0.0 + PECL Extension 5.3.7
- MongoDB 5.0.2 Community + mongodb/mongodb
- MongoDB 5.0.2 Community + mongodb/mongodb version x.x.x
- etc
**Be as much detailed as you can be !**
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/testsv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Phpfastcache Tests
on: [push, pull_request]
jobs:
run:
environment: github-ci
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 60
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
build:
dependencies:
override:
- "composer require -W --ignore-platform-reqs phpfastcache/phpssdb:~1.1 predis/predis:~1.1 mongodb/mongodb:~1.9 aws/aws-sdk-php:~3.2 google/cloud-firestore:~1.20 solarium/solarium:~6.1"
- "composer require -W --ignore-platform-reqs phpfastcache/phpssdb:~1.1 predis/predis:~1.1 aws/aws-sdk-php:~3.2 google/cloud-firestore:~1.20 solarium/solarium:~6.1"
nodes:
analysis:
project_setup:
Expand Down
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ language: php
services:
- memcached
- redis
- mongodb
- docker
cache:
directories:
- $HOME/pecl_cache
Expand All @@ -40,15 +38,12 @@ before_install:
- phpenv config-rm xdebug.ini
- composer install
- composer require phwoolcon/ci-pecl-cacher -n
- "./bin/ci/scripts/install_solr.sh || echo \"Solr install failed\""
- "./bin/ci/scripts/install_ssdb.sh || echo \"SSDB install failed\""
- "./bin/ci/scripts/install_couchbase.sh || echo \"Couchbase install failed\""
- "./bin/ci/scripts/setup_mongodb.sh || echo \"Setup Mongodb failed\""
- "./bin/ci/scripts/setup_gcp.sh || echo \"GCP setup failed\""
- "pecl channel-update pecl.php.net || echo \"PECL Channel update failed\""
# - yes | pecl install -f grpc-stable | grep -v --line-buffered "/tmp/pear/install/grpc"; # This pecl install is partially muted due to too much output written
- "yes | ./vendor/bin/ci-pecl-install grpc | grep -v --line-buffered \"/tmp/pear/install/grpc\" || echo \"PECL GRPC install failed\""
#- "yes | (./vendor/bin/ci-pecl-install mongodb) || echo \"PECL Mongodb install failed\"" # Mongodb seems to be provided In Bionic: https://docs.travis-ci.com/user/reference/bionic/#php-support
# - "yes | ./vendor/bin/ci-pecl-install apcu || echo \"PECL Apcu install failed\"" # Apcu seems to be provided In Bionic: https://docs.travis-ci.com/user/reference/bionic/#php-support
- "yes | ./vendor/bin/ci-pecl-install memcache || echo \"PECL Memcache install failed\""
- "yes | ./vendor/bin/ci-pecl-install memcached || echo \"PECL Memcached install failed\""
Expand Down
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
- __API__
- Upgraded Phpfastcache API to `4.3.0` ([see changes](CHANGELOG_API.md))
- __Extensions__ (💡 New in 9.2)
- Created an extension mechanism to allow future driver to be loaded independently, see [README.md](README.md)
- Created first extension for `Couchbasev4` support which will be moved to a [sub-repository](https://github.com/PHPSocialNetwork/couchbasev4-extension).
- **IMPORTANT**: *AS OF V10* the following drivers will be **MOVED** to their own sub-repositories as a standalone extension: `Arangodb`, `Couchdb`, `Cassandra`, `Dynamodb`, `Firestore`, `Mongodb`, `Solr`. However `Couchbasev3` will stay in the core for compatibility reasons but will be deprecated.
- Created an extension mechanism to allow some drivers to be loaded independently, see [README.md](README.md)
- Created extension for `Couchbasev4` support to its own [sub-repository](https://github.com/PHPSocialNetwork/couchbasev4-extension).
- **IMPORTANT**: *AS OF v9.2* the following drivers has been **MOVED** to their own sub-repositories as a standalone extension: `Arangodb`, `Couchdb`, `Cassandra`, `Dynamodb`, `Firestore`, `Mongodb`, `Solr`. However `Couchbasev3` will stay in the core for compatibility reasons but will be deprecated.
- **IMPORTANT**: *AS OF v10* extensions will have their namespaces permanently moved from `Phpfastcache\Drivers\EXT_NAME\{Config, Driver, Event, Item}` to `Phpfastcache\Extensions\Drivers\EXT_NAME\{Config, Driver, Event, Item}`. For now an alias is ensuring compatibility.
- __Events__
- EventManager is now scoped to its own poll if retrieved through `ExtendedCacheItemPoolTrait::->getEventManager()`. Global EventManager `EventManager::getInstance()` remains unchanged, see [EVENTS.md](./docs/EVENTS.md).
- `EventManagerInterface::on()` now also accepts a single `string $events`.
Expand Down
1 change: 1 addition & 0 deletions EXTENSIONS.MD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The 9.2 make the beginning of a new external extensions:
- `Dynamodb`
- `Firestore`
- `Mongodb`
- `Solr`

There's only 2 steps:

Expand Down
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,28 @@ The simplicity of abstraction: One class for many backend cache. You don't need
### Supported drivers at this day *
:bulb: Feel free to propose a driver by making a new **[Pull Request](https://github.com/PHPSocialNetwork/phpfastcache/compare)**, they are welcome !

| Regular drivers | High performances drivers | Development drivers | Cluster-Aggregated drivers |
|------------------------------------------------------------------------|------------------------------------------------------------------------------------------|--------------------------------------------|---------------------------------|
| `Apcu` <br>_(APC support removed)_ | `Arangodb` | `Devnull` | `FullReplicationCluster` |
| `Dynamodb` (AWS) | `Cassandra` | `Devrandom` | `SemiReplicationCluster` |
| `Files` | `CouchBasev3`<br>_(Will be deprecated as of v10)_ | `Memory`<br>(Previously named `Memstatic`) | `MasterSlaveReplicationCluster` |
| `Firestore` (GCP) | `CouchBasev4` _([Extension](https://github.com/PHPSocialNetwork/couchbasev4-extension))_ | | `RandomReplicationCluster` |
| `Leveldb` | `Couchdb` | | |
| `Memcache(d)` | `Mongodb` | | |
| `Solr` _(Via [Solarium 6.x](https://github.com/solariumphp/solarium))_ | `Predis` | | |
| `Sqlite` | `Redis`/`RedisCluster` | | |
| `Wincache` <br>(Deprecated as of v9.2, will be removed as of v10) | `Ssdb` | | |
| `Zend Disk Cache` | `Zend Memory Cache` | | |
| | | | | | | | |
| Regular drivers | High performances drivers | Development drivers _(Core)_ | Cluster-Aggregated drivers _(Core)_ |
|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|--------------------------------------------|---------------------------------------|
| `Apcu` _(Core)_ <br>_(APC support removed)_ | `Arangodb` _([Extension](https://github.com/PHPSocialNetwork/arangodb-extension))_ | `Devnull` | `FullReplicationCluster` |
| `Dynamodb` (AWS) | `Cassandra` | `Devrandom` | `SemiReplicationCluster` |
| `Files` _(Core)_ | `CouchBasev3` _(Core)_<br>_(Will be deprecated as of v10)_ | `Memory`<br>(Previously named `Memstatic`) | `MasterSlaveReplicationCluster` |
| `Firestore` (GCP) | `CouchBasev4` _([Extension](https://github.com/PHPSocialNetwork/couchbasev4-extension))_ | | `RandomReplicationCluster` |
| `Leveldb` _(Core)_ | `Couchdb` _([Extension](https://github.com/PHPSocialNetwork/couchdb-extension))_ | | |
| `Memcache(d)` _(Core)_ | `Mongodb` _([Extension](https://github.com/PHPSocialNetwork/mongodb-extension))_ | | |
| `Solr` _([Extension](https://github.com/PHPSocialNetwork/solr-extension))_ | `Predis` _(Core)_ | | |
| `Sqlite` _(Core)_ | `Redis`/`RedisCluster` _(Core)_ | | |
| `Wincache` _(Core)_ <br>(**Deprecated** as of v9.2, will be removed as of v10) | `Ssdb` _(Core)_ | | |
| `Zend Disk Cache` _(Core)_ | `Zend Memory Cache` _(Core)_ | | |
| | | | |

\* Driver descriptions available in [DOCS/DRIVERS.md](./docs/DRIVERS.md)

:new: As of v9.2 the first extension has been released: [Couchbasev4](https://github.com/PHPSocialNetwork/couchbasev4-extension)
:new: As of v9.2 a new Couchbase extension has been released: [Couchbasev4](https://github.com/PHPSocialNetwork/couchbasev4-extension)

This new extension **is the beginning of a new era** for Phpfastcache:\
As of the v10 many drivers will be moved from the core to their own sub-repository as a standalone extension: `Arangodb`, `Couchdb`, `Cassandra`, `Dynamodb`, `Firestore`, `Mongodb`, `Solr`.\
However `Couchbasev3` will stay in the core for compatibility reasons but will be deprecated.
This new extension **is the beginning of a new era** for Phpfastcache along with some others:\
Many drivers has been moved from the core to their own sub-repository as a standalone extension: `Arangodb`, `Couchdb`, `Cassandra`, `Dynamodb`, `Firestore`, `Mongodb`, `Solr`.\
They can be easily added through composer, ex: `composer install phpfastcache/couchbasev4-extension`
However `Couchbasev3` **will stay in the core** for compatibility reasons but will be deprecated.

---------------------------
Because caching does not mean weaken your code
Expand Down
2 changes: 1 addition & 1 deletion bin/ci/scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ composer install
#####
# Travis CI have php mongodb extension locked to 1.10, so we must set the mongodb/mongodb minimum version to 1.9 :(
#####
composer require -W phpfastcache/phpssdb:~1.2 predis/predis:~1.1 mongodb/mongodb:~1.9 triagens/arangodb:~3.8 aws/aws-sdk-php:~3.2 google/cloud-firestore:~1.39 solarium/solarium:~6.1
composer require -W phpfastcache/phpssdb:~1.2 predis/predis:~1.1 mongodb/mongodb:~1.9 aws/aws-sdk-php:~3.2 google/cloud-firestore:~1.39
55 changes: 0 additions & 55 deletions bin/ci/scripts/install_solr.sh

This file was deleted.

4 changes: 0 additions & 4 deletions bin/ci/scripts/setup_mongodb.sh

This file was deleted.

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"google/cloud-firestore": "^1.20",
"aws/aws-sdk-php": "~3.0",
"phpfastcache/arangodb-extension": "^9.2",
"phpfastcache/couchdb-extension": "^9.2"
"phpfastcache/couchdb-extension": "^9.2",
"phpfastcache/solr-extension": "^9.2"
},
"conflict": {
"solarium/solarium": "<6.1"
Expand Down
10 changes: 1 addition & 9 deletions docs/EVENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,4 @@ See [Couchdb extension event documentation](https://github.com/PHPSocialNetwork/
- **Risky Circular Methods**: None

#### Solr
- onSolrBuildEndpoint(*Callable* **$callback**)
- **Callback arguments**
- *ExtendedCacheItemPoolInterface* **$itemPool**
- *EventReferenceParameter($params)* **$endpoints** _via EventReferenceParameter object_ **(type modification forbidden)**
- **Scope**
- Solr Driver
- **Description**
- Allow you to alter the endpoints built used to connect to Solr server
- **Risky Circular Methods**: None
See [Solr extension event documentation](https://github.com/PHPSocialNetwork/solr-extension#events).
Loading

0 comments on commit 67602ba

Please sign in to comment.