DDC-1136: Prevent backup files to be recognized as valid Entity files #1423

Closed
opened 2026-01-22 13:13:53 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (May 5, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user fabpot:

The Doctrine2 generator backup Entity files when it adds code into them. The files are named after the original file with a prepended.

The problem is that these backup files are valid PHP files, and as such, they are loaded by Doctrine2. A PHP fatal error is then fired: "Cannot redeclare class...".

Instead of prepending , why not appending , which is a well supported convention? (foo.php vs ~foo.php)

Patch is here: https://github.com/doctrine/doctrine2/pull/35

Originally created by @doctrinebot on GitHub (May 5, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user fabpot: The Doctrine2 generator backup Entity files when it adds code into them. The files are named after the original file with a <sub> prepended. The problem is that these backup files are valid PHP files, and as such, they are loaded by Doctrine2. A PHP fatal error is then fired: "Cannot redeclare class...". Instead of prepending </sub>, why not appending <sub>, which is a well supported convention? (foo.php</sub> vs ~foo.php) Patch is here: https://github.com/doctrine/doctrine2/pull/35
admin added the Bug label 2026-01-22 13:13:53 +01:00
admin closed this issue 2026-01-22 13:13:54 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 14, 2011):

Comment created by @beberlei:

Applied and merged to 2.0.x

@doctrinebot commented on GitHub (May 14, 2011): Comment created by @beberlei: Applied and merged to 2.0.x
Author
Owner

@doctrinebot commented on GitHub (May 14, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (May 14, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1423