PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 31, 2022

[FIXED] how to develop another sub-module along with the main application. [composer,php]

 January 31, 2022     composer-php, package, php     No comments   

Issue

I know how git submodules works, and how we can use it..

now i am in situation where main application that depends on many other composer packages and along with that i have to made and develop a small another package that will be separate from main project (kind of lib.)

so how can i develop this small package along with main project without making it separate project and without publishing to any vcs just withing that project directory. so later i can take it out and do whatever i want.

i don't think that i need to place my code in /vendor directory and start developing there (don't know if its possible?)

whats the best way you think i have not so much experience with composer but now loving it.

[actually its not sub module, its just a dependency for main application]


Solution

You can always separate that part of the code later into a package of it's own, and avoid having to create a separate repository for that small code part. Doing this would probably mean you create a separate namespace for this library, keep it separate in the directory structure (you know you can have more than one key-value-pair for PSR-0 or PSR-4 autoloading in your main composer.json), and when the time has come, you move the code into a package, also split the autoload definition (i.e. delete the library autoloading in the main package and add an appropriate version of it into the new Composer library).

On the other hand, the question is how keen you are grabbing all that development history later if you do separate this library into a new Composer package? Why not start with a dedicated repository right now? But even if you want to have both, Git has a tool for this: Detach (move) subdirectory into separate Git repository



Answered By - Sven
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing