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.3.0(1mo ago)4278.8k↓73.4%2[1 PRs](https://github.com/duncan3dc/php-ini/pulls)4Apache-2.0PHPPHP ^7.4 || ^8.0CI failing

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 4d ago

READMEChangelogDependencies (8)Versions (8)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=main)](https://github.com/duncan3dc/php-ini/actions?query=branch%3Amain+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

49

—

FairBetter than 94% of packages

Maintenance52

Moderate activity, may be stable

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity73

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 ~813 days

Total

5

Last Release

31d ago

Major Versions

0.1.0 → 1.0.02018-05-04

PHP version history (5 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

1.3.0PHP ^7.4 || ^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.2k525.7M2.0k](/packages/symfony-options-resolver)[league/config

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

565335.0M36](/packages/league-config)[grasmash/expander

Expands internal property references in PHP arrays.

14064.3M10](/packages/grasmash-expander)[josegonzalez/dotenv

dotenv file parsing for PHP

28010.4M165](/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

2025.0M44](/packages/symfony-requirements-checker)

PHPackages © 2026

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