From a18c07ba425da6d6da2e95a5d52cdaa0826cdbd0 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 24 Oct 2023 13:38:58 +0700 Subject: [PATCH] check file if exists --- system/cron.php | 12 ++++++++++++ system/cron_reminder.php | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/system/cron.php b/system/cron.php index 1b0f362f..cf897be0 100644 --- a/system/cron.php +++ b/system/cron.php @@ -35,6 +35,18 @@ if (php_sapi_name() !== 'cli') { echo "
";
 }
 
+if(!file_exists('../config.php')){
+    die("config.php file not found");
+}
+
+
+if(!file_exists('orm.php')){
+    die("orm.php file not found");
+}
+
+if(!file_exists('uploads/notifications.json')){
+    die("uploads/notifications.json file not found");
+}
 
 require_once '../config.php';
 require_once 'orm.php';
diff --git a/system/cron_reminder.php b/system/cron_reminder.php
index 5a55e180..be879dcb 100644
--- a/system/cron_reminder.php
+++ b/system/cron_reminder.php
@@ -35,6 +35,19 @@ if(php_sapi_name() !== 'cli'){
     echo "
";
 }
 
+if(!file_exists('../config.php')){
+    die("config.php file not found");
+}
+
+
+if(!file_exists('orm.php')){
+    die("orm.php file not found");
+}
+
+if(!file_exists('uploads/notifications.json')){
+    die("uploads/notifications.json file not found");
+}
+
 require_once '../config.php';
 require_once 'orm.php';
 require_once 'autoload/PEAR2/Autoload.php';