Permalink
Browse files

Item14515: Rename Foswiki::Aux to Foswiki::Util

Aux is a reserved word on Windows.  Email is not conigurable on windows.
  • Loading branch information...
gac410 committed Oct 12, 2017
1 parent de67310 commit 1c5967e56068fcc5f053afc59219fb85f32a642e
@@ -14,7 +14,7 @@ use strict;
use warnings;
use Foswiki::Configure::Wizard ();
use Foswiki::Aux::MuteOut ();
use Foswiki::Util::MuteOut ();
use File::Temp ();
our @ISA = ('Foswiki::Configure::Wizard');
@@ -114,7 +114,7 @@ sub _muteExec {
{
# Don't try to capture STDERR on FastCGI systems. it won't work.
my $muter = Foswiki::Aux::MuteOut->new(
my $muter = Foswiki::Util::MuteOut->new(
outFile => $outFile,
errFile => $errFile,
reporter => $reporter,
@@ -359,7 +359,6 @@ lib/Foswiki/Address.pm 0444
lib/Foswiki/AggregateIterator.pm 0444
lib/Foswiki/Attach.pm 0444
lib/Foswiki/Attrs.pm 0444
lib/Foswiki/Aux/MuteOut.pm 0444
lib/Foswiki/Compatibility.pm 0444
lib/Foswiki/Configure/Auth.pm 0444
lib/Foswiki/Configure/Bootstrap.pm 0444
@@ -715,6 +714,7 @@ lib/Foswiki/Users.pm 0444
lib/Foswiki/Users/BaseUserMapping.pm 0444
lib/Foswiki/Users/HtPasswdUser.pm 0444
lib/Foswiki/Users/Password.pm 0444
lib/Foswiki/Util/MuteOut.pm 0444
lib/Foswiki/Validation.pm 0444
lib/Foswiki/ValidationException.pm 0444
lib/Foswiki/WebFilter.pm 0444
@@ -1,12 +1,12 @@
# See bottom of file for license and copyright information
package Foswiki::Aux::MuteOut;
package Foswiki::Util::MuteOut;
use strict;
use warnings;
=begin TML
---+!! Package Foswiki::Aux::MuteOut
---+!! Package Foswiki::Util::MuteOut
Very simplistic redirection of STDERR/STDOUT.
@@ -16,7 +16,7 @@ Simply avoid any output:
<verbatim>
use Foswiki::Aux::MuteOut;
use Foswiki::Util::MuteOut;
sub proc {
my ($dir) = @_;
@@ -25,7 +25,7 @@ sub proc {
print STDERR "RC=", $rc;
}
my $mute = Foswiki::Aux::MuteOut->new;
my $mute = Foswiki::Util::MuteOut->new;
# Nothing will be displayed by proc()
$mute->exec(\&proc, "/etc");
@@ -34,7 +34,7 @@ $mute->exec(\&proc, "/etc");
Capture output into files:
<verbatim>
my $capture = Foswiki::Aux::MuteOut->new(
my $capture = Foswiki::Util::MuteOut->new(
outFile => 'stdout.txt',
errFile => 'stderr.txt',
);
@@ -63,18 +63,18 @@ sub new {
( defined $params{errFile} ) ? $params{errFile} : File::Spec->devnull;
unless ( open $oldOut, ">&", STDOUT ) {
Foswiki::Aux::Dependencies::_msg( "Cannot dup STDOUT: " . $! );
Foswiki::Util::Dependencies::_msg( "Cannot dup STDOUT: " . $! );
return undef;
}
unless ( open $oldErr, ">&", STDERR ) {
Foswiki::Aux::Dependencies::_msg( "Cannot dup STDERR: " . $! );
Foswiki::Util::Dependencies::_msg( "Cannot dup STDERR: " . $! );
return undef;
}
unless ( open STDOUT, ">", $outFile ) {
Foswiki::Aux::Dependencies::_msg( "Failed to redirect STDOUT: " . $! );
Foswiki::Util::Dependencies::_msg( "Failed to redirect STDOUT: " . $! );
}
unless ( open STDERR, ">", $errFile ) {
Foswiki::Aux::Dependencies::_msg( "Failed to redirect STDERR: " . $! );
Foswiki::Util::Dependencies::_msg( "Failed to redirect STDERR: " . $! );
}
my $obj = bless {
@@ -110,10 +110,10 @@ sub DESTROY {
my $this = shift;
unless ( open STDOUT, ">&", $this->{oldOut} ) {
Foswiki::Aux::Dependencies::_msg( "Failed to restore STDOUT: " . $! );
Foswiki::Util::Dependencies::_msg( "Failed to restore STDOUT: " . $! );
}
unless ( open STDERR, ">&", $this->{oldErr} ) {
Foswiki::Aux::Dependencies::_msg( "Failed to restore STDERR: " . $! );
Foswiki::Util::Dependencies::_msg( "Failed to restore STDERR: " . $! );
}
}

0 comments on commit 1c5967e

Please sign in to comment.