Configuration Export
-
Can the exported .sql file be named with the version/revision?
For example,
FOG 1.2.0 would be named fog_backup_1.2.0.sql
FOG r3333 would be named fog_backup_r3333.sql
Extra credit:
Can the date be included, too? fog_backup_r3333_4-30-2015.sql -
the date seems more practical (and slightly easier) than the version to me. you should probably have records of what version you of software you were running for a given time-frame anyway.
-
A new chunk that impliments the date for configuration save.
[CODE]fog/lib/fog/ReportMaker.class.php[/CODE]
chunk edited:
[CODE]{
date_default_timezone_set(‘America/Chicago’);
$current_date = date(‘m/d/Y == H:i:s’);
$filename=“fog_backup_”.$current_date.“.sql”;
$path=BASEPATH.‘/management/other/’;
exec(‘mysqldump --opt -u’.DATABASE_USERNAME.’ -p"‘.DATABASE_PASSWORD.’" -h’.preg_replace(‘#p:#’,‘’,DATABASE_HOST).’ ‘.DATABASE_NAME.’ > '.$path.$filename);
header(‘X-Content-Type-Options: nosniff’);
header(‘Strict-Transport-Security: max-age=16070400; includeSubDomains’);
header(‘X-XSS-Protection: 1; mode=block’);
header(‘X-Frame-Options: deny’);
header(‘Cache-Control: no-cache’);
header(‘Content-Type: application/octet-stream’);
header(‘Content-Disposition: attachment; filename=’.$filename);
readfile($path.$filename);
exec('rm -rf '.$path.$filename);
}[/CODE]Tested working on r3333
-
also,
this file:
[CODE]/fog/lib/fog/System.class.php[/CODE]Contains the FOG version.
I was trying to use “include_once” to try to make it work in ReportMaker.class.php but I totally screwed it up.
-
If you’re trying to just add version, it at that point has already loaded System.class.php. All you’d need to do is append the FOG_VERSION to the file name. But scufa doesn’t always change even though it does always ask to check. Maybe date is better option as even if you revert the newer items are likely not read anymore.