Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggests/Request/Proposal : Separate Adapter. #152

Open
amsitlab opened this issue Jun 17, 2021 · 1 comment
Open

Suggests/Request/Proposal : Separate Adapter. #152

amsitlab opened this issue Jun 17, 2021 · 1 comment

Comments

@amsitlab
Copy link

Why not separating adapter as sub-package of phpmig/phpmig

For example, for codeigniter user, their not need Zend, Illuminate, Doctrine adapter, their can install specific adapter for codeigniter(only) like phpmig/phpmig-adapter-codeigniter, and package phpmig/phpmig-adapater-codeigniter will depends phpmig/phpmig as core.

then codeigniter user can install with:

{

.....
  "require": {
    "phpmig/phpmig-adapter-codeigniter": "*",
     .....
  }

....
}

project tree of phpmig/phpmig : (core)

+-- src/
|     +- Adapter/
|     |      +- File/Flat.php
|     |      +- Pdo/ (all \Phpmig\Adapater\Pdo\  class files)
|     |      +- AdapterInterface.php
|     +- Command/(all class of \Phpmig\Command ).php
|     +- Migration /(all class of \Phpmig\Migration ).php
|     +- [other files]
+-- [other files]
+-- composer.json

And project tree of phpmig/phpmig-adapter-codeigniter :

+-- src/
|     +-- Adapter/
|           +-- Codeigniter/
|                  +-- Db.php
+-- composer.json

and phpmig/phpmig-adapter-codeigniter/composer.json be like:

{
......
"require": {
    "phpmig/phpmig": "<version>",
 }
......
}

with this methode, codeigniter user will haven't class Phpmig\Adapter\ {Zend, Illuminate, Doctrine} cause their installing spasific adapter for codeigniter (only).

also for zendframework user, their can installing specific adapter package like phpmig/phpmig-adapter-zend
and project tree of phpmig/phpmig-adapter-zend be like:

+-- src/
|    +-- Adapter/
|           +-- Zend/
|                 +-- (all adapter class for zf ) .php
+-- composer.json

you can use it for each adapter.
Thanks.

@davedevelopment
Copy link
Owner

Hi there

It's definitely something you could do, but for such as small library I don't think it's worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants