0
votes

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
1

1 Answers

0
votes

Create a Junction symbolic link using the external Customer\ directory as the source and the destination inside MyCompany\ directory.

In Symfony (submodule) repo's .gitignore, add customer/ to ignore the junction symlink.

root\ - (Customer repo)
    Customer\ - (symlink source)
    Symfony\  - (git submodule)
       app\
       src\
          MyCompany\
             BaseBundle\
             Customer\ - (Junction symlink)
       vendor\
       web\

Complete Guide to Symbolic Links (symlinks) on Windows or Linux