I wrote a script that lets you make a quick backup of a file from within the PhpED editor. This is useful for code thats not in a repository or for quick-and-dirty backups.
in Integration, add a menu called "Make Checkpoint"
Execute with Shell, enter the command line as shown below.
"@php5@" -n -f c:\_scripts\checkpointer.php -- "@FName@"
|
Check "Show this command in File Bar popup" as well, if you wish.
how to set it up:
Make the directory c:\_scripts\
Create the file c:\_scripts\checkpointer.php
<?php
$file = $argv[1];
if (empty($file)) {
echo "No File Specified";
sleep(10);
exit();
}
$nf = str_replace(":","",$file);
//add any other filename abbreviations here
$nf = str_replace(" ","",$nf);
$nf = strtolower(preg_replace('/[^a-zA-Z0-9_]/','.',$nf)).date("YmdHis").".7z";
while (strlen($nf) > 255) {
$nf = substr($nf, 1);
}
$newfile = "C:\\_scripts\\checkpoints\\".$nf;
$arg = "a $newfile \"$file\"";
system("c:\\_scripts\\checkpoints\\7za.exe $arg");
|
make the directory c:\_scripts\checkpoints\
Download 7zip executable (freeware, available here: http://www.7-zip.org/download.html ) - make sure you get the command line version, and place 7za.exe in the c:\_scripts\checkpoints\ directory.
right click a file or directory and choose "Make Checkpoint" to make a quick backup of the file.