First Commit
This commit is contained in:
Executable
+10
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SysCMS Console Wrapper
|
||||
* This file is maintained for backward compatibility.
|
||||
* Please use the 'syscli' file in the root directory.
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../syscli';
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use Kernel\Application;
|
||||
|
||||
$app = new Application();
|
||||
|
||||
// Run Migrations
|
||||
$migrations = [
|
||||
__DIR__ . '/../modules/eventsguide/database/migrations/001_create_events_table.php',
|
||||
__DIR__ . '/../modules/eventsguide/database/migrations/002_create_event_gallery_table.php',
|
||||
__DIR__ . '/../modules/eventsguide/database/migrations/003_create_event_reports_table.php',
|
||||
__DIR__ . '/../modules/eventsguide/database/migrations/004_create_event_ads_table.php',
|
||||
__DIR__ . '/../modules/eventsguide/database/migrations/005_insert_module_record.php',
|
||||
];
|
||||
|
||||
foreach ($migrations as $file) {
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
|
||||
// Extract class name from file content
|
||||
$content = file_get_contents($file);
|
||||
if (preg_match('/class\s+(\w+)/', $content, $matches)) {
|
||||
$className = $matches[1];
|
||||
if (class_exists($className)) {
|
||||
echo "Running $className...\n";
|
||||
$migration = new $className();
|
||||
$migration->up();
|
||||
echo "$className done.\n";
|
||||
} else {
|
||||
echo "Class $className not found in $file\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "File not found: $file\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Installation complete.\n";
|
||||
Reference in New Issue
Block a user