Skip to content

Commit

Permalink
Use documentroot instead of document_root
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jan 16, 2024
1 parent e53b0be commit 40c7b89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Revision history for CGI-Info

0.80
Added document_root() as a synonym to rootdir()
Added documentroot() as a synonym to rootdir()
For compatability with Apache

0.79 Wed Jan 3 14:25:42 EST 2024
Expand Down
4 changes: 2 additions & 2 deletions lib/CGI/Info.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1308,13 +1308,13 @@ sub root_dir
return __PACKAGE__->rootdir(@_);
}

=head2 document_root
=head2 documentroot
Synonym of rootdir(), for compatibility with Apache.
=cut

sub document_root
sub documentroot
{
if($_[0] && ref($_[0])) {
my $self = shift;
Expand Down
6 changes: 3 additions & 3 deletions t/rootdir.t
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ ROOTDIR: {
ok(CGI::Info->root_dir() eq $dir);
ok(CGI::Info::rootdir() eq $dir);
ok(CGI::Info::root_dir() eq $dir);
ok(CGI::Info::document_root() eq $dir);
ok(CGI::Info::document_root() eq $dir);
ok(CGI::Info::documentroot() eq $dir);
ok(CGI::Info::documentroot() eq $dir);

$ENV{'DOCUMENT_ROOT'} = File::Spec->catdir(File::Spec->tmpdir(), 'xyzzy');
$dir = CGI::Info->rootdir();
Expand All @@ -39,7 +39,7 @@ ROOTDIR: {
delete $ENV{'C_DOCUMENT_ROOT'};
$ENV{'DOCUMENT_ROOT'} = File::Spec->catdir(File::Spec->tmpdir(), 'xyzzy');
$i = new_ok('CGI::Info');
$dir = $i->document_root();
$dir = $i->documentroot();
ok(-r $dir);
ok(-d $dir);

Expand Down

0 comments on commit 40c7b89

Please sign in to comment.