diff --git a/bin/omarchy-install-dev-env b/bin/omarchy-install-dev-env index 751572a5..f59e5f07 100755 --- a/bin/omarchy-install-dev-env +++ b/bin/omarchy-install-dev-env @@ -1,13 +1,14 @@ #!/bin/bash if [[ -z "$1" ]]; then - echo "Usage: omarchy-instal-dev-env " >&2 + echo "Usage: omarchy-instal-dev-env " >&2 exit 1 fi install_php() { - yay -Sy php composer --noconfirm + yay -Sy php composer php-sqlite --noconfirm + # Install Path for Composer if [[ ":$PATH:" != *":$HOME/.config/composer/vendor/bin:"* ]]; then echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >>"$HOME/.bashrc" source "$HOME/.bashrc" @@ -15,6 +16,21 @@ install_php() { else echo "Composer global bin directory already in PATH." fi + + # Enable some extensions + local php_ini_path="/etc/php/php.ini" + local extensions_to_enable=( + "bcmath" + "intl" + "iconv" + "openssl" + "pdo_sqlite" + "pdo_mysql" + ) + + for ext in "${extensions_to_enable[@]}"; do + sudo sed -i "s/^;extension=${ext}/extension=${ext}/" "$php_ini_path" + done } case "$1" in @@ -41,6 +57,10 @@ go) echo -e "Installing Go...\n" mise use --global go@latest ;; +php) + echo -e "Installing PHP...\n" + install_php + ;; laravel) echo -e "Installing PHP and Laravel...\n" install_php diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 04b64fe8..25373860 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -262,7 +262,8 @@ show_install_javascript_menu() { } show_install_php_menu() { - case $(menu "Install" " Laravel\n Symfony") in + case $(menu "Install" " PHP\n Laravel\n Symfony") in + *PHP*) present_terminal "omarchy-install-dev-env php" ;; *Laravel*) present_terminal "omarchy-install-dev-env laravel" ;; *Symfony*) present_terminal "omarchy-install-dev-env symfony" ;; *) show_install_development_menu ;;