PHPackages                             duncan3dc/php-ini - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. duncan3dc/php-ini

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

duncan3dc/php-ini
=================

Manage php.ini settings on a temporary basis.

1.2.0(5y ago)4257.8k↓34.7%2[1 PRs](https://github.com/duncan3dc/php-ini/pulls)4Apache-2.0PHPPHP ^7.2 || ^8.0

Since Jul 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/duncan3dc/php-ini)[ Packagist](https://packagist.org/packages/duncan3dc/php-ini)[ Docs](https://github.com/duncan3dc/php-ini)[ RSS](/packages/duncan3dc-php-ini/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (5)Used By (4)

php-ini
=======

[](#php-ini)

Manage [php.ini](https://secure.php.net/manual/en/ini.list.php) directives on a temporary basis.

Full documentation is available at
PHPDoc API documentation is also available at [https://duncan3dc.github.io/php-ini/api/](https://duncan3dc.github.io/php-ini/api/namespaces/duncan3dc.Laravel.html)

[![release](https://camo.githubusercontent.com/9be38452c37cb89214c39caf7fa380246c859f291c4bdd69ccf25496ca4a9103/68747470733a2f2f706f7365722e707567782e6f72672f64756e63616e3364632f7068702d696e692f76657273696f6e2e737667)](https://packagist.org/packages/duncan3dc/php-ini)[![build](https://github.com/duncan3dc/php-ini/workflows/buildcheck/badge.svg?branch=master)](https://github.com/duncan3dc/php-ini/actions?query=branch%3Amaster+workflow%3Abuildcheck)[![coverage](https://camo.githubusercontent.com/ec97dc15c105645388c6a099d86b3030cccfbca79300269e4ef84e556fb23dd8/68747470733a2f2f636f6465636f762e696f2f67682f64756e63616e3364632f7068702d696e692f67726170682f62616467652e737667)](https://codecov.io/gh/duncan3dc/php-ini)

Installation
------------

[](#installation)

The recommended method of installing this library is via [Composer](https://getcomposer.org/).

Run the following command from your project root:

```
$ composer require duncan3dc/php-ini
```

Getting Started
---------------

[](#getting-started)

```
use duncan3dc\PhpIni\Ini;
use duncan3dc\PhpIni\Settings;

require __DIR__ . "/vendor/autoload.php";

$ini = new Ini;

$ini->set(Settings::INCLUDE_PATH, "/tmp/cool-php-stuff");

require "my-cool-file.php";

$ini->restore(Settings::INCLUDE_PATH);
```

```
use duncan3dc\PhpIni\Ini;
use duncan3dc\PhpIni\Settings;
use duncan3dc\PhpIni\State;

$ini = new State;

$ini->set(Settings::MEMORY_LIMIT, "1M");

$ini->call(function () {
    # This code can't use much memory
});

# This code can use as much memory as the default memory_limit allows
eatAllTheMemory();
```

*Read more at *

Changelog
---------

[](#changelog)

A [Changelog](CHANGELOG.md) has been available since the beginning of time

Where to get help
-----------------

[](#where-to-get-help)

Found a bug? Got a question? Just not sure how something works?
Please [create an issue](//github.com/duncan3dc/php-ini/issues) and I'll do my best to help out.
Alternatively you can catch me on [Twitter](https://twitter.com/duncan3dc)

duncan3dc/php-ini for enterprise
--------------------------------

[](#duncan3dcphp-ini-for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of duncan3dc/php-ini and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-duncan3dc-php-ini?utm_source=packagist-duncan3dc-php-ini&utm_medium=referral&utm_campaign=readme)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 97.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~427 days

Total

4

Last Release

1954d ago

Major Versions

0.1.0 → 1.0.02018-05-04

PHP version history (4 changes)0.1.0PHP ^5.6|^7.0

1.0.0PHP ^7.1

1.1.0PHP ^7.2

1.2.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/11dc66042513f11d1c99b1e6763f25dca84a3ff31cdbea3972b9b804a3d3d5e9?d=identicon)[duncan3dc](/maintainers/duncan3dc)

---

Top Contributors

[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (35 commits)")[![jawira](https://avatars.githubusercontent.com/u/496541?v=4)](https://github.com/jawira "jawira (1 commits)")

---

Tags

phpconfigurationtemporarydirectivesphp.ini

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/duncan3dc-php-ini/health.svg)

```
[![Health](https://phpackages.com/badges/duncan3dc-php-ini/health.svg)](https://phpackages.com/packages/duncan3dc-php-ini)
```

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k493.9M1.6k](/packages/symfony-options-resolver)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[josegonzalez/dotenv

dotenv file parsing for PHP

2799.8M137](/packages/josegonzalez-dotenv)[dflydev/dot-access-configuration

Given a deep data structure representing a configuration, access configuration by dot notation.

13414.5M4](/packages/dflydev-dot-access-configuration)[symfony/requirements-checker

Check Symfony requirements and give recommendations

2014.7M29](/packages/symfony-requirements-checker)[chillerlan/php-settings-container

A container class for immutable settings objects. Not a DI container.

3427.3M21](/packages/chillerlan-php-settings-container)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
