Code Duplication    Length = 6-7 lines in 2 locations

application/libraries/Update.php 1 location

@@ 285-291 (lines=7) @@
282
     */
283
    public function db_backup() {
284
285
        if (is_really_writable(BACKUPFOLDER)) {
286
            $this->ci->load->dbutil();
287
            $filePath = Backup::create()->createBackup('sql', 'backup', TRUE);
288
            return pathinfo($filePath, PATHINFO_BASENAME);
289
        } else {
290
            showMessage(langf('Can not create a database snapshot, Check the folder {0} on the ability to record', 'admin', [BACKUPFOLDER]));
291
        }
292
    }
293
294
    /**

application/modules/template_manager/classes/TemplateManager.php 1 location

@@ 301-306 (lines=6) @@
298
            chmod(BACKUPFOLDER, 0777);
299
        }
300
301
        if (is_really_writable(BACKUPFOLDER)) {
302
            \CI::$APP->load->dbutil();
303
            $filePath = Backup::create()->createBackup('sql', 'backup_template_manager', TRUE);
304
            chmod(BACKUPFOLDER . 'backup_template_manager.sql', 0777);
305
            return pathinfo($filePath, PATHINFO_BASENAME);
306
        }
307
        return FALSE;
308
    }
309