From 9f7d85cc6890f06a65bad4fe0077c070d596e4a4 Mon Sep 17 00:00:00 2001 From: Oscar Otero Date: Tue, 3 Dec 2024 02:02:28 +0100 Subject: [PATCH] new version --- CHANGELOG.md | 4 ++-- README.md | 49 +++++++++++++++++++++++-------------------------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 683651d..66a0356 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [2.1.1] - Unreleased +## [2.1.1] - 2024-12-03 ### Fixed - Support for PHP 8.4 [#12]. @@ -54,7 +54,7 @@ First stable version [#8]: https://github.com/oscarotero/env/issues/8 [#12]: https://github.com/oscarotero/env/issues/12 -[2.1.1]: https://github.com/oscarotero/env/compare/v2.1.0...HEAD +[2.1.1]: https://github.com/oscarotero/env/compare/v2.1.0...v2.1.1 [2.1.0]: https://github.com/oscarotero/env/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/oscarotero/env/compare/v1.2.0...v2.0.0 [1.2.0]: https://github.com/oscarotero/env/compare/v1.1.0...v1.2.0 diff --git a/README.md b/README.md index 93395c7..8a3daed 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,17 @@ # env [![Software License][ico-license]](LICENSE) -[![Build Status][ico-travis]][link-travis] -[![Quality Score][ico-scrutinizer]][link-scrutinizer] [![Total Downloads][ico-downloads]][link-downloads] - Simple library to get environment variables converted to simple types. ## Installation -This package is installable and autoloadable via Composer as [oscarotero/env](https://packagist.org/packages/oscarotero/env). +This package is installable and autoloadable via Composer as +[oscarotero/env](https://packagist.org/packages/oscarotero/env). -``` -$ composer require oscarotero/env +```sh +composer require oscarotero/env ``` ## Example @@ -30,26 +28,29 @@ var_dump(Env::get('FOO')); //bool(false) ## Available conversions -* `"false"` is converted to boolean `false` -* `"true"` is converted to boolean `true` -* `"null"` is converted to `null` -* If the string contains only numbers is converted to an integer -* If the string has quotes, remove them +- `"false"` is converted to boolean `false` +- `"true"` is converted to boolean `true` +- `"null"` is converted to `null` +- If the string contains only numbers is converted to an integer +- If the string has quotes, remove them ## Options -To configure the conversion, you can use the following constants (all enabled by default): +To configure the conversion, you can use the following constants (all enabled by +default): -* `Env::CONVERT_BOOL` To convert boolean values -* `Env::CONVERT_NULL` To convert null values -* `Env::CONVERT_INT` To convert integer values -* `Env::STRIP_QUOTES` To remove the quotes of the strings +- `Env::CONVERT_BOOL` To convert boolean values +- `Env::CONVERT_NULL` To convert null values +- `Env::CONVERT_INT` To convert integer values +- `Env::STRIP_QUOTES` To remove the quotes of the strings -There's also additional settings that you can enable (they're disabled by default) +There's also additional settings that you can enable (they're disabled by +default) -* `Env::USE_ENV_ARRAY` To get the values from `$_ENV`, instead `getenv()`. -* `Env::USE_SERVER_ARRAY` To get the values from `$_SERVER`, instead `getenv()`. -* `Env::LOCAL_FIRST` To get first the values of locally-set environment variables. +- `Env::USE_ENV_ARRAY` To get the values from `$_ENV`, instead `getenv()`. +- `Env::USE_SERVER_ARRAY` To get the values from `$_SERVER`, instead `getenv()`. +- `Env::LOCAL_FIRST` To get first the values of locally-set environment + variables. ```php use Env\Env; @@ -66,7 +67,8 @@ Env::$options ^= Env::CONVERT_NULL; ## Default value -By default, if the value does not exist, returns `null`, but you can change for any other value: +By default, if the value does not exist, returns `null`, but you can change for +any other value: ```php use Env\Env; @@ -91,10 +93,5 @@ Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes. The MIT License (MIT). Please see [LICENSE](LICENSE) for more information. [ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square -[ico-travis]: https://img.shields.io/travis/oscarotero/env/master.svg?style=flat-square -[ico-scrutinizer]: https://img.shields.io/scrutinizer/g/oscarotero/env.svg?style=flat-square [ico-downloads]: https://img.shields.io/packagist/dt/oscarotero/env.svg?style=flat-square - -[link-travis]: https://travis-ci.org/oscarotero/env -[link-scrutinizer]: https://scrutinizer-ci.com/g/oscarotero/env [link-downloads]: https://packagist.org/packages/oscarotero/env