Le 12/03/2011 22:51, pzwosta a écrit :
Hi,

I try to include a 3rd party (Zend) class. The directory structure is
like that:

\vendor
      \name
            \lib
                \name
                     Class.php (includes class Name_Class)
                      \Subdir
                            SubClass (includes Name_Subdir_SubClass)


//Class.php
require_once 'name/Subdir/SubClass.php';

I can use Name_Class.php by adding name as a prefix in app
\autoload.php

$loader->registerPrefixes(array(
    Name_'            =>  __DIR__.'/../vendor/name/lib',

But I get an error on require_once - SubClass.php is not found.

Does anyone have an idea how to handle that without changing the
vendor files?

Thanks Peter

When using autoloading you should not use require_once but let the autoloader find it.

In the current case, using require_once in Class.php the way you wrote would require adding the /path/to/vendor/name/lib directory in the include_path

--
Christophe | Stof

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to