zhortein/symfony-toolbox-bundle
Composer 安装命令:
composer require zhortein/symfony-toolbox-bundle
包简介
This bundle is dedicated to Symfony applications and provide useful tools for your app.
README 文档
README
English version
This Symfony bundle provides a set of utility services, enums, classes, and tools designed to enhance Symfony applications, making it easier to manage specific tasks such as server metrics, extended enum features, business date handling, and more. The toolbox offers optimized utilities for developers aiming to streamline their workflow with the latest Symfony features.
Available features
- Business DateTime handling: holidays, working days, and more
- Color Tools: RGB to Hex, Hex to RGB, color palette, etc.
- Data Types Validation: validate PHP data using Symfony constraint validators
- DateInterval Tools: add, subtract, normalize, and more
- DateTime Manipulation Tools
- Enums and Enum Tools: Days, Months, Actions, Translatable Enums, and more
- File Content Getter: retrieve and save file content locally
- EXIF Info Handling: extract EXIF information from images
- File Handling Tools: recursive folder removal, large file reading, folder copying, etc.
- Measure Converters: display human-readable file sizes, convert between km/miles, kg/pounds, etc.
- Server Metrics: retrieve various server metrics
- String Manipulation Tools: sanitize strings and filenames, remove diacritics, count words, truncate text, and more.
- Datatables: generate datatables
Installation
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Applications that use Symfony Flex
Just add the following in your composer.json file to have access to automatic Flex recipes:
"extra": { "symfony": { "allow-contrib": true, "endpoint": [ "https://raw.githubusercontent.com/Zhortein/recipes-zhortein/flex/main/index.json", "flex://defaults" ] } }
Then, open a command console, enter your project directory and execute:
composer require zhortein/symfony-toolbox-bundle
Applications that don't use Symfony Flex
Step 1: Create needed files
Two files are "needed":
config/packages/zhortein_symfony_toolbox.yaml: configuration file for the bundle featuresconfig/routes/zhortein_symfony_toolbox.yaml: configuration file for the bundle features using routing (datatables...) The bundle, if not detected, will attempt to create the second file automatically.
You can create the following files by yourself:
# config/packages/zhortein_symfony_toolbox.yaml zhortein_symfony_toolbox: datatables: css_mode: 'bootstrap' items_per_page: 10 paginator: 'custom' export: enabled_by_default: true export_csv: true export_pdf: false export_excel: true ux_icons: true ux_icons_options: icon_first: 'bi:chevron-double-left' icon_previous: 'bi:chevron-left' icon_next: 'bi:chevron-right' icon_last: 'bi:chevron-double-right' icon_search: 'bi:search' icon_true: 'bi:check' icon_false: 'bi:x' icon_sort_neutral: 'mdi:sort' icon_sort_asc: 'bi:sort-alpha-down' icon_sort_desc: 'bi:sort-alpha-up' icon_filter: 'mi:filter' icon_export_csv: 'bi:filetype-csv' icon_export_pdf: 'bi:filetype-pdf' icon_export_excel: 'bi:filetype-xlsx'
# config/routes/zhortein_symfony_toolbox.yaml zhortein_symfony_toolbox: resource: '@ZhorteinSymfonyToolboxBundle/config/routes.yaml'
Step 2: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
composer require zhortein/symfony-toolbox-bundle
Step 3: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php file of your project:
// config/bundles.php return [ // ... Zhortein\SymfonyToolboxBundle\ZhorteinSymfonyToolboxBundle::class => ['all' => true], ];
Usage
Each feature listed in the introduction above links to its dedicated documentation page. There, you’ll find detailed usage examples, configuration notes, and other information tailored for efficient integration in Symfony projects.
Contributing
Contributions are welcome! If you’d like to contribute to this project, please:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/my-feature). - Commit your changes (
git commit -m "Add my feature"). - Push to the branch (
git push origin feature/my-feature). - Open a pull request.
All contributions should adhere to the project’s coding standards and follow the conventional commit guidelines.
License
This bundle is licensed under the GPL-3.0 License. You are free to use, modify, and distribute this bundle under the terms of this license.
Credits
Developed and maintained by David RENARD. Special thanks to contributors and the Symfony community for their ongoing support and resources.
Version Française
Ce bundle Symfony fournit un ensemble de services utilitaires, d'enums, de classes et d'outils conçus pour améliorer les applications Symfony en facilitant la gestion de tâches spécifiques telles que les métriques serveur, les fonctionnalités étendues des enums, la gestion des dates d'affaires, et bien plus. La toolbox propose des utilitaires optimisés pour les développeurs souhaitant rationaliser leur flux de travail avec les dernières fonctionnalités de Symfony.
Fonctionnalités disponibles
- Gestion des dates d'affaires : jours fériés, jours ouvrables, etc.
- Outils de couleur : conversion RGB vers Hex, Hex vers RGB, palettes de couleurs, etc.
- Validation des types de données : validez vos données PHP en utilisant les validateurs de contraintes Symfony
- Outils pour DateInterval : addition, soustraction, normalisation, etc.
- Outils pour manipuler les DateTime
- Enums utiles et outils pour les enums : jours, mois, actions, enums traduisibles, etc.
- Gestionnaire de contenu de fichiers : récupération et sauvegarde du contenu de fichiers en local
- Gestion des informations EXIF : extraction des informations EXIF des images
- Outils de gestion de fichiers : suppression de dossiers de manière récursive, lecture de gros fichiers, copie de dossiers, etc.
- Convertisseurs de mesures : affichage de la taille de fichiers en format lisible, conversion entre km et miles, kg et livres, etc.
- Métriques serveur : récupération de diverses métriques serveur
- Outils de manipulation de chaînes : assainissement des chaînes et des noms de fichiers, suppression des diacritiques, comptage de mots, troncature de texte, etc.
- Datatables : générer des datatables
Installation
Assurez-vous que Composer est installé globalement, comme expliqué dans le chapitre d'installation de la documentation de Composer.
Applications qui utilisent Symfony Flex
Ajoutez simplement ce qui suit dans votre fichier composer.json :
"extra": { "symfony": { "allow-contrib": true, "endpoint": [ "https://raw.githubusercontent.com/Zhortein/recipes-zhortein/flex/main/index.json", "flex://defaults" ] } }
Puis, uuvrez une console de commande, accédez au répertoire de votre projet, et exécutez :
composer require zhortein/symfony-toolbox-bundle
Applications qui n'utilisent pas Symfony Flex
Etape 1: Création des fichiers requis
Deux fichiers sont "requis":
config/packages/zhortein_symfony_toolbox.yaml: le fichier de configuration des fonctionnalités du bundleconfig/routes/zhortein_symfony_toolbox.yaml: le fichier de configuration des routes pour les fonctionnalités du bundle qui utilisent le routage (datatables) Si non détecté, le bundle tentera de créer automatiquement le second fichier.
Vous devez donc créer les fichiers suivant par vous-même :
# config/packages/zhortein_symfony_toolbox.yaml zhortein_symfony_toolbox: datatables: css_mode: 'bootstrap' items_per_page: 10 paginator: 'custom' export: enabled_by_default: true export_csv: true export_pdf: false export_excel: true ux_icons: true ux_icons_options: icon_first: 'bi:chevron-double-left' icon_previous: 'bi:chevron-left' icon_next: 'bi:chevron-right' icon_last: 'bi:chevron-double-right' icon_search: 'bi:search' icon_true: 'bi:check' icon_false: 'bi:x' icon_sort_neutral: 'mdi:sort' icon_sort_asc: 'bi:sort-alpha-down' icon_sort_desc: 'bi:sort-alpha-up' icon_filter: 'mi:filter' icon_export_csv: 'bi:filetype-csv' icon_export_pdf: 'bi:filetype-pdf' icon_export_excel: 'bi:filetype-xlsx'
# config/routes/zhortein_symfony_toolbox.yaml zhortein_symfony_toolbox: resource: '@ZhorteinSymfonyToolboxBundle/config/routes.yaml'
Etape 2: Téléchargez le bundle
Ouvrez une console de commande, accédez au répertoire de votre projet, et exécutez la commande suivante pour télécharger la dernière version stable du bundle :
composer require zhortein/symfony-toolbox-bundle
Etape 3: Activez le Bundle
Ensuite, activez le bundle en l'ajoutant dans la liste des bundles connus
dans le fichier config/bundles.php de votre projet :
// config/bundles.php return [ // ... Zhortein\SymfonyToolboxBundle\ZhorteinSymfonyToolboxBundle::class => ['all' => true], ];
Utilisation
Chaque fonctionnalité listée dans l'introduction renvoie vers une page de documentation dédiée. Vous y trouverez des exemples détaillés d'utilisation, des notes de configuration, et d'autres informations pour une intégration efficace dans vos projets Symfony.
Contribution
Les contributions sont les bienvenues ! Si vous souhaitez contribuer à ce projet, veuillez :
- Faire un fork du dépôt.
- Créer une branche pour votre fonctionnalité (
git checkout -b feature/ma-fonctionnalite). - Commiter vos changements (
git commit -m "Ajout de ma fonctionnalité"). - Pousser la branche (
git push origin feature/ma-fonctionnalite). - Ouvrir une pull request.
Toutes les contributions doivent respecter les standards de codage du projet et suivre les directives des commits conventionnels.
Licence
Ce bundle est sous licence GPL-3.0. Vous êtes libre d'utiliser, de modifier et de distribuer ce bundle selon les termes de cette licence.
Crédits
Développé et maintenu par David RENARD. Un grand merci aux contributeurs et à la communauté Symfony pour leur soutien et leurs ressources.
zhortein/symfony-toolbox-bundle 适用场景与选型建议
zhortein/symfony-toolbox-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 129 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 11 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「bundle」 「tools」 「tool」 「utils」 「misc」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zhortein/symfony-toolbox-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zhortein/symfony-toolbox-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zhortein/symfony-toolbox-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A set of useful PHP classes.
A Laravel package to retrieve data from Google Search Console
2lenet/EasyAdminPlusBundle
The bundle for easy using json-rpc api on your project
Provide a way to secure accesses to all routes of an symfony application.
DMS Meetup API Bundle, enables Meetup API clients in services
统计信息
- 总下载量: 129
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2024-11-14