theme uninstall add
This commit is contained in:
@ -42,8 +42,24 @@ class AdminThemeController extends ConsoleController
|
||||
|
||||
$this->out->r("Тема " . $manifest['name'] . " установлена", 'green');
|
||||
}
|
||||
}
|
||||
|
||||
public function actionUninstallTheme(): void
|
||||
{
|
||||
if (!isset($this->argv['path'])) {
|
||||
throw new \Exception('Missing admin theme path "--path" specified');
|
||||
}
|
||||
|
||||
if (file_exists(ROOT_DIR . $this->argv['path'])) {
|
||||
$themeName = basename($this->argv['path']);
|
||||
$fileHelper = new Files();
|
||||
$fileHelper->recursiveRemoveDir(ROOT_DIR . $this->argv['path']);
|
||||
$fileHelper->recursiveRemoveDir(RESOURCES_DIR . '/' . $themeName);
|
||||
|
||||
$this->out->r("Тема удалена", 'green');
|
||||
} else {
|
||||
$this->out->r("Тема не найдена", 'red');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user