A
A
azverin2012-09-16 16:39:26
PHP
azverin, 2012-09-16 16:39:26

How to organize a project or two repositories into one folder?

I'm scratching my head about how best to organize the structure of the project.

It is written:
1. A framework with a certain folder structure.
2. CMS based on this framework.

The folder structure in the framework is as follows:

  common - resources common to the system (JS, CSS frameworks)
  files - files saved in the system by the user (uploads)
  html - layout
  inc - main system folder
      app - application-specific classes (empty)
      ctrl - controllers (empty)
      lib - framework base class library
      test - tests
      tmpl - templates (there is a default folder from the framework, the rest is in .gitignore)
  tmp - temporary files


It is assumed that both the framework and the CMS can have their files in the common, inc/tmpl, inc/test folders.
The CMS itself lives in inc/app and inc/ctrl. CMS customization for the project changes files in inc/app, inc/ctrl, html
The entire folder structure is already set in the framework, respectively. The CMS needs to be softly “overlaid” on top of this.

I would like to maintain the entire project in the version control system (VCS), now it is GIT. And ideally, CMS customization for a specific project should also be started in VCS in order to transparently update both the framework and the CMS.

As far as I understand the externals mechanism, you can connect an external repository to a separate folder and it will be updated there, but CMS needs to be embedded in the tree at several levels.

The option as done in symfony - the repository lies somewhere in the wilds, and then it unfolds by running the script and creates the desired folder structure somehow I don’t really like it.

In principle, you can put two repositories side by side, and then merge them with scripts, but maybe there are some normal options? Is it possible to somehow dodge with the branches?

UPD: I thought about the branches, probably this is really the best option, but there is one more difficulty. I want the repository with the framework and CMS to be open, and client projects are no longer available to the general public.
Maybe some other problems can be encountered when maintaining a bunch of branches?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nashev, 2012-09-16
@Nashev

As long as you have only 2 components planned, the user may be allowed to have one more for their improvements. Each of them can replace some files of a deeper layer with their own, and use these overlapped ones if necessary. It is better when the code of different levels is not mixed.
Surely it is possible to make folders in the framework for these “overlays”, essentially repeating the original structure, and one function to determine the path for any used file that searches in these three (and not 100500) possible places ... And use all the files through it ...
Although - this is an option to remake the framework, and this may not be possible. You can try to keep two repositories of DIFFERENT SLEs in the same folder - git and hg, for example, or git and svn. And for each of these systems, keep your own set of ignore lists and maintain it ... On the other hand, if the CMS makes its own changes to the files (the same templates, for example) of the framework, then you will need one file in two versions, and in one folder of this not to do.
There is an option to have different branches of the same repository, and from time to time to merge into a branch with CMS without merging edits from the framework branch ... Also a possible option, yes ... Maybe even the best in the described situation. Did you write about this option in the UPD?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question