承接 deployed/myth-to-shield 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

deployed/myth-to-shield

Composer 安装命令:

composer require deployed/myth-to-shield

包简介

Tool to migrate from MythAuth to CodeIgniter Shield

README 文档

README

MythToShield is tool to migrate from MythAuth to CodeIgniter Shield. The main purpose of this library is to migrate the database to the Shield structure and keep the existing user data. t's up to developer to ensure that project code works properly with the Shield library.

Getting Started

Prerequisites

Usage of MythToShield requires the following:

Installation

Backup you database

Always create a backup of your database first in case anything goes wrong during the migration process.

Remove MythAuth Library

composer remove myth/auth

Remove the Myth auth from Autoload config. Also make sure to remove the MythAuth Config files if you have any in the APP_NAMESPACE or anywhere else in the project since it will conflict with the Shield library

Install Shield library

composer require codeigniter4/shield

Add the Shield library to $psr4 namespaces in Autoload Config

public $psr4 = [
    APP_NAMESPACE => APPPATH,
    //...
    'CodeIgniter\Shield' => ROOTPATH . 'vendor/codeigniter4/shield/src'
]

Install Settings library

Shield should automatically pull settings library but this might change in future to be sure install the settings library directly into the project

composer require codeigniter4/settings

Add the Settings library to $psr4 namespaces in Autoload Config

public $psr4 = [
    APP_NAMESPACE => APPPATH,
    //...
    'CodeIgniter\Settings' => ROOTPATH . 'vendor/codeigniter4/settings/src'
]

Install MythToShield library

composer require deployed/myth-to-shield

Add the MythToShield library to $psr4 namespaces in Autoload Config

public $psr4 = [
    APP_NAMESPACE => APPPATH,
    //...
    'Deployed\MythToShield' => ROOTPATH . 'vendor/deployed/myth-to-shield/src'
]

Configure Shield

Manually create shield config file or registrar if you want to override default table names from shield. php spark shield:setup and shield migrations should not be executed. The MythToShield migrator will create the tables. The settings library migrations can be executed, but it is not required since the MythToShield migrator will take care of those as well.

Additional Commands - This step is optional

MythToShield library provides MythToShield config class which can be used to execute additional commands. See the config file for more information

6. Run the migration command.

php spark mythToShield:migrate

It should return MythToShield migration completed successfully message

Compatibility Mode

Myth Auth uses different method to store and verify the password hashes. In order for Shield to work with existing password additional column named myth_hash is added to the identities table. The initial value in this column is set to 1 for every user account.

To process the Myth Auth hashes MythCompatSession authenticator class is loaded to replace the shield session authenticator via registrar. When user tries to logg in for the first time via shield myth_hash value is checked if it contains 1 the user password is verified using the Myth Auth method. On first successful login new password hash is generated and 0 is set as the myth_hash value. When myth_hash is 0 MythCompatSession authenticator uses the more secure Shield hashing method and does not allow users to log in with Myth Auth password hashes.

Uninstalling the library

MythToShield library should be kept installed as long as Myth Auth password hash compatibility is needed. When the compatibility is not needed anymore the myth_hash column should be removed from the identities table first.

There is a command for removing the database column

php spark   mythToShield:cleanup

Once the database is cleaned the MythToShield library can also be deleted.

Remove the library from the Autoload Config

'Deployed\MythToShield' => ROOTPATH . 'vendor/deployed/myth-to-shield/src'

Remove the composer package

composer remove deployed/myth-to-shield

Contributing

MythToShield does accept and encourage contributions from the community in any shape. It doesn't matter whether you can code, write documentation, or help find bugs, all contributions are welcome. See the CONTRIBUTING.md file for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

deployed/myth-to-shield 适用场景与选型建议

deployed/myth-to-shield 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.49k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 11 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「authorization」 「Authentication」 「codeigniter」 「shield」 「codeigniter4」 「myth」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 deployed/myth-to-shield 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 deployed/myth-to-shield 我们能提供哪些服务?
定制开发 / 二次开发

基于 deployed/myth-to-shield 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 4.49k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 7
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-26