Application structure question. Parent/Child, Brother/Sister, or Distinct?

My site has a public facing CMS-based website at http://customer.example.com , as well as a quasi-related management application at http://customer.example.com/myapp (MyApp uses data from the CMS site and vice versa). My question is, what is the best way to structure this, to allow for code and model sharing? Options:

  1. sibling modules:

MySite

  Modules

    CMS

    MyApp

  1. parent child applications:

MyApp

  protected

    CMS

[it has to be this way, as the CMS is optional]

  1. Distinct

CMS


MyApp

What is the best way to share models and common code in #3?

CMS and MyApp will use different themes

will be using RBAC

Which will lead to the fewest headaches down the road?

It it helps to know, i am using SVN and netbeans as well.

Thanks!

i think i will go with what qiang uses, as described here:

http://www.yiiframework.com/wiki/155/the-directory-structure-of-the-yii-project-site/