Skip to content

Commit

Permalink
Move getDeletablePlugins to Helper
Browse files Browse the repository at this point in the history
- #11
  • Loading branch information
aljawaid committed May 8, 2023
1 parent 74bd50d commit 2bd7fb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 1 addition & 11 deletions Controller/ContentCleanerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,7 @@ public function show()
'title' => t('Settings') . ' ⥂ ' . t('Content Cleaner'),
'db_size' => $this->configModel->getDatabaseSize(),
'db_version' => $this->db->getDriver()->getDatabaseVersion(),
'deletable_plugins' => $this->getDeletablePlugins(),
'deletable_plugins' => $this->helper->pluginCleaningHelper->getDeletablePlugins(),
)));
}

public function getDeletablePlugins()
{
// GET THE JSON OF PLUGINS WHICH CAN BE DELETED
// 'template/cleaning-jobs/plugin-cleaning.json'

$file = PLUGINS_DIR . '/ContentCleaner/Template/cleaning-jobs/plugin-cleaning.json';
$plugins = json_decode(file_get_contents($file), true);
return $plugins;
}
}
9 changes: 9 additions & 0 deletions Helper/PluginCleaningHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@

class PluginCleaningHelper extends Base
{
public function getDeletablePlugins()
{
// GET THE JSON OF PLUGINS WHICH CAN BE DELETED
// 'template/cleaning-jobs/plugin-cleaning.json'

$file = PLUGINS_DIR . '/ContentCleaner/Template/cleaning-jobs/plugin-cleaning.json';
$plugins = json_decode(file_get_contents($file), true);
return $plugins;
}
}

0 comments on commit 2bd7fb5

Please sign in to comment.