0

Situation

I have a Base Symfony app which can be compared to an abstract class.
I have multiple Customer Symfony apps, all based from the Base app.
Customer apps are simple websites, each with different (read-only) data, themes, etc.

Base app - does NOT function as stand-alone

  • .htaccess files, AppKernel, config.yml, etc.
  • multiple vendor bundles
  • Base bundle with some base views
  • lacks Controller
  • lacks routing
  • lacks customer-specific resources

Customer - contains elements missing from Base app

  • "injected" into Base app
  • Controller(s)
  • routing
  • customer-specific resources (views, css, js, data, etc.)

Using git, and would prefer to create a git repo out of the Base code, with each Customer repo referencing Base repo as submodule.
This keeps Base code in one repository and maintains a clean separation between Customer repos.

root\ - (Customer repo)
    Customer\ - (Customer-specific files)
    Symfony\ - (Base app submodule repo)
       app\
       src\
          MyCompany\
             BaseBundle\
       vendor\
       web\

Sticking Point

Unable to get Symfony to recognize the Customer\ folder, nor any of its contents.

Specs

  • Symfony 2.3
  • Git
  • Apache 2.4.4
  • PhpStorm
  • Windows 7 x64

Failed Attempts

  • adding Customer bundle to AppKernel.php registerBundles
  • registering the Customer\ folder in autoload.php
4

1 回答 1

0

Customer\使用外部目录作为源和目标内部目录创建一个 Junction 符号链接MyCompany\

在 Symfony (submodule) repo 的.gitignore中,添加customer/忽略连接符号链接。

root\ - (客户回购)
    客户\ -(符号链接源)
    Symfony\ - (git 子模块)
       应用程序\
       源\
          我的公司\
             基础包\
             客户\ -(连接符号链接)
       小贩\
       网络\

Windows 或 Linux 上的符号链接(符号链接)完整指南

于 2013-09-01T14:33:44.163 回答