Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions lib/private/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,16 @@ private function isInstalledFromGit(string $appId): bool {
* Check if app is already downloaded
*
* The function will check if the app is already downloaded in the apps repository
* and has a valid appinfo/info.xml file.
*
* @return bool True if the app directory exists
*/
public function isDownloaded(string $name): bool {
public function isDownloaded(string $appId): bool {
foreach (\OC::$APPSROOTS as $dir) {
$dirToTest = $dir['path'];
$dirToTest .= '/';
$dirToTest .= $name;
$dirToTest .= '/';
$appPath = $dir['path'] . '/' . $appId;

if (is_dir($dirToTest)) {
// An app is considered "downloaded" if the directory exists with info.xml
if (is_dir($appPath) && file_exists($appPath . '/appinfo/info.xml')) {
return true;
}
}
Expand Down Expand Up @@ -587,18 +588,22 @@ private function installAppLastSteps(string $appPath, array $info, ?IOutput $out
}

/**
* install an app already placed in the app folder
* Install an app already placed in the app folder
*
* @param string $appId The app ID to install
* @param IOutput|null $output Optional output handler for logging installation progress
* @return string|false App ID on success, false on failure
*/
public function installShippedApp(string $app, ?IOutput $output = null): string|false {
public function installShippedApp(string $appId, ?IOutput $output = null): string|false {
if ($output instanceof IOutput) {
$output->debug('Installing ' . $app);
$output->debug('Installing ' . $appId);
}
$info = $this->appManager->getAppInfo($app);
if (is_null($info) || $info['id'] !== $app) {
$info = $this->appManager->getAppInfo($appId);
if (is_null($info) || $info['id'] !== $appId) {
return false;
}

$appPath = $this->appManager->getAppPath($app);
$appPath = $this->appManager->getAppPath($appId);

return $this->installAppLastSteps($appPath, $info, $output, 'yes');
}
Expand Down
Loading