Wait, I see what you did: You bound 2 directories to an empty namespace. Using
an empty namespace is definitively not recommended.
Please map _all_ (root) namespaces you use to the correct directory/ies.
A common convention is to create a single root namespace for your project, or 1
for each module. So your entities would live in the namespace "Cms\ Entities"
for example. The configure autoload like this:
"autoload": {
"psr-0": { "Cms\\": "/src/Cms" }
},
--
Jasper N. Brouwer
(@jaspernbrouwer)
On 12 November 2014 at 21:57:44, Jasper N. Brouwer ([email protected]) wrote:
> That doesn't look correct.
>
> Try this:
>
> "autoload": {
> "psr-0": { "Entities\\": "module/Cms/src/Cms/Entities" }
> },
>
> I'm not sure the path there is correct, could be just "src/Cms/Entities". In
> any case,
> it should be the path relative to your `composer.json` where your entities
> reside.
>
> You can find more info on this here:
> https://getcomposer.org/doc/04-schema.md#autoload
>
> --
> Jasper N. Brouwer
> (@jaspernbrouwer)
>
>
> On 12 November 2014 at 21:16:30, Antenne ([email protected]) wrote:
> > Hey Jasper,
> >
> > sorry for the late response, I have configured my composer in the following
> > way:
> >
> > "autoload": {
> > "psr-0": {
> > "": ["model/Entities/", "src/"]
> > }
> >
> > I did not run the commands you mentioned. Is this one time only or do I
> > have to rerun the commands?
> >
> > Thanks!
> >
> > Op dinsdag 4 november 2014 10:00:13 UTC+1 schreef Jàπ (Jasper N. Brouwer):
> > >
> > > I'm guessing you perform a `composer.phar install --optimize-autoloader`,
> > > `composer.phar dump-autoload --optimize`, or something similar?
> > >
> > > If so, then I suggest you _don't_ optimize the autoloader in development.
> > >
> > > Composer won't create a class-map, but will use it's default PSR-1 / PSR-4
> > > dynamic autoloader, which will always find new classes. A class-map will
> > > speed up autoloading slightly, so it's a good idea on non-development
> > > environments, but as you've noticed it's not convenient in development.
> > >
> > > --
> > > Jasper N. Brouwer
> > > (@jaspernbrouwer)
> > >
> > >
> > > On 3 November 2014 at 20:30:17, Antenne ([email protected]
> > > ) wrote:
> > > > Hi Jasper,
> > > >
> > > > thanks a million, indeed it is a classloading issue, I regerated my
> > > > autoload classmap and that fixed the issue.
> > > > Is there an easier way to deal with this? Now I have to regenerate my
> > > > classmap every time I add a model class.
> > > >
> > > > Thanks!!
> > >
> > >
> > >
> >
> > --
> > 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.