mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 19:36:08 +01:00
fixed another deprecation issue
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# v1.10.41.1
|
||||
## mm/dd/2023
|
||||
|
||||
1. [](#improved)
|
||||
* Fixed another Toolbox deprecation error for `lastBackup()`
|
||||
|
||||
# v1.10.41
|
||||
## 05/09/2023
|
||||
|
||||
|
||||
@@ -1438,15 +1438,17 @@ class Admin
|
||||
*/
|
||||
public function lastBackup()
|
||||
{
|
||||
$file = JsonFile::instance($this->grav['locator']->findResource('log://backup.log'));
|
||||
$content = $file->content();
|
||||
if (empty($content)) {
|
||||
$backup_file = $this->grav['locator']->findResource('log://backup.log');
|
||||
|
||||
if (!file_exists($backup_file)) {
|
||||
return [
|
||||
'days' => '∞',
|
||||
'chart_fill' => 100,
|
||||
'chart_empty' => 0
|
||||
];
|
||||
}
|
||||
$file = JsonFile::instance($backup_file);
|
||||
$content = $file->content();
|
||||
|
||||
$backup = new \DateTime();
|
||||
$backup->setTimestamp($content['time']);
|
||||
|
||||
Reference in New Issue
Block a user