Skip to content

Commit de5b944

Browse files
committed
Allow to create new plugins without updating every time list on update
1 parent 9e66853 commit de5b944

File tree

23 files changed

+76
-22
lines changed

23 files changed

+76
-22
lines changed

web/add/webapp/index.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,20 @@
3030
exit;
3131
}
3232

33-
$v_web_apps = [
34-
[ 'name'=>'Wordpress', 'group'=>'cms', 'enabled'=>true, 'version'=>'latest', 'thumbnail'=>'/images/webapps/wp-thumb.png' ],
35-
[ 'name'=>'Drupal', 'group'=>'cms', 'enabled'=>false,'version'=>'latest', 'thumbnail'=>'/images/webapps/drupal-thumb.png' ],
36-
[ 'name'=>'Joomla', 'group'=>'cms', 'enabled'=>false,'version'=>'latest', 'thumbnail'=>'/images/webapps/joomla-thumb.png' ],
37-
38-
[ 'name'=>'Opencart', 'group'=>'ecommerce', 'enabled'=>true, 'version'=>'3.0.3.3', 'thumbnail'=>'/images/webapps/opencart-thumb.png' ],
39-
[ 'name'=>'Prestashop', 'group'=>'ecommerce', 'enabled'=>true, 'version'=>'1.7.7.1', 'thumbnail'=>'/images/webapps/prestashop-thumb.png' ],
40-
41-
[ 'name'=>'Laravel', 'group'=>'starter', 'enabled'=>true, 'version'=>'7.x', 'thumbnail'=>'/images/webapps/laravel-thumb.png' ],
42-
[ 'name'=>'Symfony', 'group'=>'starter', 'enabled'=>true, 'version'=>'4.3.x', 'thumbnail'=>'/images/webapps/symfony-thumb.png' ],
43-
];
33+
$appInstallers = glob(__DIR__.'/../../src/app/WebApp/Installers/*/app.json');
34+
$v_web_apps = array();
35+
foreach($appInstallers as $app){
36+
$json = json_decode(file_get_contents($app));
37+
$array[$json -> name] = $json;
38+
$v_web_apps = array_merge($v_web_apps, $array);
39+
}
4440

4541
// Check GET request
4642
if (!empty($_GET['app'])) {
4743
$app = basename($_GET['app']);
4844

4945
$hestia = new \Hestia\System\HestiaApp();
50-
$app_installer_class = '\Hestia\WebApp\Installers\\' . $app . 'Setup';
46+
$app_installer_class = '\Hestia\WebApp\Installers\\'.$app.'\\' . $app . 'Setup';
5147
if(class_exists($app_installer_class)) {
5248
try {
5349
$app_installer = new $app_installer_class($v_domain, $hestia);
-61.9 KB
Binary file not shown.
-32.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "Drupal",
3+
"group": "cms",
4+
"enabled": false,
5+
"version": "latest",
6+
"thumbnail": "drupal-thumb.png"
7+
}
File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "Joomla",
3+
"group": "cms",
4+
"enabled": false,
5+
"version": "latest",
6+
"thumbnail": "joomla-thumb.png"
7+
}
File renamed without changes.

web/src/app/WebApp/Installers/LaravelSetup.php renamed to web/src/app/WebApp/Installers/Laravel/LaravelSetup.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
namespace Hestia\WebApp\Installers;
3+
namespace Hestia\WebApp\Installers\Laravel;
4+
5+
use \Hestia\WebApp\Installers\BaseSetup as BaseSetup;
46

57
class LaravelSetup extends BaseSetup {
68

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "Laravel",
3+
"group": "framework",
4+
"enabled": true,
5+
"version": "7.x",
6+
"thumbnail": "laravel-thumb.png"
7+
}
File renamed without changes.

0 commit comments

Comments
 (0)