views:

305

answers:

1

I am building a Symfony project, and have created a new plug-in named sfUtilsPlugin. I currently have a directory structure that looks like this:

sfUtilsPlugin/
    modules/
        sfSearchLucene/
            actions/
            config/
            lib/
            templates/

Now, in the sfUtilsPlugin/modules/sfSearchLucene/lib directory, I have an object called sfLucene. The idea was that this object is accessible from the Symfony auto loading mechanism, so that it can be instantiated from anywhere within the application.

However, simply adding the sfLucene.class.php file to the sfUtilsPlugin/modules/sfSearchLucene/lib directory does not appear to add it to the autoloader.

Does anyone out there know why this might be happening? Perhaps it is just not possible to automatically use objects stored in this location inside Symfony.

Any advice is appreciated, thank you.

+1  A: 

Because you are adding this class in lib subdirectory of module sfLucene, it will be autoloaded only if current module is sfLucene.

You have two options:

  1. put this class somewhere into sfUtilsPlugin/lib directory;
  2. require them every time you need it
develop7