vzgcoders/totk-recipe-calculator
最新稳定版本:v1.3
Composer 安装命令:
composer require vzgcoders/totk-recipe-calculator
包简介
A cooking calculator for Tears of the Kingdom.
README 文档
README
Before you start
Before you start using this Library, you need to know how PHP works. This is a fundamental requirement before you start. Without this knowledge, you will only suffer.
FAQ
- Can I run TOTK-Recipe-Calculator on a webserver (e.g. Apache, nginx)?
- Yes! I'm also working on a version that is compatible with the DiscordPHP Library that will only run in CLI. If that's what you're looking for, you can find it here (unless it's still in development, in which case the repository is still set to private).
Getting Started
Requirements
- PHP 8.0
- Composer
Recommended Extensions
- The latest PHP version.
Basic Configuration-
use \TOTK\Crafter; use \TOTK\Helpers\Collection; use \TOTK\Parts\Ingredient; ini_set('display_errors', 1); error_reporting(E_ALL); set_time_limit(0); ignore_user_abort(1); ini_set('max_execution_time', 0); ini_set('memory_limit', '-1'); //Unlimited memory usage if (! @include getcwd() . '/vendor/autoload.php') { //If you clone the GitHub project instead of using Composer we will need to load these classes manually include __DIR__ . '/src/TOTK/crafter.php'; include __DIR__ . '/src/TOTK/Helpers/collection.php'; include __DIR__ . '/src/TOTK/Parts/ingredient.php'; } //This is what will be used to calculate meals from a list of ingredients $crafter = new Crafter(); //For ease of use, create a Collection to retrieve a list of ingredients if (! $materials_file = @file(__DIR__ . '\vendor\vzgcoders\totk-recipe-calculator\src\TOTK\CSVs\materials.csv')) $materials_file = file(__DIR__ . '\src\TOTK\CSVs\materials.csv'); $csv = array_map('str_getcsv', $materials_file); $keys = array_shift($csv); $materials = array(); foreach ($csv as $row) $materials[] = array_combine($keys, $row); $materials_collection = new Collection([], $keys[2]); foreach ($materials as $array) $materials_collection->pushItem($array); // Pick out some ingredients for your recipe. This is an example for Fruitcake. $ingredient1 = new Ingredient($materials_collection->get('Euen name', 'Apple')); $ingredient2 = new Ingredient($materials_collection->get('Euen name', 'Wildberry')); $ingredient3 = new Ingredient($materials_collection->get('Euen name', 'Cane Sugar')); $ingredient4 = new Ingredient($materials_collection->get('Euen name', 'Tabantha Wheat')); $ingredient5 = null; //Throw the array into the crafter and display the results $ingredients = [$ingredient1 ?? NULL, $ingredient2 ?? NULL, $ingredient3 ?? NULL, $ingredient4 ?? NULL, $ingredient5 ?? NULL]; var_dump('[MEAL]', $meal = $crafter->process($ingredients));
See main.php for function examples.
Contributing
We are open to contributions, just open a pull request and we will review it.
License
MIT License, © Valithor Obsidion and other contributers 2023-present.
vzgcoders/totk-recipe-calculator 适用场景与选型建议
vzgcoders/totk-recipe-calculator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 34 次下载、GitHub Stars 达 10, 最近一次更新时间为 2023 年 05 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vzgcoders/totk-recipe-calculator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vzgcoders/totk-recipe-calculator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 34
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-30