<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Auto_backup_hook
{
    public function run()
    {
        $CI =& get_instance();
        if (!isset($CI->db) || !is_object($CI->db)) return;
        $uri = strtolower(trim($CI->uri->uri_string(), '/'));
        if (in_array($uri, array('backupdata/backupdb','backupdata/simpan_autobackup'), true)) return;
        $CI->load->library('Database_backup_service');
        $CI->database_backup_service->run_if_due();
    }
}
