Skip to content

Commit e3c8182

Browse files
committed
Scheduler workaround because of disabled proc_open
1 parent b55b003 commit e3c8182

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Plugin.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
include_once(__DIR__ . '/helpers/helpers.php'); // for version without Composer
44

55
use System\Classes\PluginBase;
6+
use Artisan;
67

78
/**
89
* SmallBackup Plugin Information File
@@ -44,13 +45,23 @@ public function register()
4445
public function registerSchedule($schedule)
4546
{
4647
if (Models\Settings::get('db_auto')) {
47-
$schedule->command('smallbackup:db')->daily();
48+
// $schedule->command('smallbackup:db')->daily();
49+
// Workaround because of shared hostings disables proc_open
50+
$schedule->call(function () {
51+
Artisan::call('smallbackup:db');
52+
})->daily();
4853
}
4954
if (Models\Settings::get('theme_auto')) {
50-
$schedule->command('smallbackup:theme')->daily();
55+
// $schedule->command('smallbackup:theme')->daily();
56+
$schedule->call(function () {
57+
Artisan::call('smallbackup:theme');
58+
})->daily();
5159
}
5260
if (Models\Settings::get('storage_auto')) {
53-
$schedule->command('smallbackup:storage')->daily();
61+
// $schedule->command('smallbackup:storage')->daily();
62+
$schedule->call(function () {
63+
Artisan::call('smallbackup:storage');
64+
})->daily();
5465
}
5566
}
5667

0 commit comments

Comments
 (0)