ed-fruty/laravel4-namespace-migrator
Composer 安装命令:
composer require ed-fruty/laravel4-namespace-migrator
包简介
Package for Laravel 4, supporting using namespaces in migration classes
README 文档
README
Laravel 4 is not support namespaces in migration classes, but it is not a problem ;)
#Installation
- Use Composer to install package into your project:
composer require "ed-fruty/laravel4-namespace-migrator": "1.0.0"
- Add the service provider in
app/config/app.php:
'Fruty\LaravelNamespaceMigrator\LaravelNamespaceMigratorServiceProvider',
- Publish package configuration
php artisan config:publish ed-fruty/laravel4-namespace-migrator
#Usage
Default migration namespaces searching
When you call migrations like ```bash php artisan migrate --path=app/Modules/Blog/Migrations ``` Migrator automatically searches classes with namespace `App\Modules\Blog\Migrations` in `app/Modules/Blog/Migrations` To change default values, edit configuration file `app/config/packages/ed-fruty/laravel4-namespace-migrator/main.php` block `default`Reserving namespaces for migration paths
For reserving namespace for some path, edit configuration file `app/config/packages/ed-fruty/laravel4-namespace-migrator/main.php`. Example:'reserved' => [ base_path('app/modules/Blog/migrations') => 'Blog\\Migrations\\', ]
It means, when you call migrations like:
php artisan migrate --path=app/modules/Blog/migrations
Migrator automatically searches classes with namespace Blog\Migrations in that directory.
Workbenches
For workbench packages Migrator automatically searches migrations by `vendor/package` name. When you call migrations like:php artisan migrate --bench=foo/bar
Migrator searches classes with namespace Foo\Bar\Migrations in workbench/foo/bar/src/migrations
So if workbench namespace does not equal to vendor/package name you must register it in 'reserved' block like:
base_path('workbench/foo/bar/src/migrations') => 'VendorNamespace\\PackageNamespace\\'
Without namespaces
Migrator always searches classes with namespace firstly and if class not found with namespace it trying to search class without namespace. For example basic usage:php artisan migrate
By default configs, Migrator firstly searches migration classes with namespace App\database\migrations in app/database/migrations and if it does not exists, Migrator tries to load class without namespace from that catalog.
ed-fruty/laravel4-namespace-migrator 适用场景与选型建议
ed-fruty/laravel4-namespace-migrator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26 次下载、GitHub Stars 达 2, 最近一次更新时间为 2014 年 12 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「migration」 「laravel」 「namespace」 「migrator」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ed-fruty/laravel4-namespace-migrator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ed-fruty/laravel4-namespace-migrator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ed-fruty/laravel4-namespace-migrator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Lets you add foreign keys in a swift! Foreign key adder in laravel migration.
Manage PostgreSQL schemas in Laravel applications
Bitrix db migration core libs
The YADM migrations
Data migration mechanism for php using dbal do doctrine with pdo, schema and queryBuilder
Alfabank REST API integration
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-02