Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Iseard
Kudos-Donations
Commits
08c21062
Commit
08c21062
authored
Dec 21, 2020
by
Michael Iseard
Browse files
Minor service refactor
parent
e00fa5a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Service/ActivatorService.php
View file @
08c21062
...
...
@@ -32,11 +32,11 @@ class ActivatorService {
*/
public
static
function
activate
(
$old_version
=
null
)
{
$logger
=
LoggerService
::
factory
();
$logger
::
init
();
$logger
=
new
LoggerService
();
$logger
->
init
();
$twig
=
new
TwigService
();
$twig
->
initCache
();
$twig
->
init
();
self
::
create_donors_table
();
self
::
create_transactions_table
();
self
::
create_subscriptions_table
();
...
...
app/Service/LoggerService.php
View file @
08c21062
...
...
@@ -38,13 +38,17 @@ class LoggerService extends Monolog {
*
* @since 1.0.0
*/
public
static
function
init
()
{
public
function
init
()
{
if
(
wp_mkdir_p
(
self
::
LOG_DIR
)
)
{
Utils
::
schedule_recurring_action
(
strtotime
(
'tomorrow'
),
DAY_IN_SECONDS
,
'kudos_clear_log'
);
$this
->
info
(
'Log directory created successfully'
);
Utils
::
schedule_recurring_action
(
strtotime
(
'tomorrow'
),
WEEK_IN_SECONDS
,
'kudos_clear_log'
);
return
;
}
}
/**
...
...
app/Service/TwigService.php
View file @
08c21062
...
...
@@ -147,7 +147,7 @@ class TwigService extends AbstractService {
*
* @since 2.0.0
*/
public
function
init
Cache
()
{
public
function
init
()
{
$logger
=
$this
->
logger
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment