Skip to content

Commit

Permalink
chore: require gmp extension for library (#256)
Browse files Browse the repository at this point in the history
* chore: require gmp extension for library

---------

Signed-off-by: Alan Brault <alan.brault@visus.io>
  • Loading branch information
xaevik authored Dec 9, 2024
1 parent f5a3d48 commit 019e77d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 6,051 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/.github/ export-ignore
/.gitignore export-ignore
/build/ export-ignore
/composer.lock export-ignore
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
Expand Down
13 changes: 2 additions & 11 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
"php": "<8.2"
},
"timezone": "America/New_York",
"rangeStrategy": "update-lockfile",
"lockFileMaintenance": {
"automerge": true,
"enabled": true,
"schedule": [
"after 8:00am"
]
},
"packageRules": [
{
"automerge": true,
Expand All @@ -30,7 +22,7 @@
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch",
"labels": [
"dependencies"
"Dependencies: Minor-Patch"
],
"schedule": [
"after 8:00am"
Expand All @@ -45,8 +37,7 @@
"major"
],
"labels": [
"dependencies",
"breaking"
"Dependencies: Major (Breaking)"
],
"schedule": [
"after 8:00am on tuesday"
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ jobs:
php-version: '8.1'
tools: composer
extensions: :xdebug
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer
run: |
composer install --quiet --no-ansi --no-interaction --no-progress --prefer-dist
Expand All @@ -62,16 +52,6 @@ jobs:
php-version: '8.1'
tools: composer
coverage: xdebug
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer
run: |
composer install --quiet --no-ansi --no-interaction --no-progress --prefer-dist
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.idea/

# Composer
composer.lock
/vendor

# PHPUnit
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ A PHP implementation of collision-resistant ids. You can read more about CUIDs f

You can install visus/cuid2 as a [composer package](https://packagist.org/packages/visus/cuid2):

> [!IMPORTANT]
> The PHP extension [GMP](https://www.php.net/manual/en/intro.gmp.php) is required in order to use this library.
```shell
composer require visus/cuid2
```
Expand All @@ -31,12 +34,12 @@ require_once 'vendor/autoload.php';
$cuid = new Visus\Cuid2\Cuid2();

// implicit casting
echo $cuid; // hw8kkckkgwkk0oo0gkw0o8sg
echo $cuid; // apr5hhh4ox45krsg9gycbs9k

// explicit casting
echo $cuid->toString(); // hw8kkckkgwkk0oo0gkw0o8sg
echo $cuid->toString(); // apr5hhh4ox45krsg9gycbs9k

// new (with custom length)
$cuid = new Visus\Cuid2\Cuid2(10);
echo $cuid; // psk8844ck4
echo $cuid; // pekw02xwsd
```
6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
}
],
"require": {
"php": "^8.1"
"php": "^8.1",
"ext-gmp": "*"
},
"require-dev": {
"ext-ctype": "*",
Expand All @@ -27,9 +28,6 @@
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "^5.4"
},
"suggest": {
"ext-gmp": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
Expand Down
Loading

0 comments on commit 019e77d

Please sign in to comment.