duncan3dc/php-ini

临时管理 php.ini 设置。

1.2.0 2021-01-10 19:53 UTC

This package is auto-updated.

Last update: 2024-09-11 03:57:00 UTC


README

临时管理 php.ini 指令。

完整文档可在 https://duncan3dc.github.io/php-ini/ 查找。
PHPDoc API 文档也提供在 https://duncan3dc.github.io/php-ini/api/

release build coverage

安装

安装此库的推荐方法是使用 Composer

从您的项目根目录运行以下命令

$ composer require duncan3dc/php-ini

入门指南

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();

更多信息请参阅 http://duncan3dc.github.io/php-ini/

更新日志

自开天辟地以来,已有 更新日志 可用

获取帮助的地方

发现了一个错误?有一个问题?只是不确定某事如何工作?
创建一个问题,我会尽力帮助。
或者您可以在 Twitter 上找到我

duncan3dc/php-ini 企业版

作为 Tidelift 订阅的一部分提供

duncan3dc/php-ini 的维护者以及数千个其他包的维护者正在与 Tidelift 合作,为构建应用程序使用的开源依赖项提供商业支持和维护。节省时间,降低风险,提高代码质量,同时支付您使用的确切依赖项的维护者。了解更多信息 (点击这里)