Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with zend framework and git in large projects

I'm having some problems working with zf and git in a pretty large project. The zf application has about 20 modules and for the moment everything is stored in a single git repository. So when you checkout the application, you checkout the entire set of modules, css sheets, js files, etc.

What I would like to do, is something like in wordpress or drupal: you have your core application and for each module you have a separate git repository that you checkout in the modules directory. After checkout, you work on it and then you commit it. But with zend you can't do this because the media files (css, js, images) are stored in a way different directory in /public (each module may have it's own css, js files in /public/_MODULE_NAME_/css for example). I am working in /application/modules/.

So the question is how do you work with zend framework modular applications and git?

like image 766
Alex Dicianu Avatar asked Jul 06 '12 08:07

Alex Dicianu


1 Answers

I usually manage to cope with a setup of soft links, having one super project in the webfolder and symlinking the Modules from a different folder in:

* SuperProject/
  + application/
    + ModuleA --> ../../Modules/ModuleA/application
    + ModuleB --> ../../Modules/ModuleB/application
    + config/
    + views/
    + layouts/
  + public/
    + ModuleA --> ../../Modules/ModuleA/public
    + ModuleB --> ../../Modules/ModuleB/public
    + css/
    + js/
  + library/
+ Modules/
  * ModuleA/
    + application/
      + config/
      + views/
      + models/
    + public/
      + css/
      + js/
  * ModuleB/
    + application/
      + config/
      + views/
      + models/
    + public/
      + css/
      + js/

The starred directories are repositories, the SuperProject/public is the entry point for the http server (with symlinks follow enabled of course). You obviously do not add any Module-Files in your SuperProject repository, but only changes in the global directories (e.g. application/config/) - at best, you ignore the Modules through the .git_ignore-file. As this method relies on symlinks, it will only work on unixoid systems. While not being perfect, it's the least hassle.

like image 72
Lars Avatar answered Nov 15 '22 15:11

Lars