From: Sven Schöling Date: Tue, 11 Sep 2012 08:42:29 +0000 (+0200) Subject: Menu Instance als Singleton cachen. X-Git-Tag: release-3.0.0beta1~190 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d2c9cb3b30efe5842aa1118c7cc84eb61c9c5279;p=kivitendo-erp.git Menu Instance als Singleton cachen. --- diff --git a/SL/Menu.pm b/SL/Menu.pm index 3b994f2fb..844e3f56f 100644 --- a/SL/Menu.pm +++ b/SL/Menu.pm @@ -39,11 +39,15 @@ use SL::Inifile; use strict; +my $instance; + sub new { $main::lxdebug->enter_sub(); my ($type, $menufile) = @_; + return $instance if $instance; + my $self = {}; my $inifile = Inifile->new($menufile); @@ -55,7 +59,7 @@ sub new { $main::lxdebug->leave_sub(); - return $self; + return $instance = $self; } sub menuitem_js {