Working with zend framework and git in large projects
Asked Answered
G

1

12

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?

Gallantry answered 6/7, 2012 at 8:10 Comment(6)
You could always put the static resources (CSS, JS, etc) inside your module directory and either copy them to public as a build task or create symlinks in publicPrecipitancy
sounds to me like a similar problem that I once had: #6681268Loos
In ZF2 the modules are fully independent, they can be attached as a submodule (completely separate repo), but in ZF1 with its given structure this is not possible.Etalon
I do not know about the Zend part, but I think the submodule funtion of git might be useful in this case. git-scm.com/book/en/Git-Tools-SubmodulesElianore
@AlexDicianu: opened bounty hoping that solving your problem could also solve my problem...Loos
This answer might work for you: https://mcmap.net/q/533478/-clone-parts-of-a-github-project-duplicateTenet
D
2

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.

Donatelli answered 26/7, 2012 at 10:32 Comment(3)
regarding symlinks: could this work on Win32 with junctions (technet.microsoft.com/en-us/sysinternals/bb896768.aspx, en.wikipedia.org/wiki/Symbolic_link#NTFS_Junction_points)?Loos
@Loos this might work, haven't tried it yet. But from a quick research, it seems to implement the same feature as a unixoid symlink. Do you have a windows system to test it on?Donatelli
only XP. And the really interesting thing (NTFS symbolic links that support also files, not only folders, en.wikipedia.org/wiki/NTFS_symbolic_link) doesn't work there but needs at least Vista.Loos

© 2022 - 2024 — McMap. All rights reserved.