| 1 | package Daje::Plugin::Mail; | ||
| 2 | 0 | ▶ | use Mojo::Base 'Mojolicious::Plugin', -base, -signatures; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 3 | use v5.42; | ||
| 4 | |||
| 5 | # NAME | ||
| 6 | # ==== | ||
| 7 | # | ||
| 8 | # Daje::Plugin::Mail - Mojolicious Plugin | ||
| 9 | # | ||
| 10 | # SYNOPSIS | ||
| 11 | # ======== | ||
| 12 | # | ||
| 13 | # Mojolicious | ||
| 14 | # =========== | ||
| 15 | # | ||
| 16 | # $self->plugin('Mail'); | ||
| 17 | # | ||
| 18 | # Mojolicious::Lite | ||
| 19 | # ================= | ||
| 20 | # | ||
| 21 | # plugin 'Mail'; | ||
| 22 | # | ||
| 23 | # DESCRIPTION | ||
| 24 | # =========== | ||
| 25 | # | ||
| 26 | # Daje::Plugin::Mail is a Mojolicious plugin. | ||
| 27 | # | ||
| 28 | # METHODS | ||
| 29 | # ======= | ||
| 30 | # | ||
| 31 | # Daje::Plugin::Mail inherits all methods from | ||
| 32 | # Mojolicious::Plugin and implements the following new ones. | ||
| 33 | # | ||
| 34 | # register | ||
| 35 | # ======== | ||
| 36 | # $plugin->register(Mojolicious->new); | ||
| 37 | # | ||
| 38 | # Register plugin in L<Mojolicious> application. | ||
| 39 | # | ||
| 40 | # SEE ALSO | ||
| 41 | # ======== | ||
| 42 | # | ||
| 43 | # Mojolicious, Mojolicious::Guides, https://mojolicious.org. | ||
| 44 | # | ||
| 45 | # LICENSE | ||
| 46 | # ======= | ||
| 47 | # | ||
| 48 | # Copyright (C) janeskil1525. | ||
| 49 | # | ||
| 50 | # This library is free software; you can redistribute it and/or modify | ||
| 51 | # it under the same terms as Perl itself. | ||
| 52 | # | ||
| 53 | # AUTHOR | ||
| 54 | # ====== | ||
| 55 | # | ||
| 56 | # janeskil1525 E<lt>janeskil1525@gmail.com | ||
| 57 | # | ||
| 58 | |||
| 59 | # This file is generated once automatically by Daje Tools 2026-01-28 15:54:08. | ||
| 60 | # It will not be touched by Daje Tools again. | ||
| 61 | |||
| 62 | # <!-- Autogenerated file 2026-01-28 15:54:08 --> | ||
| 63 | |||
| 64 | use Daje::Plugin::Mail::Routes; | ||
| 65 | use Daje::Plugin::Mail::Helpers; | ||
| 66 | use Daje::Database::Migrator; | ||
| 67 | use Daje::Plugin::Mail::Authorities; | ||
| 68 | |||
| 69 | our $VERSION = '0.01'; | ||
| 70 | |||
| 71 | sub register ($self, $app, $config) { | ||
| 72 | $app->log->debug("Daje::Plugin::Mail::register start"); | ||
| 73 | |||
| 74 | my $migration->{class} = 'Daje::Database::Mail'; | ||
| 75 | $migration->{name} = 'mail'; | ||
| 76 | $migration->{migration} = 1; | ||
| 77 | my $migrations; | ||
| 78 | push @{$migrations}, $migration; | ||
| 79 | try { | ||
| 80 | Daje::Database::Migrator->new( | ||
| 81 | pg => $app->pg, | ||
| 82 | migrations => $migrations, | ||
| 83 | )->migrate(); | ||
| 84 | } catch ($e) { | ||
| 85 | $app->log->error($e); | ||
| 86 | }; | ||
| 87 | |||
| 88 | Daje::Plugin::Mail::Routes->new()->routes($app, $config); | ||
| 89 | Daje::Plugin::Mail::Helpers->new()->helpers($app, $config); | ||
| 90 | Daje::Plugin::Mail::Authorities->new(db => $app->pg->db)->authorize(); | ||
| 91 | |||
| 92 | $app->log->debug("Daje::Plugin::Mail::register ends"); | ||
| 93 | } | ||
| 94 | |||
| 95 | 1; | ||
| 96 | |||
| 97 | |||
| 98 | |||
| 99 | #################### pod generated by Pod::Autopod - keep this line to make pod updates possible #################### | ||
| 100 | |||
| 101 | =head1 NAME | ||
| 102 | |||
| 103 | |||
| 104 | Daje::Plugin::Mail - Mojolicious Plugin | ||
| 105 | |||
| 106 | |||
| 107 | |||
| 108 | =head1 SYNOPSIS | ||
| 109 | |||
| 110 | |||
| 111 | |||
| 112 | |||
| 113 | =head1 DESCRIPTION | ||
| 114 | |||
| 115 | |||
| 116 | Daje::Plugin::Mail is a Mojolicious plugin. | ||
| 117 | |||
| 118 | |||
| 119 | |||
| 120 | =head1 REQUIRES | ||
| 121 | |||
| 122 | L<Daje::Database::Migrator> | ||
| 123 | |||
| 124 | L<Daje::Plugin::Mail::Helpers> | ||
| 125 | |||
| 126 | L<Daje::Plugin::Mail::Routes> | ||
| 127 | |||
| 128 | L<v5.42> | ||
| 129 | |||
| 130 | L<Mojo::Base> | ||
| 131 | |||
| 132 | |||
| 133 | =head1 METHODS | ||
| 134 | |||
| 135 | |||
| 136 | Daje::Plugin::Mail inherits all methods from | ||
| 137 | Mojolicious::Plugin and implements the following new ones. | ||
| 138 | |||
| 139 | |||
| 140 | |||
| 141 | =head1 register | ||
| 142 | |||
| 143 | $plugin->register(Mojolicious->new); | ||
| 144 | |||
| 145 | Register plugin in L<Mojolicious> application. | ||
| 146 | |||
| 147 | |||
| 148 | |||
| 149 | =head1 Mojolicious | ||
| 150 | |||
| 151 | |||
| 152 | $self->plugin('Mail'); | ||
| 153 | |||
| 154 | |||
| 155 | |||
| 156 | =head1 Mojolicious::Lite | ||
| 157 | |||
| 158 | |||
| 159 | plugin 'Mail'; | ||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | =head1 SEE ALSO | ||
| 164 | |||
| 165 | |||
| 166 | Mojolicious, Mojolicious::Guides, https://mojolicious.org. | ||
| 167 | |||
| 168 | |||
| 169 | |||
| 170 | =head1 AUTHOR | ||
| 171 | |||
| 172 | |||
| 173 | janeskil1525 E<lt>janeskil1525@gmail.com | ||
| 174 | |||
| 175 | |||
| 176 | |||
| 177 | =head1 LICENSE | ||
| 178 | |||
| 179 | |||
| 180 | Copyright (C) janeskil1525. | ||
| 181 | |||
| 182 | This library is free software; you can redistribute it and/or modify | ||
| 183 | it under the same terms as Perl itself. | ||
| 184 | |||
| 185 | |||
| 186 | |||
| 187 | =cut | ||
| 188 | |||