Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 715555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:12:01+00:00 2026-05-14T05:12:01+00:00

I want to use a single Doctrine install on our server and serve multiple

  • 0

I want to use a single Doctrine install on our server and serve multiple websites. Naturally the models should be maintained in the websites’ modelsfolder.

I have everything up (and not running) like so:

Doctrine @

/CustomFramework/Doctrine

Websites @

/var/www/vhosts/custom1.com/
/var/www/vhosts/custom2.com/

Generating works fine, all models are delivered in /application_folder/models and /application_folder/models/generated for the correct website.

I’ve added Doctrine::loadModels(‘path_to_models’) in the bootstrap file for each website, and also registered the autoloaded.

But….

This is the autoloader code:

public static function autoload($className)
{
    if (strpos($className, 'sfYaml') === 0) {
        require dirname(__FILE__) . '/Parser/sfYaml/' . $className . '.php';
        return true;
    }

    if (0 !== stripos($className, 'Doctrine_') || class_exists($className, false) || interface_exists($className, false)) {
        return false;
    }

    $class = self::getPath() . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

    if (file_exists($class)) {
        require $class;

        return true;
    }

    return false;
 }

Am I stupid, or is the autoloader really doing this:

$class = self::getPath() . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

or, in other words: Does it require me to have ALL my generated doctrine classes inside the Doctrine app directory? Or in other words, do I need a single Doctrine installation for each website?

I’m getting an error that the BaseXXX class cannot be found. So the autoloading doesn’t function correctly. I really hope i’m doing something wrong.. anyone?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:12:01+00:00Added an answer on May 14, 2026 at 5:12 am

    Starting from Doctrine 1.2, the models autoloading is dealt by another autoloader, Doctrine_Core::modelsAutoload. This allows you to separate your library loading and models loading (if you want to use some other autoloader for loading the library classes).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use MOSS 2007's single sign-on feature, but read that the server
I want to use a single image sprite for my web page, where should
I want to use two meta:resourcekey in single control is it possible? for example
I want to use Powershell to write some utilities, leveraging our own .NET components
Attention advanced Freemarker gurus: I want to use a single freemarker template to be
I've an ASP.NET form view with multiple forms. I want to use only a
Is the standard MySQL JDBC driver thread-safe? Specifically I want to use a single
I want to share a single authentificaition method for to Symfony websites sharing the
In my Android app, I want to use a single variable for the log
I want to define with language I want to use on a single call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.