- Created separate MoneyFlix project directory - Copied Node.js redirector from production server - Added CRM PHP code (Redirects module, Core classes, Config, Routes, Views) - Created comprehensive documentation (README_MONEYFLIX.md) - Added sync script to keep CRM code updated (sync-from-crm.sh) - Configured .gitignore for Node.js and PHP - Set up proper project structure for multi-client isolation This separates MoneyFlix from the main CRM to avoid confusion between different client systems and provides a dedicated environment for MoneyFlix-specific development and maintenance.
74 lines
2.5 KiB
PHP
74 lines
2.5 KiB
PHP
<?php
|
|
namespace App\Modules\Redirects;
|
|
|
|
use App\Core\MenuManager;
|
|
use App\Core\View;
|
|
|
|
class Module
|
|
{
|
|
public static function getConfig(): array
|
|
{
|
|
return [
|
|
'name' => 'Redirects',
|
|
'version' => '1.0.0',
|
|
'description' => 'Sistema de redirects inteligentes com targeting server-side',
|
|
'author' => 'BitReport Unip. LDA',
|
|
'enabled' => true,
|
|
'dependencies' => ['Core', 'Analytics'],
|
|
'features' => [
|
|
'redirect_management' => true,
|
|
'server_side_targeting' => true,
|
|
'geo_targeting' => true,
|
|
'device_targeting' => true,
|
|
'browser_targeting' => true,
|
|
'time_targeting' => true,
|
|
'analytics_tracking' => true,
|
|
'performance_optimization' => true
|
|
]
|
|
];
|
|
}
|
|
|
|
public static function registerRoutes($router): void
|
|
{
|
|
require __DIR__ . '/Routes/web.php';
|
|
require __DIR__ . '/Routes/api.php';
|
|
require __DIR__ . '/Routes/public.php';
|
|
}
|
|
|
|
public static function registerServices(): void
|
|
{
|
|
// Registar namespace das views do módulo
|
|
View::addNamespace('redirects', __DIR__ . '/Views');
|
|
|
|
// Registar serviços do módulo no ServiceContainer
|
|
$container = \App\Core\ServiceContainer::getInstance();
|
|
|
|
// Registar modelos
|
|
$container->registerModuleService('Redirects', 'model.RedirectModel', function() {
|
|
return new \App\Modules\Redirects\Models\RedirectModel();
|
|
}, true);
|
|
|
|
$container->registerModuleService('Redirects', 'model.RedirectFilterModel', function() {
|
|
return new \App\Modules\Redirects\Models\RedirectFilterModel();
|
|
}, true);
|
|
|
|
$container->registerModuleService('Redirects', 'model.RedirectStatsModel', function() {
|
|
return new \App\Modules\Redirects\Models\RedirectStatsModel();
|
|
}, true);
|
|
|
|
// Registar serviços
|
|
if (file_exists(__DIR__ . '/Services/RedirectProcessor.php')) {
|
|
require_once __DIR__ . '/Services/RedirectProcessor.php';
|
|
$container->registerModuleService('Redirects', 'RedirectProcessor', function() {
|
|
return new \App\Modules\Redirects\Services\RedirectProcessor();
|
|
}, true);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public static function registerMenu(): void
|
|
{
|
|
// Compatibilidade: não faz nada, menu já registado via menu.php
|
|
}
|
|
}
|