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

@@ 261-266 (lines=6) @@
258
            chmod(BACKUPFOLDER, 0777);
259
        }
260
261
        if (is_really_writable(BACKUPFOLDER)) {
262
            \CI::$APP->load->dbutil();
263
            $filePath = Backup::create()->createBackup('sql', 'backup_template_manager', TRUE);
264
            chmod(BACKUPFOLDER . 'backup_template_manager.sql', 0777);
265
            return pathinfo($filePath, PATHINFO_BASENAME);
266
        }
267
        return FALSE;
268
    }
269