mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-03 03:46:30 +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
|
# v1.10.41
|
||||||
## 05/09/2023
|
## 05/09/2023
|
||||||
|
|
||||||
|
|||||||
@@ -1438,15 +1438,17 @@ class Admin
|
|||||||
*/
|
*/
|
||||||
public function lastBackup()
|
public function lastBackup()
|
||||||
{
|
{
|
||||||
$file = JsonFile::instance($this->grav['locator']->findResource('log://backup.log'));
|
$backup_file = $this->grav['locator']->findResource('log://backup.log');
|
||||||
$content = $file->content();
|
|
||||||
if (empty($content)) {
|
if (!file_exists($backup_file)) {
|
||||||
return [
|
return [
|
||||||
'days' => '∞',
|
'days' => '∞',
|
||||||
'chart_fill' => 100,
|
'chart_fill' => 100,
|
||||||
'chart_empty' => 0
|
'chart_empty' => 0
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
$file = JsonFile::instance($backup_file);
|
||||||
|
$content = $file->content();
|
||||||
|
|
||||||
$backup = new \DateTime();
|
$backup = new \DateTime();
|
||||||
$backup->setTimestamp($content['time']);
|
$backup->setTimestamp($content['time']);
|
||||||
|
|||||||
Reference in New Issue
Block a user