duncan3dc/php-ini

Manage php.ini settings on a temporary basis.

1.0.0 2018-05-04 12:36 UTC

README

Manage php.ini directives on a temporary basis.

Full documentation is available at https://duncan3dc.github.io/php-ini/
PHPDoc API documentation is also available at https://duncan3dc.github.io/php-ini/api/

release build coverage

Installation

The recommended method of installing this library is via Composer.

Run the following command from your project root:

$ composer require duncan3dc/php-ini

Getting Started

use duncan3dc\PhpIni\Ini;

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

$ini = new Ini;

$ini->set("include_path", "/tmp/cool-php-stuff");

require "my-cool-file.php";

$ini->restore("include_path");
use duncan3dc\PhpIni\State;

$ini = new State;

$ini->set("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 http://duncan3dc.github.io/php-ini/

Changelog

A Changelog has been available since the beginning of time

Where to get help

Found a bug? Got a question? Just not sure how something works?
Please create an issue and I'll do my best to help out.
Alternatively you can catch me on Twitter