Update run_003_turnero.php
This commit is contained in:
+3
-3
@@ -9,9 +9,11 @@
|
||||
* https://tu-dominio/run_003_turnero.php
|
||||
*/
|
||||
|
||||
// Cargar config primero para que MIGRATION_TOKEN esté disponible
|
||||
require_once __DIR__ . '/config/config.php';
|
||||
|
||||
// Ejecutar solo desde CLI o con token de protección básica en web
|
||||
if (php_sapi_name() !== 'cli') {
|
||||
// En web: exigir token para evitar ejecuciones accidentales
|
||||
$token = $_GET['token'] ?? '';
|
||||
if (empty($token) || $token !== (defined('MIGRATION_TOKEN') ? MIGRATION_TOKEN : '')) {
|
||||
http_response_code(403);
|
||||
@@ -19,8 +21,6 @@ if (php_sapi_name() !== 'cli') {
|
||||
}
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/config/config.php';
|
||||
|
||||
$sqlFile = __DIR__ . '/migrations/003_turnero.sql';
|
||||
|
||||
if (!file_exists($sqlFile)) {
|
||||
|
||||
Reference in New Issue
Block a user