Removed application folder (Ci3) added maintenance mode
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use CodeIgniter\CLI\BaseCommand;
|
||||
use CodeIgniter\CLI\CLI;
|
||||
|
||||
class Up extends BaseCommand
|
||||
{
|
||||
protected $group = 'Housekeeping';
|
||||
protected $name = 'up';
|
||||
protected $description = 'Bring the application out of maintenance mode.';
|
||||
protected $usage = 'up';
|
||||
|
||||
public function run(array $params)
|
||||
{
|
||||
$filePath = WRITEPATH . 'down';
|
||||
|
||||
if (! file_exists($filePath)) {
|
||||
CLI::write('Application is not in maintenance mode.', 'yellow');
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (unlink($filePath)) {
|
||||
CLI::write('Application is now live.', 'green');
|
||||
} else {
|
||||
CLI::error('Failed to disable maintenance mode. Check file permissions.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user