嵌套Silex应用程序

How would one go about nesting Silex applications?

I'm setting up a project demo for my client such that they will be able to visit mydomain.net/project/demo and see their site live.

My directory structure:

www
  mydomain.net
    projects
        client_project
          app
            web
              index.php    <-client project front controller
        another_client_project
          app
            web
              index.php    <-another client project front controller
    src
    vendor
    web   <-apache docroot
      index.php    <-front controller for my site

So my thinking is that I should be able to create a route on my front controller that just refers the user agent to one of the nested, client project specific front controllers. The url might look like: http://mydomain.net/projects/client_project/

Silex has a convenient facility for making what they call a sub request, like so:

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

$app->get('/', function () use ($app) {
    // redirect to /hello
    $subRequest = Request::create('/hello', 'GET');

    return $app->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
});

So... this is where I run aground. Can I just fashion a request that refers to a given nested front controller? Will this require some mod_rewrite action?

Since you probably used mod_rewrite (or its analog in nginx, lighttpd, etc) to feed everything to index.php for routing, you can also use that to build these nested applications. Just build a rewrite pattern for each client project and send it to the client-specific index.php