-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenerate.php
More file actions
executable file
·38 lines (31 loc) · 929 Bytes
/
Copy pathgenerate.php
File metadata and controls
executable file
·38 lines (31 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env php
<?php
declare(strict_types=1);
/**
* Database to Class Generator - Console Application
*
* Modern CLI tool for generating PHP classes from database tables
*/
// Autoload dependencies
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
} else {
echo "Error: Composer dependencies not installed.\n";
echo "Run: composer install\n";
exit(1);
}
use DatabaseToClass\Console\GenerateCommand;
use DatabaseToClass\Console\ListCommand;
use Symfony\Component\Console\Application;
$application = new Application('Database to Class Generator', '2.0.0');
// Register commands
$application->add(new GenerateCommand());
$application->add(new ListCommand());
// Set generate as default command
$application->setDefaultCommand('generate');
try {
$application->run();
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
exit(1);
}