magicalex/write-ini-file
Composer 安装命令:
composer require magicalex/write-ini-file
包简介
Write-ini-file php library for create, remove, erase, add, and update ini file
关键字:
README 文档
README
Write-ini-file php library for create, remove, erase, add, and update ini file.
Installation
Use composer for install magicalex/write-ini-file.
composer require magicalex/write-ini-file
Usage
<?php require_once 'vendor/autoload.php'; use \WriteiniFile\WriteiniFile; use \WriteiniFile\ReadiniFile; $data = [ 'fruit' => ['orange' => '100g', 'fraise' => '10g'], 'legume' => ['haricot' => '20g', 'oignon' => '100g'], 'jus' => ['orange' => '1L', 'pomme' => '1,5L', 'pamplemousse' => '0,5L'], ]; // demo create ini file $file = new WriteiniFile('file.ini'); $file ->create($data) ->add(['music' => ['rap' => true, 'rock' => false]]) ->rm(['jus' => ['pomme' => '1,5L']]) ->update(['fruit' => ['orange' => '200g']]) ->write(); echo '<pre>'.file_get_contents('file.ini').'</pre>'; /* output file.ini [fruit] orange=200g fraise=10g [legume] haricot=20g oignon=100g [jus] orange=1L pamplemousse=0,5L [music] rap=true rock=false */ // Just read a file ini var_dump(ReadiniFile::get('file.ini')); /* output array(4) { 'fruit' => array(2) { 'orange' => string(4) "200g" 'fraise' => string(3) "10g" } 'legume' => array(2) { 'haricot' => string(3) "20g" 'oignon' => string(4) "100g" } 'jus' => array(2) { 'orange' => string(2) "1L" 'pamplemousse' => string(4) "0,5L" } 'music' => array(2) { 'rap' => string(4) "true" 'rock' => string(5) "false" } } */ $erase = (new WriteiniFile('file.ini'))->erase()->write(); // file.ini -> empty
Contributing
To run the unit tests:
composer install
php vendor/bin/phpunit # or use: composer run-script test
License
WriteiniFile is released under the GNU General Public License v3.0
magicalex/write-ini-file 适用场景与选型建议
magicalex/write-ini-file 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 160.57k 次下载、GitHub Stars 达 17, 最近一次更新时间为 2015 年 06 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「file」 「ini」 「write」 「write_ini_file」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 magicalex/write-ini-file 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 magicalex/write-ini-file 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 magicalex/write-ini-file 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Framework Agnostic Configuration Library
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way
A Zend Framework module to quickly and easily set PHP settings.
The slick/configuration component provides an easy-to-use solution for managing configuration files in your PHP applications.
Load configuration files the easy way. This configuration loader supports PHP, INI, JSON, XML, YAML and NEON file extensions.
统计信息
- 总下载量: 160.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 32
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-06-06