Skip to content

Commit

Permalink
Moved Dynamodb and Firestore 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 67602ba commit 000d16d
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 1,243 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/testsv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
php-versions: ['8.0', '8.1', '8.2', '8.3']
name: PHP ${{ matrix.php-versions }} quality/tests on ${{ matrix.operating-system }}
env:
extensions: mbstring, intl, pdo_sqlite, json, redis, grpc, couchbase-3.2.2
extensions: mbstring, intl, pdo_sqlite, json, redis, couchbase-3.2.2
key: cache-v1
steps:
- name: Checkout
Expand Down Expand Up @@ -63,22 +63,11 @@ jobs:
restore-keys: |
${{ runner.os }}-php-
- name: Setup GCP environment
run: "./bin/ci/scripts/setup_gcp.sh || echo \"GCP setup failed (maybe due to fork limitation)\""
env:
BASE64_GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.BASE64_GOOGLE_APPLICATION_CREDENTIALS }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}

- name: Install dependencies
run: ./bin/ci/scripts/install_dependencies.sh

- name: Run quality tools
run: composer run-script quality

- name: Run tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
run: composer run-script tests
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ jobs:
before_install:
- sudo apt remove cmake
- pip install cmake --upgrade
# Memcached is not yet available for PHP8 (hasn't been updated since 2019): https://pecl.php.net/package/memcached
# Memcache however seems to be compatible with PHP 7 and 8: https://pecl.php.net/package/memcache
#
# - ./bin/ci/scripts/install_arangodb.sh;
- phpenv config-add bin/ci/php_common.ini
- phpenv config-rm xdebug.ini
- composer install
Expand All @@ -42,14 +38,11 @@ before_install:
- "./bin/ci/scripts/install_couchbase.sh || echo \"Couchbase install 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 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\""
- "yes | ./vendor/bin/ci-pecl-install couchbase-3.2.2 couchbase || echo \"PECL Couchbase install failed\"" # @todo UPGRADE TO COUCHBASE 4.x.x once we upgraded from Bionic to Focal
install:
- "[[ $TRAVIS_PHP_VERSION != \"nightly\" ]] && ./bin/ci/scripts/install_dependencies.sh || ./bin/ci/scripts/install_dependencies_lite.sh"
- ./bin/ci/scripts/install_dependencies.sh

