diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a839255 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..e5a21f6 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,37 @@ +name: PHP Composer + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + # - name: Run test suite + # run: composer run-script test diff --git a/README.md b/README.md index 9d6c7cc..e4edb86 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,22 @@ -# Vdlp.Hashids - -Hashids is a small open-source library that generates short, unique, non-sequential ids from numbers. +

+ +

Vdlp.Hashids

+

+ +

+ Allows developers to use secure hashed ID's. +

+ +

+ + + + + + +

+ +Fetches RSS/Atom feeds to put on your website. It can be automated using a cronjob or triggered manually. It converts numbers like 347 into strings like "yr8", or array of numbers like [27, 986] into "3kTMd". @@ -8,8 +24,8 @@ You can also decode those ids back. This is useful in bundling several parameter ## Requirements -* PHP 7.1 or higher -* Preferably one of the latest October CMS build +* PHP 7.2 or higher +* October CMS build 468 or higher ## Installation @@ -28,7 +44,7 @@ Go to Settings > Updates & Plugins > Install plugins and search for 'Hashids'. To configure this plugin execute the following command: ``` -php artisan vendor:publish --provider="Vdlp\Hashids\ServiceProviders\HashidsServiceProvider" --tag="config" +php artisan vendor:publish --provider="Vdlp\Hashids\ServiceProvider" --tag="config" ``` This will create a `config/hashids.php` file in your app where you can modify the configuration. diff --git a/ServiceProvider.php b/ServiceProvider.php index 4ede677..5861955 100644 --- a/ServiceProvider.php +++ b/ServiceProvider.php @@ -12,9 +12,6 @@ class ServiceProvider extends BaseServiceProvider { - /** - * @return void - */ public function boot(): void { $this->publishes([ @@ -24,9 +21,6 @@ public function boot(): void $this->mergeConfigFrom(__DIR__ . '/config.php', 'hashids'); } - /** - * @return void - */ public function register(): void { $this->app->singleton(HashidsFactory::class, static function (): HashidsFactory { diff --git a/composer.json b/composer.json index fe71561..b7c5d4b 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "vdlp/oc-hashids-plugin", "description": "Allows developers to use secure hashed ID's in October CMS powered websites.", "type": "october-plugin", - "license": "GPL-2.0", + "license": "GPL-2.0-only", "authors": [ { "name": "Van der Let & Partners", @@ -10,8 +10,8 @@ } ], "require": { - "php": ">=7.1", - "hashids/hashids": "^3.0" + "php": "^7.2", + "hashids/hashids": "^4.0" }, "archive": { "exclude": [ diff --git a/updates/version.yaml b/updates/version.yaml index 9220207..2140e52 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -3,3 +3,4 @@ 1.1.0: - Code optimizations - Moved service provider +2.0.0: Drop PHP 7.1 support