convert-mapping with --namespace param doesn't output in correct directory #5707

Closed
opened 2026-01-22 15:15:06 +01:00 by admin · 4 comments
Owner

Originally created by @PeeHaa on GitHub (Sep 21, 2017).

Originally assigned to: @Ocramius on GitHub.

I am trying to run convert-mapping from the database, but the generated files end up in the wrong location because of the namespace parameter.

Path of my project: /var/www/someprojectname.
Path I want my entities to end up in: /var/www/someprojectname/src/Storage/Doctrine/Entity.
Namespace of the project: Gitlicious.
Root of namespace /var/www/someprojectname/src.

Command I run

vendor/bin/doctrine orm:convert-mapping --namespace="Gitilicious\\Storage\\Doctrine\\Entity\\" --force  --from-database annotation src/Storage/Doctrine/Entity

Expected result

The generated entities end up directly under /var/www/someprojectname/src/Storage/Doctrine/Entity.

Actual result

The generated entities instead end up under /var/www/src/someprojectname/Storage/Doctrine/Entity/Gitilicious/Storage/Doctrine/Entity.

Note: When I don't pass the --namespace parameter the files end up where I expect them (without the namespace obviously).

There is a (rather big) chance I am doing something stupid, but I don't see it.

Originally created by @PeeHaa on GitHub (Sep 21, 2017). Originally assigned to: @Ocramius on GitHub. I am trying to run `convert-mapping` from the database, but the generated files end up in the wrong location because of the namespace parameter. Path of my project: `/var/www/someprojectname`. Path I want my entities to end up in: `/var/www/someprojectname/src/Storage/Doctrine/Entity`. Namespace of the project: `Gitlicious`. Root of namespace `/var/www/someprojectname/src`. **Command I run** vendor/bin/doctrine orm:convert-mapping --namespace="Gitilicious\\Storage\\Doctrine\\Entity\\" --force --from-database annotation src/Storage/Doctrine/Entity **Expected result** The generated entities end up directly under `/var/www/someprojectname/src/Storage/Doctrine/Entity`. **Actual result** The generated entities instead end up under `/var/www/src/someprojectname/Storage/Doctrine/Entity/Gitilicious/Storage/Doctrine/Entity`. *Note: When I don't pass the `--namespace` parameter the files end up where I expect them (without the namespace obviously).* There is a (rather big) chance I am doing something stupid, but I don't see it.
admin added the ImprovementWon't Fix labels 2026-01-22 15:15:06 +01:00
admin closed this issue 2026-01-22 15:15:07 +01:00
Author
Owner

@Ocramius commented on GitHub (Sep 21, 2017):

Doctrine doesn't and won't support PSR-4 namespace prefixing: we're the one
of the projects that voted against PSR-4 specifically for the prefixing
quirkyness that requires a lot of additional work in multiple layers.

On 21 Sep 2017 19:07, "Pieter Hordijk" notifications@github.com wrote:

I am trying to run convert-mapping from the database, but the generated
files end up in the wrong location because of the namespace parameter.

Path of my project: /var/www/someprojectname.
Path I want my entities to end up in: /var/www/someprojectname/src/
Storage/Doctrine/Entity.
Namespace of the project: Gitlicious.
Root of namespace /var/www/someprojectname/src.

Command I run

vendor/bin/doctrine orm:convert-mapping --namespace="Gitilicious\Storage\Doctrine\Entity\" --force --from-database annotation src/Storage/Doctrine/Entity

Expected result

The generated entities end up directly under /var/www/someprojectname/src/
Storage/Doctrine/Entity.

Actual result

The generated entities end up directly under /var/www/src/someprojectname/
Storage/Doctrine/Entity/Gitilicious/Storage/DoctrineEntity.

Note: When I don't pass the --namespace parameter the files end up where
I expect them.

There is a (rather big) chance I am doing something stupid, but I don't
see it.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6716, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakEKzfXqg8CzsAIyX8HlJq7-CKBg9ks5skpe5gaJpZM4Pfoiv
.

@Ocramius commented on GitHub (Sep 21, 2017): Doctrine doesn't and won't support PSR-4 namespace prefixing: we're the one of the projects that voted against PSR-4 specifically for the prefixing quirkyness that requires a lot of additional work in multiple layers. On 21 Sep 2017 19:07, "Pieter Hordijk" <notifications@github.com> wrote: > I am trying to run convert-mapping from the database, but the generated > files end up in the wrong location because of the namespace parameter. > > Path of my project: /var/www/someprojectname. > Path I want my entities to end up in: /var/www/someprojectname/src/ > Storage/Doctrine/Entity. > Namespace of the project: Gitlicious. > Root of namespace /var/www/someprojectname/src. > > *Command I run* > > vendor/bin/doctrine orm:convert-mapping --namespace="Gitilicious\\Storage\\Doctrine\\Entity\\" --force --from-database annotation src/Storage/Doctrine/Entity > > *Expected result* > > The generated entities end up directly under /var/www/someprojectname/src/ > Storage/Doctrine/Entity. > > *Actual result* > > The generated entities end up directly under /var/www/src/someprojectname/ > Storage/Doctrine/Entity/Gitilicious/Storage/DoctrineEntity. > > *Note: When I don't pass the --namespace parameter the files end up where > I expect them.* > > There is a (rather big) chance I am doing something stupid, but I don't > see it. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/doctrine/doctrine2/issues/6716>, or mute the thread > <https://github.com/notifications/unsubscribe-auth/AAJakEKzfXqg8CzsAIyX8HlJq7-CKBg9ks5skpe5gaJpZM4Pfoiv> > . >
Author
Owner

@PeeHaa commented on GitHub (Sep 21, 2017):

Why are you touching the path at all instead of just dumping the files in the directory I tell to use with the namespace I tell it to use?

Where is the extra work? What am I missing?

@PeeHaa commented on GitHub (Sep 21, 2017): Why are you touching the path at all instead of just dumping the files in the directory I tell to use with the namespace I tell it to use? Where is the extra work? What am I missing?
Author
Owner

@Ocramius commented on GitHub (Sep 21, 2017):

The class will be generated with a PSR-0 compliant path structure

On 21 Sep 2017 19:37, "Pieter Hordijk" notifications@github.com wrote:

Why are you touching the path at all instead of just dumping the files in
the directory I tell to use with the namespace I use?

Where is the extra work? What am I missing?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6716#issuecomment-331228422,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakDDFvhxngrl5BkRrgGSyD_7gZ7S-ks5skp7JgaJpZM4Pfoiv
.

@Ocramius commented on GitHub (Sep 21, 2017): The class will be generated with a PSR-0 compliant path structure On 21 Sep 2017 19:37, "Pieter Hordijk" <notifications@github.com> wrote: > Why are you touching the path at all instead of just dumping the files in > the directory I tell to use with the namespace I use? > > Where is the extra work? What am I missing? > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/doctrine/doctrine2/issues/6716#issuecomment-331228422>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AAJakDDFvhxngrl5BkRrgGSyD_7gZ7S-ks5skp7JgaJpZM4Pfoiv> > . >
Author
Owner

@lcobucci commented on GitHub (Nov 26, 2017):

Closing as Won't Fix due to @Ocramius comments.

@lcobucci commented on GitHub (Nov 26, 2017): Closing as `Won't Fix` due to @Ocramius comments.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5707