first commit

This commit is contained in:
2025-04-09 21:43:00 +02:00
commit af5be2794d
39 changed files with 1947 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package XxxApp::Helpers;
use Mojo::Base 'Mojolicious::Plugin';
sub register {
my ($self, $app, $args) = @_;
$app->helper('trim' => \&_trim);
$app->helper('debuglog' => \&_debuglog);
$app->log->info(sprintf('REGISTERED: %s', __PACKAGE__)) if !!$args->{verbose};
return;
}
# Führende und nachfolgende Leerzeichen entfernen
sub _trim {
my ($c, $str) = @_;
$str =~ s/^\s+|\s+$//g;
return $str;
};
sub _debuglog {
my ($c, $info) = @_;
if ( $c->config->{logging}->{level} =~ /trace|debug/ ) {
$c->log->debug($info);
}
return 1;
}
1;