From: dklawren Date: Wed, 26 Dec 2018 20:45:44 +0000 (-0500) Subject: Bug 1516021 - Rename all references in the code and file tree from Quantum to App X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bf023fd30a2ad52b1448a3dfa0aa60ef420f7de;p=thirdparty%2Fbugzilla.git Bug 1516021 - Rename all references in the code and file tree from Quantum to App --- diff --git a/Bugzilla.pm b/Bugzilla.pm index d120a9bf4..8ffc95971 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -395,7 +395,7 @@ sub login { } # If Mojo native app is requesting login, we need to possibly redirect - my $C = $Bugzilla::Quantum::CGI::C; + my $C = $Bugzilla::App::CGI::C; if ($C->session->{override_login_target}) { my $mojo_url = Mojo::URL->new($C->session->{override_login_target}); $mojo_url->query($C->session->{cgi_params}); @@ -788,7 +788,7 @@ sub check_rate_limit { Bugzilla->audit( "[rate_limit] action=$action, ip=$ip, limit=$limit, name=$name"); if ($action eq 'block') { - $Bugzilla::Quantum::CGI::C->block_ip($ip); + $Bugzilla::App::CGI::C->block_ip($ip); ThrowUserError("rate_limit"); } } diff --git a/Bugzilla/Quantum.pm b/Bugzilla/App.pm similarity index 83% rename from Bugzilla/Quantum.pm rename to Bugzilla/App.pm index 670781fb1..1af429f2f 100644 --- a/Bugzilla/Quantum.pm +++ b/Bugzilla/App.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum; +package Bugzilla::App; use Mojo::Base 'Mojolicious'; # Needed for its exit() overload, must happen early in execution. @@ -20,12 +20,12 @@ use Bugzilla::Constants qw(bz_locations); use Bugzilla::Extension (); use Bugzilla::Install::Requirements (); use Bugzilla::Logging; -use Bugzilla::Quantum::CGI; -use Bugzilla::Quantum::OAuth2::Clients; -use Bugzilla::Quantum::SES; -use Bugzilla::Quantum::Home; -use Bugzilla::Quantum::API; -use Bugzilla::Quantum::Static; +use Bugzilla::App::CGI; +use Bugzilla::App::OAuth2::Clients; +use Bugzilla::App::SES; +use Bugzilla::App::Home; +use Bugzilla::App::API; +use Bugzilla::App::Static; use Mojo::Loader qw( find_modules ); use Module::Runtime qw( require_module ); use Bugzilla::Util (); @@ -34,23 +34,23 @@ use MojoX::Log::Log4perl::Tiny; use Bugzilla::WebService::Server::REST; use Try::Tiny; -has 'static' => sub { Bugzilla::Quantum::Static->new }; +has 'static' => sub { Bugzilla::App::Static->new }; sub startup { my ($self) = @_; TRACE('Starting up'); - $self->plugin('Bugzilla::Quantum::Plugin::BlockIP'); - $self->plugin('Bugzilla::Quantum::Plugin::Glue'); - $self->plugin('Bugzilla::Quantum::Plugin::Hostage') + $self->plugin('Bugzilla::App::Plugin::BlockIP'); + $self->plugin('Bugzilla::App::Plugin::Glue'); + $self->plugin('Bugzilla::App::Plugin::Hostage') unless $ENV{BUGZILLA_DISABLE_HOSTAGE}; - $self->plugin('Bugzilla::Quantum::Plugin::SizeLimit') + $self->plugin('Bugzilla::App::Plugin::SizeLimit') unless $ENV{BUGZILLA_DISABLE_SIZELIMIT}; $self->plugin('ForwardedFor') if Bugzilla->has_feature('better_xff'); - $self->plugin('Bugzilla::Quantum::Plugin::Helpers'); - $self->plugin('Bugzilla::Quantum::Plugin::OAuth2'); + $self->plugin('Bugzilla::App::Plugin::Helpers'); + $self->plugin('Bugzilla::App::Plugin::OAuth2'); - push @{ $self->commands->namespaces }, 'Bugzilla::Quantum::Command'; + push @{ $self->commands->namespaces }, 'Bugzilla::App::Command'; $self->hook( before_routes => sub { @@ -127,8 +127,8 @@ sub setup_routes { my ($self) = @_; my $r = $self->routes; - Bugzilla::Quantum::CGI->setup_routes($r); - Bugzilla::Quantum::CGI->load_one('bzapi_cgi', 'extensions/BzAPI/bin/rest.cgi'); + Bugzilla::App::CGI->setup_routes($r); + Bugzilla::App::CGI->load_one('bzapi_cgi', 'extensions/BzAPI/bin/rest.cgi'); $r->get('/home')->to('Home#index'); $r->any('/')->to('CGI#index_cgi'); @@ -163,9 +163,9 @@ sub setup_routes { $r->any('/login')->to('CGI#index_cgi' => {'GoAheadAndLogIn' => '1'}); $r->any('/:new_bug' => [new_bug => qr{new[-_]bug}])->to('CGI#new_bug_cgi'); - Bugzilla::Quantum::API->setup_routes($r); - Bugzilla::Quantum::SES->setup_routes($r); - Bugzilla::Quantum::OAuth2::Clients->setup_routes($r); + Bugzilla::App::API->setup_routes($r); + Bugzilla::App::SES->setup_routes($r); + Bugzilla::App::OAuth2::Clients->setup_routes($r); } 1; diff --git a/Bugzilla/Quantum/API.pm b/Bugzilla/App/API.pm similarity index 97% rename from Bugzilla/Quantum/API.pm rename to Bugzilla/App/API.pm index 82e49754a..3d34eba15 100644 --- a/Bugzilla/Quantum/API.pm +++ b/Bugzilla/App/API.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::API; +package Bugzilla::App::API; use 5.10.1; use Mojo::Base qw( Mojolicious::Controller ); use Mojo::JSON qw( true false ); diff --git a/Bugzilla/Quantum/CGI.pm b/Bugzilla/App/CGI.pm similarity index 97% rename from Bugzilla/Quantum/CGI.pm rename to Bugzilla/App/CGI.pm index e14bc7f64..911b2ea06 100644 --- a/Bugzilla/Quantum/CGI.pm +++ b/Bugzilla/App/CGI.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::CGI; +package Bugzilla::App::CGI; use Mojo::Base 'Mojolicious::Controller'; use CGI::Compile; @@ -17,7 +17,7 @@ use Sub::Name; use Socket qw(AF_INET inet_aton); use Mojo::File qw(path); use English qw(-no_match_vars); -use Bugzilla::Quantum::Stdout; +use Bugzilla::App::Stdout; use Bugzilla::Constants qw(bz_locations USAGE_MODE_BROWSER); our $C; @@ -53,7 +53,7 @@ sub load_one { open STDIN, '<', $stdin->path or die "STDIN @{[$stdin->path]}: $!" if -s $stdin->path; - tie *STDOUT, 'Bugzilla::Quantum::Stdout', controller => $c; ## no critic (tie) + tie *STDOUT, 'Bugzilla::App::Stdout', controller => $c; ## no critic (tie) # the finally block calls cleanup. $c->stash->{cleanup_guard}->dismiss; diff --git a/Bugzilla/Quantum/Command/revoke_api_keys.pm b/Bugzilla/App/Command/revoke_api_keys.pm similarity index 85% rename from Bugzilla/Quantum/Command/revoke_api_keys.pm rename to Bugzilla/App/Command/revoke_api_keys.pm index 304a88b81..39666640f 100644 --- a/Bugzilla/Quantum/Command/revoke_api_keys.pm +++ b/Bugzilla/App/Command/revoke_api_keys.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::Command::revoke_api_keys; ## no critic (Capitalization) +package Bugzilla::App::Command::revoke_api_keys; ## no critic (Capitalization) use 5.10.1; use Mojo::Base 'Mojolicious::Command'; @@ -46,7 +46,7 @@ __END__ =head1 NAME -Bugzilla::Quantum::Command::revoke_api_keys - revoke API keys command +Bugzilla::App::Command::revoke_api_keys - revoke API keys command =head1 SYNOPSIS @@ -61,11 +61,11 @@ Bugzilla::Quantum::Command::revoke_api_keys - revoke API keys command =head1 DESCRIPTION -L revokes API keys. +L revokes API keys. =head1 ATTRIBUTES -L inherits all attributes from +L inherits all attributes from L and implements the following new ones. =head2 description @@ -84,7 +84,7 @@ Usage information for this command, used for the help screen. =head1 METHODS -L inherits all methods from +L inherits all methods from L and implements the following new ones. =head2 run diff --git a/Bugzilla/Quantum/Home.pm b/Bugzilla/App/Home.pm similarity index 95% rename from Bugzilla/Quantum/Home.pm rename to Bugzilla/App/Home.pm index 6a3021f64..bd21c45c0 100644 --- a/Bugzilla/Quantum/Home.pm +++ b/Bugzilla/App/Home.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::Home; +package Bugzilla::App::Home; use Mojo::Base 'Mojolicious::Controller'; use Bugzilla::Error; diff --git a/Bugzilla/Quantum/OAuth2/Clients.pm b/Bugzilla/App/OAuth2/Clients.pm similarity index 99% rename from Bugzilla/Quantum/OAuth2/Clients.pm rename to Bugzilla/App/OAuth2/Clients.pm index 33431b1b0..083e73d22 100644 --- a/Bugzilla/Quantum/OAuth2/Clients.pm +++ b/Bugzilla/App/OAuth2/Clients.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::OAuth2::Clients; +package Bugzilla::App::OAuth2::Clients; use 5.10.1; use Mojo::Base 'Mojolicious::Controller'; diff --git a/Bugzilla/Quantum/Plugin/BlockIP.pm b/Bugzilla/App/Plugin/BlockIP.pm similarity index 96% rename from Bugzilla/Quantum/Plugin/BlockIP.pm rename to Bugzilla/App/Plugin/BlockIP.pm index f97ce276a..675bc823c 100644 --- a/Bugzilla/Quantum/Plugin/BlockIP.pm +++ b/Bugzilla/App/Plugin/BlockIP.pm @@ -1,4 +1,4 @@ -package Bugzilla::Quantum::Plugin::BlockIP; +package Bugzilla::App::Plugin::BlockIP; use 5.10.1; use Mojo::Base 'Mojolicious::Plugin'; diff --git a/Bugzilla/Quantum/Plugin/Glue.pm b/Bugzilla/App/Plugin/Glue.pm similarity index 99% rename from Bugzilla/Quantum/Plugin/Glue.pm rename to Bugzilla/App/Plugin/Glue.pm index de016356c..be7d44565 100644 --- a/Bugzilla/Quantum/Plugin/Glue.pm +++ b/Bugzilla/App/Plugin/Glue.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::Plugin::Glue; +package Bugzilla::App::Plugin::Glue; use 5.10.1; use Mojo::Base 'Mojolicious::Plugin'; diff --git a/Bugzilla/Quantum/Plugin/Helpers.pm b/Bugzilla/App/Plugin/Helpers.pm similarity index 97% rename from Bugzilla/Quantum/Plugin/Helpers.pm rename to Bugzilla/App/Plugin/Helpers.pm index 72dd96cf9..872a39631 100644 --- a/Bugzilla/Quantum/Plugin/Helpers.pm +++ b/Bugzilla/App/Plugin/Helpers.pm @@ -4,7 +4,7 @@ # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::Plugin::Helpers; +package Bugzilla::App::Plugin::Helpers; use 5.10.1; use Mojo::Base qw(Mojolicious::Plugin); diff --git a/Bugzilla/Quantum/Plugin/Hostage.pm b/Bugzilla/App/Plugin/Hostage.pm similarity index 98% rename from Bugzilla/Quantum/Plugin/Hostage.pm rename to Bugzilla/App/Plugin/Hostage.pm index 0cf42124c..62ce7d01d 100644 --- a/Bugzilla/Quantum/Plugin/Hostage.pm +++ b/Bugzilla/App/Plugin/Hostage.pm @@ -1,4 +1,4 @@ -package Bugzilla::Quantum::Plugin::Hostage; +package Bugzilla::App::Plugin::Hostage; use 5.10.1; use Mojo::Base 'Mojolicious::Plugin'; use Bugzilla::Logging; diff --git a/Bugzilla/Quantum/Plugin/OAuth2.pm b/Bugzilla/App/Plugin/OAuth2.pm similarity index 99% rename from Bugzilla/Quantum/Plugin/OAuth2.pm rename to Bugzilla/App/Plugin/OAuth2.pm index d2f105013..a3365dbac 100644 --- a/Bugzilla/Quantum/Plugin/OAuth2.pm +++ b/Bugzilla/App/Plugin/OAuth2.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::Plugin::OAuth2; +package Bugzilla::App::Plugin::OAuth2; use 5.10.1; use Mojo::Base 'Mojolicious::Plugin::OAuth2::Server'; diff --git a/Bugzilla/Quantum/Plugin/SizeLimit.pm b/Bugzilla/App/Plugin/SizeLimit.pm similarity index 98% rename from Bugzilla/Quantum/Plugin/SizeLimit.pm rename to Bugzilla/App/Plugin/SizeLimit.pm index 2f436fe65..7fdc8cbc4 100644 --- a/Bugzilla/Quantum/Plugin/SizeLimit.pm +++ b/Bugzilla/App/Plugin/SizeLimit.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::Plugin::SizeLimit; +package Bugzilla::App::Plugin::SizeLimit; use 5.10.1; use Mojo::Base 'Mojolicious::Plugin'; use Mojo::JSON qw(decode_json); diff --git a/Bugzilla/Quantum/SES.pm b/Bugzilla/App/SES.pm similarity index 99% rename from Bugzilla/Quantum/SES.pm rename to Bugzilla/App/SES.pm index cac173b35..037d64534 100644 --- a/Bugzilla/Quantum/SES.pm +++ b/Bugzilla/App/SES.pm @@ -1,4 +1,4 @@ -package Bugzilla::Quantum::SES; +package Bugzilla::App::SES; # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/Bugzilla/Quantum/Static.pm b/Bugzilla/App/Static.pm similarity index 95% rename from Bugzilla/Quantum/Static.pm rename to Bugzilla/App/Static.pm index 6ac803e96..ada937273 100644 --- a/Bugzilla/Quantum/Static.pm +++ b/Bugzilla/App/Static.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::Static; +package Bugzilla::App::Static; use Mojo::Base 'Mojolicious::Static'; use Bugzilla::Constants qw(bz_locations); diff --git a/Bugzilla/Quantum/Stdout.pm b/Bugzilla/App/Stdout.pm similarity index 97% rename from Bugzilla/Quantum/Stdout.pm rename to Bugzilla/App/Stdout.pm index 10be0b664..481a6f15d 100644 --- a/Bugzilla/Quantum/Stdout.pm +++ b/Bugzilla/App/Stdout.pm @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Quantum::Stdout; +package Bugzilla::App::Stdout; use 5.10.1; use Moo; diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 24d687093..3d7daed3e 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -647,8 +647,8 @@ sub header { } } my $headers = $self->SUPER::header(%headers) || ''; - if ($self->server_software eq 'Bugzilla::Quantum::CGI') { - my $c = $Bugzilla::Quantum::CGI::C; + if ($self->server_software eq 'Bugzilla::App::CGI') { + my $c = $Bugzilla::App::CGI::C; $c->res->headers->parse($headers); my $status = $c->res->headers->status; if ($status && $status =~ /^([0-9]+)/) { @@ -664,7 +664,7 @@ sub header { } else { LOGDIE( - "Bugzilla::CGI->header() should only be called from inside Bugzilla::Quantum::CGI!" + "Bugzilla::CGI->header() should only be called from inside Bugzilla::App::CGI!" ); } } diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index 4a6ab6865..00c11b588 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -34,7 +34,7 @@ use Scalar::Util qw(blessed); sub _in_eval { my $in_eval = 0; for (my $stack = 1; my $sub = (caller($stack))[3]; $stack++) { - last if $sub =~ /^Bugzilla::Quantum::CGI::try/; + last if $sub =~ /^Bugzilla::App::CGI::try/; $in_eval = 1 if $sub =~ /^\(eval\)/; } return $in_eval; diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index e0099203c..252f91822 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -336,8 +336,8 @@ sub do_ssl_redirect_if_required { # Returns the real remote address of the client, sub remote_ip { - if (($ENV{SERVER_SOFTWARE} // '') eq 'Bugzilla::Quantum::CGI') { - my $c = $Bugzilla::Quantum::CGI::C or LOGDIE("Cannot find controller!"); + if (($ENV{SERVER_SOFTWARE} // '') eq 'Bugzilla::App::CGI') { + my $c = $Bugzilla::App::CGI::C or LOGDIE("Cannot find controller!"); state $better_xff = Bugzilla->has_feature('better_xff'); return $better_xff ? $c->forwarded_for : $c->tx->remote_address; } diff --git a/bugzilla.pl b/bugzilla.pl index 0f385d42f..34075d789 100755 --- a/bugzilla.pl +++ b/bugzilla.pl @@ -17,4 +17,4 @@ use Mojolicious::Commands; $ENV{MOJO_LISTEN} ||= $ENV{PORT} ? "http://*:$ENV{PORT}" : "http://*:3001"; # Start command line interface for application -Mojolicious::Commands->start_app('Bugzilla::Quantum'); +Mojolicious::Commands->start_app('Bugzilla::App'); diff --git a/scripts/block-ip.pl b/scripts/block-ip.pl index bfbf88fd7..c2b4b1929 100755 --- a/scripts/block-ip.pl +++ b/scripts/block-ip.pl @@ -12,7 +12,7 @@ use warnings; use lib qw(. lib local/lib/perl5); use Bugzilla; -use Bugzilla::Quantum; +use Bugzilla::App; use Bugzilla::Constants; use Getopt::Long; @@ -23,7 +23,7 @@ GetOptions('unblock' => \$unblock); pod2usage("No IPs given") unless @ARGV; -my $app = Bugzilla::Quantum->new; +my $app = Bugzilla::App->new; if ($unblock) { $app->unblock_ip($_) for @ARGV; @@ -55,4 +55,4 @@ If passed, the IPs will be unblocked instead of blocked. Use this to remove IPs =head1 DESCRIPTION -This is just a simple CLI inteface to L. +This is just a simple CLI inteface to L. diff --git a/t/mojo-example.t b/t/mojo-example.t index 68c7d4d87..e9ca7f56e 100644 --- a/t/mojo-example.t +++ b/t/mojo-example.t @@ -43,7 +43,7 @@ my $api_key = issue_api_key('api@mozilla.org')->api_key; # Mojo::Test loads the application and provides methods for # testing requests without having to run a server. -my $t = Test::Mojo->new('Bugzilla::Quantum'); +my $t = Test::Mojo->new('Bugzilla::App'); # we ensure this file exists so the /__lbhearbeat__ test passes. $t->app->home->child('__lbheartbeat__')->spurt('httpd OK'); diff --git a/t/mojo-oauth2.t b/t/mojo-oauth2.t index cafda8165..b43ee8577 100644 --- a/t/mojo-oauth2.t +++ b/t/mojo-oauth2.t @@ -36,7 +36,7 @@ ok $oauth_client->{id}, 'New client id (' . $oauth_client->{id} . ')'; ok $oauth_client->{secret}, 'New client secret (' . $oauth_client->{secret} . ')'; -my $t = Test::Mojo->new('Bugzilla::Quantum'); +my $t = Test::Mojo->new('Bugzilla::App'); # Allow 1 redirect max $t->ua->max_redirects(1); diff --git a/xmlrpc.cgi b/xmlrpc.cgi index 620187e5a..435237ed5 100755 --- a/xmlrpc.cgi +++ b/xmlrpc.cgi @@ -45,7 +45,7 @@ my $stdout = capture_stdout { # for setting SOAPAction, which isn't used by XML-RPC. $server->on_action(sub { $server->handle_login(WS_DISPATCH, @_) })->handle(); }; -my $C = $Bugzilla::Quantum::CGI::C; +my $C = $Bugzilla::App::CGI::C; my ($header_str, $body) = split(/(?:\r\n\r\n|\n\n)/, $stdout, 2); my $headers = Mojo::Headers->new; $headers->parse("$header_str\r\n\r\n");