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

Call to undefined method Hussainweb\DrupalComposerHelper\Options::getWebPrefix() #15

Closed
ric-donaldp opened this issue Sep 9, 2019 · 2 comments

Comments

@ric-donaldp
Copy link

ric-donaldp commented Sep 9, 2019

Running on a server using PHP 5.6 there seems to be some issues with the Beta 4 version.

Composer just updated to beta4 version of DrupalComposerHelper and then failed with the following error:

PHP Fatal error: Call to undefined method Hussainweb\DrupalComposerHelper\Options::getWebPrefix() in /....../vendor/hussainweb/drupal-composer-helper/src/DrupalFiles.php on line 26

Subsequent calls to composer update give this error:

PHP Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /...../vendor/hussainweb/drupal-composer-helper/src/Options.php on line 9

Line 9 is:
public const DEFAULT_WEB_PREFIX = 'web';

for which the syntax was added with PHP 7.1.0 according to this:
https://www.php.net/manual/en/language.oop5.constants.php

I should add this is for a Drupal 7 project.
Reverting to the beta3 version to get around the issue.

@hussainweb
Copy link
Owner

Thanks for reporting this. Since this change is already out, I am thinking of how to handle the multiple versions. Since Drupal is dropping PHP 5.6 support soon, this is not very important but I want to do this cleanly.

@hussainweb
Copy link
Owner

There are two problems referenced in this issue. I have created #16 to fix the problem about PHP Parse error. I am not sure how to avoid the first problem but the workaround is to just run composer install again.

hussainweb added a commit that referenced this issue Oct 6, 2019
Fixes #15: Remove the visbility modifier for const.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants