ivybridge/model-mgr
Composer 安装命令:
composer require ivybridge/model-mgr
包简介
Simple command-line model manager for Phalcon. It generates models from certain schemas. It can update their properties only, keep the suffixes of tables, etc.
README 文档
README
Model manager (ModelMgr) is a tool for Phalcon (at this moment). It generates models from a certain schemas. It can update their properties only, remove the suffixes of models, etc.
This application was developed by Brayan Iribe. It was made in order to reduce the hassle of type every table and model name in the command line.
This tool requires Phalcon Devtools in order to work.
Only works with MySQL
¿Español? Desliza hacia abajo.
INSTALLATION
In bash run:
> composer global require ivybridge/model-mgr #now modelmgr will be available > modelmgr
COMMANDS
If I have a table with the suffix for example: sat_impuestos, where sat is the suffix, ModelMgr can or not keep it.
If I don't use the argument --keep-suffix=sat, the suffix will be deleted and the final model will be called Impuestos.
You can update only one model by passing its table name to ModelMgr, for example:
> modelmgr sat_impuestos
By doing this, if the model exists in the project and the table name is correct, the model will be updated only. The namespace is not required in this case, because you have provided the model already.
If you don't provide a model to update, all existant models will be updated, and the non-existant will be created.
GREEN: You can put whatever you want in those lines, ModelMgr can handle it and if the model is updated, it will keep it.
RED: You CANNOT put comments, functions or newlines in that block. ModelMgr cannot handle it and will result in broken model.
YELLOW: You can put whatever you want, as long as you don't use ModelMgr code injection. If you do so, the model can likely result broken with duplicated code.
ModelMgr cannot detect if you added a comment, functions or new lines in the model props. Please dont do so. Keep the model as Phalcon generates it originally. If you add them, the model will likely result broken. You can comment an do whatever you want in the functions.
ModelMgr will use the database settings of config.php
At this moment, ModelMgr works only for Phalcon Project. However, I'm interested porting it to other frameworks, like Laravel.
Español
Model manager (ModelMgr) es una herramienta desarrollada para Phalcon. Genera modelos a partir de esquemas, puede actualizar las propiedades de los modelos solamente (conservando sus funciones originales), remover sufijos de tablas, etcétera.
Esta aplicación fue desarrollada por Brayan Iribe con el fin de reducir las molestias de escribir en la línea de comandos modelo por modelo y actualizar su contenido uno por uno.
Esta herramienta requiere de las Phalcon Devtools para funcionar.
Solo trabaja con MySQL
INSTALACIÓN
En tu proyecto de Phalcon ejecuta:
> composer global require ivybridge/model-mgr #ahora modelmgr debe estar disponible > modelmgr
COMANDOS
Si tengo una tabla con un sufijo por ejemplo: sat_impuestos, donde sat es el sufijo, ModelMgr puede o no conservar el mismo.
Si no se utiliza el comando --keep-sufix=sat, el sufijo se eliminará y el modelo terminará llamandose Impuestos.
Puedes actualizar las propiedades de un modelo simplemente pasando su nombre a ModelMgr, por ejemplo:
> modelmgr sat_impuestos
Al hacer esto, si el modelo existe en el proyecto y el nombre de la tabla es el correcto, se actualizará solamente dicho modelo. No es necesario pasar el namespace, ya que al tratarse de un solo modelo, se obtiene el namespace del mismo.
Si no se proporciona un modelo a actualizar, entonces se crearán aquellos modelos que no existan en el momento, y se actualizarán aquellos que si existan.
VERDE: Puedes poner lo que quieras en esas líneas, ModelMgr puede controlarlo. Si el modelo es actualizado, lo mantendrá ahí mismo.
ROJO: NO PUEDES poner comentarios, funciones o nuevas líneas en ese bloque. ModelMgr no podrá controlarlo y devolverá un modelo probablemente roto.
AMARILLO: Puedes poner lo que quieras, siempre y cuando no utilices la inyección de código de ModelMgr. Si lo haces, el modelo puede resultar roto o con código duplicado.
ModelMgr no puede detectar que agregaste un comentario, funciones o nuevas líneas en las propiedades del modelo. Mantén el modelo como Phalcon lo genera originalmente. Si haces esto, el modelo puede terminar probablemente roto.
En este momento, ModelMgr solo funciona para proyectos Phalcon. Sin embargo, estoy interesado en poder portar esta herramienta a otros frameworks, como Laravel.
ivybridge/model-mgr 适用场景与选型建议
ivybridge/model-mgr 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 07 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「manager」 「model」 「phalcon」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ivybridge/model-mgr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ivybridge/model-mgr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ivybridge/model-mgr 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Interfaces for web resource models and services to retrieve and create them
Laravel 5 - Repositories to the database layer
Uniondrug Trace Client Component for uniondrug/framework
KCFinder web file manager
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-07-28


