Skip to content

Commit adde06b

Browse files
committed
refactor: app manage
1 parent a190ca1 commit adde06b

13 files changed

+27
-291
lines changed

src/Commands/MarketActivateCommand.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/Commands/MarketDeactivateCommand.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/Commands/MarketRemovePluginCommand.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/Commands/MarketRequireCommand.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ public function getPluginPath($fskey)
4545
return $fskey;
4646
}
4747

48-
$pluginsPath = config('markets.paths.base');
48+
$pluginsPath = config('markets.paths.plugins', base_path());
4949

5050
return sprintf('%s/%s', rtrim($pluginsPath), ltrim($fskey, '/'));
5151
}
5252

5353
public function getThemePath($fskey)
5454
{
55-
$themesPath = config('markets.paths.base');
55+
$themesPath = config('markets.paths.themes', base_path());
5656

57-
return sprintf('%s/themes/%s', rtrim($themesPath), ltrim($fskey, '/'));
57+
return sprintf('%s/%s', rtrim($themesPath), ltrim($fskey, '/'));
5858
}
5959

6060
public function getPluginDirectory($fskey)
@@ -146,7 +146,9 @@ public function handle()
146146

147147
if ($type == 'local') {
148148
if ($this->isLocalPath($fskey) == false) {
149-
$type = null;
149+
$this->error("Not the correct plugin. pluginFsKey: $fskey");
150+
151+
return Command::FAILURE;
150152
}
151153
}
152154

src/Listeners/PluginActivatedListener.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/Listeners/PluginDeactivatedListener.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/Listeners/PluginInstalledListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function handle($event): void
4545

4646
return;
4747
}
48+
$pluginJson['type'] = 'plugin';
4849

4950
App::handleAppData($pluginJson);
5051
}

src/Listeners/PluginUninstalledListener.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/Listeners/ThemeInstalledListener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public function handle($event): void
4545

4646
return;
4747
}
48+
$themeJson['type'] = 'theme';
4849

49-
if ($themeJson['functions'] ?? null) {
50+
$functions = $themeJson['functions'] ?? false;
51+
if ($functions) {
5052
$themeJson['settingsPath'] = $fskey;
5153
}
5254

src/Listeners/ThemeUninstalledListener.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)