Hi Roy,

This is probably not really a Doctine issue, but to prevent class-loading
problems, you might want to consider adopt composer
<https://getcomposer.org> for your project(s). Specifically see:
https://getcomposer.org/doc/04-schema.md#autoload

You can use the command line to generate a classmap for all the classes in
your project:
composer dump-autoload --optimize

The generated classmap is a simple PHP file, that can also be OPCODE cached
which is good for performance when you use a lot of classes.

Somewhere in the beginning of your request processing cycle put:

$loader = require APPLICATION_ROOT . '/vendor/autoload.php';

And voila, all your classes should be 'findable'. For the Doctrine
command-line tools, this might mean you have to add this line to the
doctrine.php file

Additional info you can find in the PSR-0
<http://www.php-fig.org/psr/psr-0/> and PSR-4
<http://www.php-fig.org/psr/psr-4/> guidelines. Personally I prefer using
TitleCase namespaces, although that is not part of the guidelines...

And you can also use a more readable:
use cnrepperson\util\StatusBitmap;
class ForumRolePermissions extends StatusBitmap {}

Hope this information helps you a bit.

Cheers!


On 15 July 2014 22:29, Roy Epperson <[email protected]> wrote:

>
> Neither of these solved the problem.  As I wrote the cli_config.php file,
> it used the "vendor/ClassLoader" require statement which did not find the
> classes in cnrepperson\util namespace.  By including the that directory in
> the driverpath Doctrine uses to find entities to create schema for,
> Doctrine complained about not being able to find classes used by classes in
> that namespace. None of those are "doctrine entities".
>
> So I included my own classloader to search "supporting" classes which are
> not Doctrine entities but are used by Doctrine entities which solves the
> problem.
>
> Roy
>
>
>
> On Monday, July 7, 2014 10:02:36 PM UTC-7, Roy Epperson wrote:
>>
>> When I use the subject command line(s) (following), I get a message a
>> Fatal Error that a class in another directory is not found.
>>
>> C:\Roy\websites\php_projects>vendor\bin\doctrine orm:schema-tool:create
>> using classpaths:
>>     C:\Roy\websites\php_projects\classes\cnrepperson\forum
>>     C:\Roy\websites\php_projects\classes\cnrepperson\util
>>
>> Fatal error: Class 'cnrepperson\util\StatusBitmap' not found in
>> C:\Roy\websites\
>> php_projects\classes\cnrepperson\forum\ForumRolePermissions.class.php on
>> line 5
>>
>> The project's layout and classpaths passed to create an EntityManager:
>>
>>
>>    1. In C:\Roy\websites\php_projects\classes\cnrepperson\util is the
>>    file StatusBitmap.class.php who's intro is:
>>
>>    <?php
>>    namespace cnrepperson\util;
>>
>>     class StatusBitmap {
>>    2. In  C:\Roy\websites\php_projects\classes\cnrepperson\forum is the
>>    file ForumRolePermissions.class.php who's intro is:
>>
>>    <?php
>>    namespace cnrepperson\forum;
>>
>>    class ForumRolePermissions extends  cnrepperson\util\StatusBitmap{
>>    3. $driverImpl = $config->newDefaultAnnotationDriver( array(
>>            realpath(dirname(__FILE__) .'/../classes/cnrepperson/forum'),
>>            realpath(dirname(__FILE__) .'/../classes/cnrepperson/util'),
>>    ));
>>
>>    $config->setMetadataDriverImpl($driverImpl)
>>
>>
>> This is the first time I've tried to extends classes in one
>> directory(namespace) with a subclass in another directory(namespace). In
>> the past I've only subclass within the same directory.
>>
>> What I've I done wrong?
>>
>> Roy
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to