Skip to content

Commit

Permalink
Issue #2313: eliminate useless use of ObjectManager
Browse files Browse the repository at this point in the history
also eliminate useless constructur when only a method is called.
  • Loading branch information
bschmalhofer committed Mar 13, 2024
1 parent 9476d4b commit d4818ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
18 changes: 2 additions & 16 deletions scripts/DBUpdate-to-11.0.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,14 @@

# OTOBO modules
use Kernel::System::ObjectManager ();
use scripts::DBUpdateTo11_0 ();

$Kernel::OM = Kernel::System::ObjectManager->new(
'Kernel::System::Log' => {
LogPrefix => 'OTOBO-DBUpdate-to-11.0.pl',
},
);

## get options
#my %Options = (
# Help => 0,
# NonInteractive => 0,
# Timing => 0,
# Verbose => 0,
#);
#Getopt::Long::GetOptions(
# 'help', \$Options{Help},
# 'non-interactive', \$Options{NonInteractive},
# 'cleanup-orphaned-articles', \$Options{CleanupOrphanedArticles},
# 'timing', \$Options{Timing},
# 'verbose', \$Options{Verbose},
#);

$Kernel::OM->Create('scripts::DBUpdateTo11_0')->Run;
scripts::DBUpdateTo11_0::Run();

exit 0;
15 changes: 2 additions & 13 deletions scripts/DBUpdateTo11_0.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,13 @@ scripts::DBUpdateTo11_0 - Perform system upgrade from OTOBO 10.1 to 11.0
=head1 PUBLIC INTERFACE
=head2 new()
=head1 Run
Don't use the constructor directly, use the ObjectManager instead:
my $DBUpdateObject = $Kernel::OM->Get('scripts::DBUpdateTo11_0');
This method is run without parameters.
=cut

sub new {
my ( $Type, %Param ) = @_;

# allocate new hash for object
return bless {}, $Type;
}

sub Run {
my ( $Self, %Param ) = @_;

print "\n Migration started ... \n";

my $SuccessfulMigration = 1;
Expand Down

0 comments on commit d4818ec

Please sign in to comment.