Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install in Roundcubemail as root package #48

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
// also prevent bounding of unwanted variables for GC
'use_arrow_functions' => false,

# TODO
// TODO
'align_multiline_comment' => false,
'array_indentation' => false,
'binary_operator_spaces' => false,
Expand Down
16 changes: 0 additions & 16 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ parameters:
message: '~^Constant RCMAIL_VERSION not found\.$~'
path: 'src/ExtensionInstaller.php'
count: 3
-
message: '~^Call to static method db_init\(\) on an unknown class rcmail_utils\.$~'
path: 'src/ExtensionInstaller.php'
count: 1
-
message: '~^Call to static method db_update\(\) on an unknown class rcmail_utils\.$~'
path: 'src/ExtensionInstaller.php'
count: 1
-
message: '~^Method Roundcube\\Composer\\ExtensionInstaller::install\(\) should return React\\Promise\\PromiseInterface<void\|null>|null but return statement is missing\.$~'
path: 'src/ExtensionInstaller.php'
Expand All @@ -43,14 +35,6 @@ parameters:
message: '~^Short ternary operator is not allowed\. Use null coalesce operator if applicable or consider using long ternary\.$~'
path: 'src/ExtensionInstaller.php'
count: 1
-
message: '~^Instantiated class rcube_config not found\.$~'
path: 'src/ExtensionInstaller.php'
count: 1
-
message: '~^Call to method resolve_paths\(\) on an unknown class rcube_config\.$~'
path: 'src/ExtensionInstaller.php'
count: 1
-
message: '~^Call to function in_array\(\) requires parameter #3 to be set\.$~'
path: 'src/PluginInstaller.php'
Expand Down
7 changes: 7 additions & 0 deletions src/ExtensionInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ abstract class ExtensionInstaller extends LibraryInstaller

protected function getRoundcubemailInstallPath(): string
{
$rootPackage = $this->composer->getPackage();
if ($rootPackage->getName() === 'roundcube/roundcubemail') {
$this->initializeVendorDir();

return dirname($this->vendorDir);
}

$roundcubemailPackage = $this->composer
->getRepositoryManager()
->findPackage('roundcube/roundcubemail', '*');
Expand Down