mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-10 18:09:30 -04:00
Corrected events and delete old file
This commit is contained in:
committed by
Steve Ireland
parent
6c38ba7c06
commit
d5d342d7da
@@ -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']);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user