0

I am developing a Symfony2 web app that will be hosted on an Ubuntu server and want my directory structure to be:
/Symfony (with an app,bin and vendor folder in it)
/Site1
/Site2

This way site1 and site2 use the same Symfony framework. In /Site1 I want: /web
and in there I want app.php and app_dev.php as well as /web/AppBundle with all of the bundle files. I already figured out that I need to change in app.php require_once DIR.'/../Symfony/app/AppKernel.php'; in 2 places as per http://symfony.com/doc/current/cookbook/configuration/override_dir_structure.html

When I generated the bundle I did get the message "Checking that the bundle is autoloaded: FAILED" and that I should "Edit the composer.json file and register the bundle namespace in the "autoload" section"

I added "AppBundle": "/web/AppBundle" to the composer.json autoload section and in cygwin I run "composer -n install" It starts with saying that it is loading composer repositories and then it says "Installing dependencies (including require-dev)" and never goes past that.

What can I do to register this bundle that is not in the standard folder so that autoload picks it up? I am just getting the fact that the class could not be found in AppKernel.php

Thanks.

1
  • You will need to add you paths to app/autoload.php. But life is way too short to fool around with this sort of stuff. Just do things the Symfony way or use a different framework.
    – Cerad
    Sep 30, 2015 at 20:52

1 Answer 1

0

It's simple. Just don't do it! Use symfony as it is intended with its default directory structure.

Great two projects. If you have common code, extract it to an extra bundle and install it in both projects via composer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.