I am trying to get on the Composer / Packagist train, and to that end, I am trying to make sense of the best way to manage my workflow so that I can create composer pacakges with my framework of choice and application but damned if I can sort out a way to do it with Git/Github or Hg/BitBucket (or both).
Current Structure/Workflow
%path%/sites/[framework]
- contains up to date framework git repo
%path%/sites/[framework]/application
- contains app specific code and is a bitbucket repo
*%path%/www/[appname]_public
- contains public files and is a bitbucket repo i.e. "public_html" folder
With properly aliasing, this works for my current sites (each site is a separate folder in “/sites”). And since I use two separate repo mechanisms, I can update the framework for that particular site whenever I want without it really hurting my application and vice versa.
Since the packages are contained as subfolders of the “application” folder (so I can create and test them), how can I “wrap” those folders as packages as separate repos so that I can provide them as standalone composer packages available on github or bitbucket? I am kind of at a loss.
%path%/sites/[framework]/application/[module]
- contains controllers, models, views, etc... to be wrapped up as a composer
"package" and made available on github or bitbucket as its own repo.
Perhaps someone here can give me a hand with the logic on this, or how to set it up, as I can’t fathom how to do it. Is it possible? Am I over/under thinking the issue?
Maybe my whole way of thinking is wrong. With my existing structure I was trying to accomplish the task, but Git Submodules or HG nested repos don’t seem to work the way I had anticipated.
Is my workflow seriously flawed or do I need more Git knowledge to accomplish this? Is there an easier / better way? I will happily rebuild my structure/workflow if I can keep the Framework / SiteApplicationCode / Packages as separate repos with some mechanism / logic I am missing.
Thanks in advance for any assistance.
%path%/sites/[framework]/application/[module] should be a git repository that you share with others by pushing it to some public (public to your company only if you want) location, say git.yourcompany.com .
Then, you may create a satis composer repository accessible at satis.company.com, that you will initialize with a json file referencing your public repositories. Make sure you a create composer.json file for each of your modules first, to make them composer-installable.
Then, reinstall your project using a composer.json file per application, that will fetch the desired modules at the desired version.
They will appear in %path%/sites/[framework]/application/vendor/ and an autoload file will be generated.
If your code can be published on github, you can skip the git+satis part and submit your modules to packagist.org
I may have misunderstood your structure, but I hope you get the idea