Skip to content

Commit

Permalink
refactor: app manage
Browse files Browse the repository at this point in the history
  • Loading branch information
jevantang committed Mar 23, 2024
1 parent a190ca1 commit adde06b
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 291 deletions.
33 changes: 0 additions & 33 deletions src/Commands/MarketActivateCommand.php

This file was deleted.

33 changes: 0 additions & 33 deletions src/Commands/MarketDeactivateCommand.php

This file was deleted.

36 changes: 0 additions & 36 deletions src/Commands/MarketRemovePluginCommand.php

This file was deleted.

10 changes: 6 additions & 4 deletions src/Commands/MarketRequireCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ public function getPluginPath($fskey)
return $fskey;
}

$pluginsPath = config('markets.paths.base');
$pluginsPath = config('markets.paths.plugins', base_path());

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

public function getThemePath($fskey)
{
$themesPath = config('markets.paths.base');
$themesPath = config('markets.paths.themes', base_path());

return sprintf('%s/themes/%s', rtrim($themesPath), ltrim($fskey, '/'));
return sprintf('%s/%s', rtrim($themesPath), ltrim($fskey, '/'));
}

public function getPluginDirectory($fskey)
Expand Down Expand Up @@ -146,7 +146,9 @@ public function handle()

if ($type == 'local') {
if ($this->isLocalPath($fskey) == false) {
$type = null;
$this->error("Not the correct plugin. pluginFsKey: $fskey");

return Command::FAILURE;
}
}

Expand Down
44 changes: 0 additions & 44 deletions src/Listeners/PluginActivatedListener.php

This file was deleted.

44 changes: 0 additions & 44 deletions src/Listeners/PluginDeactivatedListener.php

This file was deleted.

1 change: 1 addition & 0 deletions src/Listeners/PluginInstalledListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function handle($event): void

return;
}
$pluginJson['type'] = 'plugin';

App::handleAppData($pluginJson);
}
Expand Down
42 changes: 0 additions & 42 deletions src/Listeners/PluginUninstalledListener.php

This file was deleted.

4 changes: 3 additions & 1 deletion src/Listeners/ThemeInstalledListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ public function handle($event): void

return;
}
$themeJson['type'] = 'theme';

if ($themeJson['functions'] ?? null) {
$functions = $themeJson['functions'] ?? false;
if ($functions) {
$themeJson['settingsPath'] = $fskey;
}

Expand Down
42 changes: 0 additions & 42 deletions src/Listeners/ThemeUninstalledListener.php

This file was deleted.

Loading

0 comments on commit adde06b

Please sign in to comment.