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

[CLI] Add functionality to change default system PHP version #91

Open
joglomedia opened this issue Jul 22, 2021 · 0 comments
Open

[CLI] Add functionality to change default system PHP version #91

joglomedia opened this issue Jul 22, 2021 · 0 comments
Assignees
Labels
new feature request New feature request / suggestion

Comments

@joglomedia
Copy link
Owner

joglomedia commented Jul 22, 2021

Proposed command line syntax:

lemperctl stack config php [email protected]

Add function to update default PHP version

RUNTIME=${1}

# Reserve default IFS
_IFS=${IFS}

IFS='@' read -r -a _RUNTIME <<< "${RUNTIME}"
PHP_VER_NUM="${_RUNTIME[1]}"

# Restore default IFS
IFS=${_IFS}

# Set the php version via update-alternatives

sudo update-alternatives --set php "$(command -v php${PHP_VER_NUM})"
sudo update-alternatives --set phar "$(command -v phar${PHP_VER_NUM})"
sudo update-alternatives --set phar.phar "$(command -v phar.phar${PHP_VER_NUM})"
sudo update-alternatives --set php-config "$(command -v php-config${PHP_VER_NUM})"
sudo update-alternatives --set phpize "$(command -v phpize${PHP_VER_NUM})"
@joglomedia joglomedia added the new feature request New feature request / suggestion label Jul 22, 2021
@joglomedia joglomedia self-assigned this Jul 22, 2021
@joglomedia joglomedia changed the title Add functionality to change default system PHP version from installed multi version Add functionality to change default system PHP version Jul 22, 2021
@joglomedia joglomedia changed the title Add functionality to change default system PHP version [NFR] Add functionality to change default system PHP version Aug 13, 2021
@joglomedia joglomedia changed the title [NFR] Add functionality to change default system PHP version [CLI] Add functionality to change default system PHP version Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature request New feature request / suggestion
Projects
None yet
Development

No branches or pull requests

1 participant