Skip to content

Commit d657f5a

Browse files
authored
Fixed an issue when .composer folder does not exitsts (hestiacp#1982)
* Fixed an issue when .composer folder does not exitsts Install of composer failed when .composer is missing * Fix markup
1 parent cd4c13d commit d657f5a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
1111
- Fixed #1956 to prevent reset of defined webmail client.
1212
- Explicitly disable cron reports #1978
1313
- Fixed an issue where in rare cases certificate failed to install @dpeca and @myvesta
14+
- Fixed an issue where composer failed to install when .composer folder is missing
1415

1516
## [1.4.5] - Service release
1617

web/src/app/System/HestiaApp.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ public function installComposer($version)
6969
}
7070

7171
$install_folder = $this->getUserHomeDir() . DIRECTORY_SEPARATOR . '.composer';
72+
73+
if (!file_exists($install_folder)) {
74+
exec(HESTIA_CMD .'v-rebuild-user '.$this -> user(), $output, $return_code);
75+
if($return_code !== 0){
76+
throw new \Exception("Unable to rebuild user");
77+
}
78+
}
79+
7280
$this->runUser('v-run-cli-cmd', ["/usr/bin/php", $composer_setup, "--quiet", "--install-dir=".$install_folder, "--filename=composer", "--$version" ], $status);
7381

7482
unlink($composer_setup);

0 commit comments

Comments
 (0)