X-Git-Url: http://git.rot13.org/?p=Fuse-DBI;a=blobdiff_plain;f=examples%2Fwebgui-mysql.pl;fp=examples%2Fwebgui-mysql.pl;h=2c0be57913eb3118dbaeb56de40e1347c24dac64;hp=be64388c4f90db51c0028a235810c7cf69c658dc;hb=5cb40c5dd4b6dce8f60851830a5416a82d22d88d;hpb=319f204599f005d7303c923b4387e537a232ead8 diff --git a/examples/webgui-mysql.pl b/examples/webgui-mysql.pl index be64388..2c0be57 100755 --- a/examples/webgui-mysql.pl +++ b/examples/webgui-mysql.pl @@ -4,6 +4,8 @@ use strict; use blib; use Fuse::DBI; +my $template_dir = '/data/WebGUI/cms.rot13.org/uploads/temp/templates'; + my $sql_filenames = q{ select concat(templateid,name) as id, @@ -35,6 +37,13 @@ my $mnt = Fuse::DBI->mount({ user => 'webgui', password => 'webgui', mount => $mount, + invalidate => sub { + print STDERR "invalidating content in $template_dir\n"; + opendir(DIR, $template_dir) || die "can't opendir $template_dir: $!"; + map { unlink "$template_dir/$_" || warn "can't remove $template_dir/$_: $!" } grep { !/^\./ && -f "$template_dir/$_" } readdir(DIR); + closedir DIR; + } + }); print "Press enter to exit...";