App aus Dateinamen entfernt

This commit is contained in:
2025-06-03 23:13:07 +02:00
parent a9203e515d
commit 17f2c9d9d1
17 changed files with 62 additions and 61 deletions

View File

@@ -0,0 +1,41 @@
package Xxx::Helpers;
use Mojo::Base 'Mojolicious::Plugin';
sub register {
my ($self, $app, $args) = @_;
$app->helper('trim' => \&_trim);
$app->helper('debuglog' => \&_debuglog);
$app->helper('authenticate' => \&_authenticate);
$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;
}
sub _authenticate {
my ($c, $username, $password) = @_;
return 1; # or return 0 on failure
}
1;