Example #1
0
    include "tpl/header.phtml";
    include "tpl/transactions.phtml";
    include "tpl/footer.phtml";
});
Flight::route('/backup', function () {
    if (file_exists(Flight::get('backupPath') . '/wallet.dat')) {
        unlink(Flight::get('backupPath') . '/wallet.dat');
    }
    if ($dh = opendir(Flight::get('backupPath'))) {
        $i = 0;
        $backups = array();
        while (($file = readdir($dh)) !== false) {
            if (!in_array($file, array('.', '..', '...'))) {
                $backups[$i]['name'] = $file;
                $backups[$i]['created'] = explode("-", $file)[0];
                $backups[$i++]['size'] = Flight::controller()->formatSizeUnits(filesize(Flight::get('backupPath') . "/{$file}"));
            }
        }
        closedir($dh);
        rsort($backups);
    }
    include "tpl/header.phtml";
    include "tpl/backup.phtml";
    include "tpl/footer.phtml";
});
Flight::route('/backup/current', function () {
    if (file_exists(Flight::get('backupPath') . '/wallet.dat')) {
        unlink(Flight::get('backupPath') . '/wallet.dat');
    }
    Flight::reddcoin()->backupwallet(Flight::get('backupPath'));
    rename(Flight::get('backupPath') . '/wallet.dat', Flight::get('backupPath') . '/' . time() . '-wallet.dat');
Example #2
0
 /**
  * Create a custom meta box
  */
 public function add_custom_meta()
 {
     Flight::controller()->before();
     Flight::controller()->addCustomMeta();
 }