Skip to content

Commit 166ae92

Browse files
64knlkeeama13
andauthored
Version 0.15.1 (#190)
* feat: component filter added (#176) * fix: only add column when it doesn't exist (#167) * fix: only add column when it doesn't exist * style: formatting * feat: export cms (#169) * feat: import export * feat: use file instead of database * feat: move import/export to model * fix: export from tableitem * feat: move export to Trait * style: formatting * style: formatting * fix: never use file as source of truth * style: formatting * chore: cleanup * fix: use export to file * feat: comment things that no longer work * feat: add meta data * feat: list filenames * feat: cleaner export * feat: remove UI for import/export * style: formatting * feat: add import command * feat: import from files * feat: remove import UI * feat: prevent editing tables with changes on disk * feat: do not use id's in export for tables * feat: optionally export ids * feat: import ids when available --------- Co-authored-by: Rene <[email protected]> * feat: component filter added * feat: added filterparams * feat: only query if filter exists * feat: WIP * feat: typed editor classes * feat: editor changes * feat: removed code * feat: removed request from editor and overview * feat: added TODO * chore: update dependency * feat: migration for model column in cms_table * fix: retain model on import export cms_table * feat: moved code to component * feat: added guards * style: formatting * feat: parameters now in tableservice * feat: removed parameter * feat: removed request() from editor * fix: return empty array if key not exists * style: formatting * style: formatting --------- Co-authored-by: René <[email protected]> * fix: exceptions handling (#189) * fix: exception handling * style: formatting * fix: return type * feat: date helper (#191) --------- Co-authored-by: Xander Schuurman <[email protected]>
1 parent 9c69fab commit 166ae92

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/Helpers/SitebossHelper.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ public static function config(string $code, bool $failOnMissing = true): string|
4040
return self::$config[$code]['value'];
4141
}
4242

43-
public static function mail(string $to_name, string $to_email, string $subject, $html, $data = false)
43+
public static function mail(string $to_name, string $to_email, string $subject, $html, $data = false): ?int
4444
{
45+
trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED);
4546
$sendgrid_api_key = self::config('sendgrid_api_key', true);
4647
$sendgrid_sender_email = self::config('sendgrid_sender_email', true);
4748
$sendgrid_sender_name = self::config('sendgrid_sender_name', true);
@@ -60,22 +61,16 @@ public static function mail(string $to_name, string $to_email, string $subject,
6061
}
6162
}
6263

63-
// if ($data != false) {
64-
// // HTML is a Twig template with data
65-
// if(!site::$page->twig)
66-
// {
67-
// site::$page->getTwig();
68-
// }
69-
// $html = site::$page->twig->render($html, $data);
70-
// }
7164
$email->addContent('text/html', $html);
7265
$sendgrid = new \SendGrid($sendgrid_api_key);
7366
try {
7467
$response = $sendgrid->send($email);
7568

7669
return $response->statusCode();
7770
} catch (\Exception $e) {
78-
echo 'Caught exception: '.$e->getMessage()."\n";
71+
Log::error('Caught exception: '.$e->getMessage());
72+
73+
return null;
7974
}
8075
}
8176

@@ -117,4 +112,13 @@ public static function makeDirectory($root, $dir): bool
117112

118113
return true;
119114
}
115+
116+
public static function formatDate($date): string
117+
{
118+
if (is_null($date)) {
119+
return '-';
120+
}
121+
122+
return date('d-m-Y H:i:s', strtotime($date));
123+
}
120124
}

src/Services/ClamAV/ClamAV.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private static function getClamAVSocket(): string
9494
$unixSocket = config('clamav.unix_socket');
9595

9696
return 'unix://'.$unixSocket;
97-
} else {
97+
} elseif ($preferredSocket === 'tcp') {
9898
$tcpSocket = config('clamav.tcp_socket');
9999

100100
return $tcpSocket;

0 commit comments

Comments
 (0)