script:
- composer run-script quality
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- __Extensions__ (💡 New in 9.2)
- 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 v9.2* the following drivers has been **MOVED** to their own sub-repositories as a standalone extension: `Arangodb`, `Couchdb`, `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).
Expand Down
1 change: 0 additions & 1 deletion EXTENSIONS.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ The 9.2 make the beginning of a new external extensions:
- `Arangodb`
- `Couchbasev4`
- `Couchdb`
- `Cassandra`
- `Dynamodb`
- `Firestore`
- `Mongodb`
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ 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 _(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)_ | | |
| | | | |
| 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` _([Extension](https://github.com/PHPSocialNetwork/dynamodb-extension))_ | `Cassandra` <br> _(PHP extension is no more maintained by Datastax, might be deprecated in v10)_ | `Devrandom` | `SemiReplicationCluster` |
| `Files` _(Core)_ | `CouchBasev3` _(Core)_<br>_(Will be deprecated as of v10)_ | `Memory`<br>(Previously named `Memstatic`) | `MasterSlaveReplicationCluster` |
| `Firestore` _([Extension](https://github.com/PHPSocialNetwork/firestore-extension))_ | `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 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 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`.\
Many drivers has been moved from the core to their own sub-repository as a standalone extension: `Arangodb`, `Couchdb`, `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.

Expand Down
5 changes: 1 addition & 4 deletions bin/ci/scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
composer self-update
composer validate
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 aws/aws-sdk-php:~3.2 google/cloud-firestore:~1.39
composer require -W phpfastcache/phpssdb:~1.2 predis/predis:~1.1
5 changes: 0 additions & 5 deletions bin/ci/scripts/install_dependencies_lite.sh

This file was deleted.

7 changes: 0 additions & 7 deletions bin/ci/scripts/setup_gcp.sh

This file was deleted.

17 changes: 6 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"ext-gettext": "*",
"phpmd/phpmd": "@stable",
"squizlabs/php_codesniffer": "@stable",
"phpstan/phpstan": "^1.5",
"phpstan/phpstan": "@stable",
"jetbrains/phpstorm-stubs": "dev-master",
"phpfastcache/phpfastcache-devtools": "^9.2"
},
Expand All @@ -45,25 +45,20 @@
"ext-intl": "*",
"ext-memcached": "*",
"ext-cassandra": "*",
"ext-grpc": "*",
"ext-memcache": "*",
"ext-mongodb": "*",
"ext-redis": "*",
"ext-xcache": "*",
"ext-sqlite": "*",
"ext-wincache": "*",
"ext-leveldb": "*",
"ext-couchbase": "*",
"ext-couchbase_v3": "*",
"ext-couchbase": "^3.0",
"predis/predis": "^1.1",
"mongodb/mongodb": "^1.9",
"phpfastcache/phpssdb": "~1.1.0",
"solarium/solarium": "~6.1",
"doctrine/couchdb": "^dev-master#9eeb9e5",
"google/cloud-firestore": "^1.20",
"aws/aws-sdk-php": "~3.0",
"phpfastcache/arangodb-extension": "^9.2",
"phpfastcache/couchbasev4-extension": "^9.2",
"phpfastcache/couchdb-extension": "^9.2",
"phpfastcache/dynamodb-extension": "^9.2",
"phpfastcache/firestore-extension": "^9.2",
"phpfastcache/mongodb-extension": "^9.2",
"phpfastcache/solr-extension": "^9.2"
},
"conflict": {
Expand Down
7 changes: 7 additions & 0 deletions docs/DRIVERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
* The Alternative Php User Cache (APCU) driver. A memory cache for regular performances.
* Arangodb **(Added in v9)**
* A very high-performance NoSQL driver using a key-value pair system.
* :new: Is now a composer extension separated from the Phpfastcache core as of v9.2: `phpfastcache/arangodb-extension`
* Cassandra
* A very high-performance NoSQL driver using a key-value pair system. Please note that the Driver rely on php's Datastax extension: https://github.com/datastax/php-driver
* As of PHP an unofficial fork has been launched due to Datastax lack of maintenance: https://github.com/he4rt/scylladb-php-driver
* Cookie **(REMOVED in v9)**
* A cookie driver to store non-sensitive scalar (only) data. Limited storage up to 4Ko.
* Couchbase **(REMOVED in v9)**
Expand All @@ -19,6 +21,7 @@
* :new: It is now a [separated extension](https://github.com/PHPSocialNetwork/couchbasev4-extension) which is no longer part of the Phpfastcache's core.
* Couchdb
* A very high-performance NoSQL driver using a key-value pair system.
* :new: Is now a composer extension separated from the Phpfastcache core as of v9.2: `phpfastcache/couchdb-extension`
* Devfalse **(REMOVED in v9)**
* A development driver that return false for everything except driverCheck().
* Devnull
Expand All @@ -29,10 +32,12 @@
* A development driver with configurable factor chance and data length.
* Dynamodb **(Added in v9)**
* An AWS cloud NoSQL driver using a key-value pair system. Be careful when flushing the table as it will delete and recreate the table due to a Dynamodb limitation.
* :new: Is now a composer extension separated from the Phpfastcache core as of v9.2: `phpfastcache/dynamodb-extension`
* Files
* A file driver that use serialization for storing data for regular performances. A _$path_ config must be specified, else the system temporary directory will be used.
* Firestore **(Added in v9)**
* A GCP cloud NoSQL driver using a key-value pair system. Collections are created automatically on-the-fly.
* :new: Is now a composer extension separated from the Phpfastcache core as of v9.2: `phpfastcache/firestore-extension`
* Leveldb
* A NoSQL driver using a key-value pair system. A _$path_ config must be specified, else the system temporary directory will be used.
* Memcache
Expand All @@ -43,6 +48,7 @@
* The Memstatic driver is a memory static driver that expires when the script execution ends.
* Mongodb
* A very high-performance NoSQL driver using a key-value pair system.
* :new: Is now a composer extension separated from the Phpfastcache core as of v9.2: `phpfastcache/mongodb-extension`
* Predis
* A high-performance memory driver using a in-memory data structure storage. Less efficient than Redis driver as it is an embedded library.
* Redis/Rediscluster
Expand All @@ -52,6 +58,7 @@
* A very high-performance NoSQL driver using a key-value pair system.
* Solr **(Added in v9.1)**
* A Solr driver that use Solarium as PHP client for good performances.
* :new: Is now a composer extension separated from the Phpfastcache core as of v9.2: `phpfastcache/solr-extension`
* Sqlite
* A Sqlite driver that use serialization for storing data for regular performances. A _$path_ config must be specified, else the system temporary directory will be used.
* Ssdb
Expand Down
10 changes: 1 addition & 9 deletions docs/EVENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,7 @@ See [Arangodb extension event documentation](https://github.com/PHPSocialNetwork
See [Couchdb extension event documentation](https://github.com/PHPSocialNetwork/couchdb-extension#events).

#### Dynamodb
- onDynamodbCreateTable(*Callable* **$callback**)
- **Callback arguments**
- *ExtendedCacheItemPoolInterface* **$itemPool**
- *EventReferenceParameter($params)* **$params** _via EventReferenceParameter object_ **(type modification forbidden)**
- **Scope**
- Dynamodb Driver
- **Description**
- Allow you to alter the parameters built used to create the table
- **Risky Circular Methods**: None
See [Dynamodb extension event documentation](https://github.com/PHPSocialNetwork/dynamodb-extension#events).

#### Solr
See [Solr extension event documentation](https://github.com/PHPSocialNetwork/solr-extension#events).
Loading

0 comments on commit 000d16d

Please sign in to comment.