Corrected events and delete old file

This commit is contained in:
objecttothis
2022-11-18 14:39:59 +04:00
committed by Steve Ireland
parent 6c38ba7c06
commit d5d342d7da
2 changed files with 2 additions and 33 deletions

View File

@@ -4,8 +4,6 @@ namespace Config;
use CodeIgniter\Events\Events;
use CodeIgniter\Exceptions\FrameworkException;
use Exception;
use Dotenv\Dotenv;
/*
* --------------------------------------------------------------------
@@ -38,18 +36,7 @@ Events::on('pre_system', function ()
ob_end_flush();
}
ob_start(static function ($buffer) { return $buffer; });
try
{
$config_path = APPPATH . 'config/config.php';
$dotenv = new Dotenv($config_path);
$dotenv->overload();
}
catch (Exception $e)
{
// continue, .env file not present
}
ob_start(static function ($buffer){ return $buffer; });
}
/*
@@ -65,7 +52,7 @@ Events::on('pre_system', function ()
}
});
Events::on('post_controller_constructor', ['Load_config', 'load_config']); //TODO: This fails. Load_config not found
Events::on('post_controller_constructor', ['Load_config', 'load_config']);
Events::on('post_controller', ['Db_log', 'db_log_queries']);

View File

@@ -1,18 +0,0 @@
<?php
namespace App\Events;
class Save
{
public static function validate_save()
{
$url = $_SERVER['REQUEST_URI'];
$is_save = preg_match('/save\/\d*?/', $url);
if($is_save && $_SERVER["REQUEST_METHOD"] != "POST" && empty($_POST))
{
echo "Method not allowed";
die;
}
}
}