Download the PHP package eprofos/reverse-engineering-bundle without Composer
On this page you can find all versions of the php package eprofos/reverse-engineering-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eprofos/reverse-engineering-bundle
More information about eprofos/reverse-engineering-bundle
Files in eprofos/reverse-engineering-bundle
Package reverse-engineering-bundle
Short Description Advanced Symfony bundle for database reverse engineering - Automatically generates Doctrine entities from existing database schemas with intelligent type mapping, relationship detection, and comprehensive metadata extraction capabilities
License MIT
Homepage https://github.com/eprofos/reverse-engineering-bundle
Informations about the package reverse-engineering-bundle
ReverseEngineeringBundle
Advanced Symfony Bundle for Database Reverse Engineering - Automatically generate Doctrine entities from existing databases with advanced features and comprehensive testing.
Developed to simplify legacy application migration and modernization with enterprise-grade reliability.
🚀 Key Features
- Multi-Database Support: MySQL, PostgreSQL, SQLite with comprehensive type mapping
- Automatic Entity Generation: PHP 8+ attributes with intelligent property mapping
- Advanced Type Mapping: Smart conversion of database types to PHP/Doctrine types
- 🆕 PHP 8.1 Backed Enum Support: Automatic generation of type-safe enum classes from MySQL ENUM columns
- Relationship Detection: Automatic ManyToOne relationship generation
- Repository Generation: Doctrine repositories with customizable templates
- Intuitive CLI Interface: Rich command-line interface with extensive options and validation
- Dry-Run Mode: Preview changes before applying them with detailed output
- Custom Namespaces: Flexible namespace configuration for organized entity structure
- Performance Optimized: Efficient processing of large databases with batch operations
📋 Requirements
- PHP: 8.1 or higher with required extensions
- Symfony: 7.0 or higher with full framework support
- Doctrine DBAL: 3.0 or higher for database abstraction
- Doctrine ORM: 2.15 or higher for entity management
- PHP Extensions: PDO with appropriate drivers for your database system
- Memory: Minimum 128MB for processing medium-sized databases
📦 Installation
Install via Composer
Register the Bundle
The bundle should be automatically registered in config/bundles.php
. If not, add it manually:
🔧 Database Support
Supported Database Systems
Database | Version | Driver | ENUM/SET | Relations | Status |
---|---|---|---|---|---|
MySQL | 5.7+ | pdo_mysql | ✅ Tested | ✅ ManyToOne | ✅ Complete |
PostgreSQL | 12+ | pdo_pgsql | ❌ Todo | ❌ Not tested | ❌ Todo |
SQLite | 3.25+ | pdo_sqlite | ❌ Not tested | ❌ Not tested | ❌ Not tested |
Relationship Support Progress
- ✅ ManyToOne: Fully implemented and tested
- ❌ OneToMany: Todo - planned for next release
- ❌ OneToOne: Todo - planned for future release
- ❌ ManyToMany: Todo - planned for future release
Type Mappers
- ✅ MySQLTypeMapper: Complete implementation
- ❌ PostgreSQLTypeMapper: Todo - in development
- ❌ SQLiteTypeMapper: Todo - planned for future release
⚙️ Configuration
Create your configuration file at config/packages/reverse_engineering.yaml
:
Basic Configuration
PostgreSQL Configuration
SQLite Configuration
Advanced Configuration
🎯 Usage
Basic Command
Step-by-Step Usage
1. Preview Changes (Dry Run)
2. Generate Specific Tables
3. Exclude System Tables
4. Custom Namespace and Directory
5. Force Overwrite Existing Files
Advanced Usage Examples
Modular Entity Generation
Command Options Reference
Option | Short | Description | Default |
---|---|---|---|
--tables |
-t |
Specific tables to process | All tables |
--exclude |
-e |
Tables to exclude | None |
--namespace |
-n |
Entity namespace | From config |
--output-dir |
-o |
Output directory | From config |
--force |
-f |
Force overwrite existing files | false |
--dry-run |
-d |
Preview mode (no files created) | false |
--verbose |
-v |
Verbose output | false |
📋 Generated Entity Examples
MySQL Database Example
Database Schema:
Generated User Entity
Generated Enum Class
Generated Product Entity with ManyToOne Relationship
🆕 PHP 8.1 Backed Enum Support
The bundle automatically generates PHP 8.1 backed enum classes from MySQL ENUM columns, providing type safety and better IDE support.
Type-Safe Usage Example
Enum Configuration
Configure enum generation in your configuration file:
🔧 Supported Data Types
MySQL Data Types (Fully Tested ✅)
MySQL Type | PHP Type | Doctrine Type | Notes |
---|---|---|---|
INT , INTEGER , BIGINT , SMALLINT , TINYINT |
int |
integer |
Auto-increment detection |
FLOAT , DOUBLE , REAL |
float |
float |
Precision preserved |
DECIMAL , NUMERIC |
string |
decimal |
Precision and scale preserved |
BOOLEAN , BOOL |
bool |
boolean |
Default values supported |
DATE , DATETIME , TIMESTAMP , TIME |
DateTimeInterface |
datetime |
Timezone aware |
VARCHAR , CHAR , TEXT , LONGTEXT |
string |
string |
Length constraints |
JSON |
array |
json |
Native JSON support |
BLOB , LONGBLOB |
string |
blob |
Binary data |
ENUM |
PHP 8.1 Enum |
string |
🆕 Auto-generated backed enum classes |
SET |
string |
string |
Values documented in comments |
YEAR |
int |
integer |
Year validation |
PostgreSQL Data Types (Todo ❌)
PostgreSQL Type | PHP Type | Doctrine Type | Status |
---|---|---|---|
INTEGER , BIGINT , SMALLINT |
int |
integer |
❌ Todo |
REAL , DOUBLE PRECISION |
float |
float |
❌ Todo |
NUMERIC , DECIMAL |
string |
decimal |
❌ Todo |
BOOLEAN |
bool |
boolean |
❌ Todo |
DATE , TIMESTAMP , TIME |
DateTimeInterface |
datetime |
❌ Todo |
VARCHAR , CHAR , TEXT |
string |
string |
❌ Todo |
JSON , JSONB |
array |
json |
❌ Todo |
UUID |
string |
guid |
❌ Todo |
ARRAY |
array |
simple_array |
❌ Todo |
SQLite Data Types (Todo ❌)
SQLite Type | PHP Type | Doctrine Type | Status |
---|---|---|---|
INTEGER |
int |
integer |
❌ Todo |
REAL |
float |
float |
❌ Todo |
TEXT |
string |
string |
❌ Todo |
BLOB |
string |
blob |
❌ Todo |
🔗 Relationship Support
ManyToOne Relationships (✅ Implemented)
Automatically detected from foreign key constraints in MySQL:
OneToMany Relationships (❌ Todo)
Feature in development - will be available in version 0.2.0
OneToOne Relationships (❌ Todo)
Feature planned for future release
ManyToMany Relationships (❌ Todo)
Feature in development - will be available in version 0.2.0
Self-Referencing Relationships (✅ Implemented)
Supported for hierarchical data structures:
🚀 Roadmap and Todo List
Version 0.2.0 (Next Release)
- [ ] OneToMany Relations: Automatic inverse relationship detection and generation
- [ ] ManyToMany Support: Junction table detection and entity generation
- [ ] Command for Entity Updates: Update existing entities without recreation
Version 0.3.0 (Future)
- [ ] PostgreSQL Support: Complete PostgreSQL type mapper and relationship detection
- [ ] SQLite Support: Complete SQLite type mapper and relationship detection
Version 0.4.0 (Future)
- [ ] OneToOne Relationships: Support for one-to-one relationships
- [ ] Enhanced ENUM/SET Support: Better handling for PostgreSQL and custom types
- [ ] Custom Type Mapping: User-defined type mappings for special cases
- [ ] Detailed Documentation: Complete API documentation and guides
Long-term Goals
- [ ] Doctrine Migrations Generation: Automatic migration file creation
- [ ] Advanced Relationship Detection: Complex relationship pattern recognition
- [ ] Performance Optimizations: Enhanced performance for very large databases
- [ ] API Platform Integration: Automatic API Platform resource configuration generation
📝 Best Practices
1. Backup Existing Entities
2. Use Dry-Run for Preview
3. Exclude System Tables
Configure exclusions in your configuration file:
4. Organize with Namespaces
5. Validate Generated Entities
🚨 Error Handling
The bundle provides comprehensive error handling with specific exceptions:
Database Connection Issues
Permission Problems
Memory Limitations
Debug Mode
Use verbose output for detailed information:
All versions of reverse-engineering-bundle with dependencies
symfony/framework-bundle Version ^7.0
symfony/console Version ^7.0
symfony/config Version ^7.0
symfony/dependency-injection Version ^7.0
symfony/http-kernel Version ^7.0
doctrine/dbal Version ^3.0
doctrine/orm Version ^2.15|^3.0
doctrine/doctrine-bundle Version ^2.10
twig/twig Version ^3.0
psr/log Version ^3.0
monolog/monolog Version ^3.0