volt-newsroom-scraper-report/web/env_loader.php
DJP 5626cf010d Add web interface with SSO authentication
- Created complete PHP web interface in web/ directory
- SSO authentication using same system as NANO-RESEARCH app
- Date selection form with auto-populated current date
- Real-time Python output streaming to browser
- Secure PDF download with authentication
- Beautiful responsive UI with Montserrat font
- Fixed INSPIRATION category (column H doesn't exist - only 6 categories)
- Updated config to reflect correct 6 categories (A-G columns only)
- Backend streaming output from Python script
- Complete documentation in web/README.md
- Environment variable loading for SSO configuration
2026-01-06 13:25:17 -05:00

30 lines
727 B
PHP

<?php
/**
* Simple .env file loader
* Loads environment variables from .env file
*/
$envFile = __DIR__ . '/.env';
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line) {
// Skip comments
if (strpos(trim($line), '#') === 0) {
continue;
}
// Parse KEY=VALUE
if (strpos($line, '=') !== false) {
list($key, $value) = explode('=', $line, 2);
$key = trim($key);
$value = trim($value);
// Set as environment variable
putenv("{$key}={$value}");
$_ENV[$key] = $value;
$_SERVER[$key] = $value;
}
}
}