diff --git a/src/components/CopyCodeButton.astro b/src/components/CopyCodeButton.astro index ca9974b..5c91f9a 100644 --- a/src/components/CopyCodeButton.astro +++ b/src/components/CopyCodeButton.astro @@ -3,9 +3,24 @@ const { code } = Astro.props; --- @@ -23,10 +38,11 @@ const { code } = Astro.props; button.addEventListener("click", () => { const code = button.getAttribute("data-code"); copyToClipboard(code); + const oldContent = button.getHTML(); button.textContent = "Copied!"; setTimeout(() => { - button.textContent = "Copy"; - }, 2000); + button.innerHTML = oldContent; + }, 3000); }); }); diff --git a/src/presets/laravel.sh b/src/presets/laravel.sh index c21a586..a8d1d2b 100644 --- a/src/presets/laravel.sh +++ b/src/presets/laravel.sh @@ -83,35 +83,67 @@ sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php wait_for_apt_lock sudo apt-get update -y -# Install PHP with selected extensions +# Install PHP with required extensions +# +# Core: +# - fpm: FastCGI Process Manager +# - cli: Command Line Interface +# +# Common: +# - bcmath: Precise mathematical operations +# - curl: HTTP requests support +# - mbstring: Multibyte string handling +# - intl: Internationalization support +# - xml: XML parsing and generation +# - zip: ZIP archive handling +# +# Database: +# - mysql: MySQL/MariaDB database driver +# - sqlite3: SQLite database driver +# - pgsql: PostgreSQL database driver +# +# Image Processing: +# - gd: Image creation and manipulation +# - imagick: ImageMagick integration for advanced image processing +# +# Caching & Serialization: +# - igbinary: Efficient data serialization +# - memcached: Memcached caching system integration +# - redis: Redis caching system integration +# +# Development & Testing: +# - xdebug: Debugging and profiling tool +# - pcov: Efficient PHP code coverage tool info "Installing PHP and extensions...\n" -sudo apt-get install -y php$PHP_VERSION-fpm \ - php$PHP_VERSION-bcmath \ +sudo apt-get install -y zip unzip \ + php$PHP_VERSION-fpm \ php$PHP_VERSION-cli \ - php$PHP_VERSION-common \ + php$PHP_VERSION-bcmath \ php$PHP_VERSION-curl \ - php$PHP_VERSION-dev \ + php$PHP_VERSION-mbstring \ + php$PHP_VERSION-intl \ + php$PHP_VERSION-xml \ + php$PHP_VERSION-zip \ + php$PHP_VERSION-mysql \ + php$PHP_VERSION-sqlite3 \ + php$PHP_VERSION-pgsql \ php$PHP_VERSION-gd \ - php$PHP_VERSION-igbinary \ php$PHP_VERSION-imagick \ + php$PHP_VERSION-igbinary \ + php$PHP_VERSION-memcached \ + php$PHP_VERSION-redis \ + php$PHP_VERSION-xdebug \ + php$PHP_VERSION-pcov + +# Install Laravel required extensions +info "Installing extensions required by Laravel...\n" +sudo apt-get install -y openssl \ php$PHP_VERSION-imap \ - php$PHP_VERSION-intl \ php$PHP_VERSION-ldap \ - php$PHP_VERSION-mbstring \ - php$PHP_VERSION-memcached \ php$PHP_VERSION-msgpack \ - php$PHP_VERSION-mysql \ - php$PHP_VERSION-pcov \ - php$PHP_VERSION-pgsql \ php$PHP_VERSION-readline \ - php$PHP_VERSION-redis \ php$PHP_VERSION-soap \ - php$PHP_VERSION-sqlite3 \ - php$PHP_VERSION-swoole \ - php$PHP_VERSION-xdebug \ - php$PHP_VERSION-xml \ - php$PHP_VERSION-zip \ - zip unzip openssl + php$PHP_VERSION-swoole # Switch system's default PHP to the newly installed version sudo update-alternatives --set php /usr/bin/php$PHP_VERSION diff --git a/src/presets/php.sh b/src/presets/php.sh index a4e4a7b..3c58e42 100644 --- a/src/presets/php.sh +++ b/src/presets/php.sh @@ -83,34 +83,57 @@ sudo LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php wait_for_apt_lock sudo apt-get update -y -# Install PHP with selected extensions +# Install PHP with required extensions +# +# Core: +# - fpm: FastCGI Process Manager +# - cli: Command Line Interface +# +# Common: +# - bcmath: Precise mathematical operations +# - curl: HTTP requests support +# - mbstring: Multibyte string handling +# - intl: Internationalization support +# - xml: XML parsing and generation +# - zip: ZIP archive handling +# +# Database: +# - mysql: MySQL/MariaDB database driver +# - sqlite3: SQLite database driver +# - pgsql: PostgreSQL database driver +# +# Image Processing: +# - gd: Image creation and manipulation +# - imagick: ImageMagick integration for advanced image processing +# +# Caching & Serialization: +# - igbinary: Efficient data serialization +# - memcached: Memcached caching system integration +# - redis: Redis caching system integration +# +# Development & Testing: +# - xdebug: Debugging and profiling tool +# - pcov: Efficient PHP code coverage tool info "Installing PHP and extensions...\n" -sudo apt-get install -y php$PHP_VERSION-fpm \ - php$PHP_VERSION-bcmath \ +sudo apt-get install -y zip unzip \ + php$PHP_VERSION-fpm \ php$PHP_VERSION-cli \ + php$PHP_VERSION-bcmath \ php$PHP_VERSION-curl \ - php$PHP_VERSION-dev \ + php$PHP_VERSION-mbstring \ + php$PHP_VERSION-intl \ + php$PHP_VERSION-xml \ + php$PHP_VERSION-zip \ + php$PHP_VERSION-mysql \ + php$PHP_VERSION-sqlite3 \ + php$PHP_VERSION-pgsql \ php$PHP_VERSION-gd \ - php$PHP_VERSION-igbinary \ php$PHP_VERSION-imagick \ - php$PHP_VERSION-imap \ - php$PHP_VERSION-intl \ - php$PHP_VERSION-ldap \ - php$PHP_VERSION-mbstring \ + php$PHP_VERSION-igbinary \ php$PHP_VERSION-memcached \ - php$PHP_VERSION-msgpack \ - php$PHP_VERSION-mysql \ - php$PHP_VERSION-pcov \ - php$PHP_VERSION-pgsql \ - php$PHP_VERSION-readline \ php$PHP_VERSION-redis \ - php$PHP_VERSION-soap \ - php$PHP_VERSION-sqlite3 \ - php$PHP_VERSION-swoole \ php$PHP_VERSION-xdebug \ - php$PHP_VERSION-xml \ - php$PHP_VERSION-zip \ - zip unzip + php$PHP_VERSION-pcov # Switch system's default PHP to the newly installed version sudo update-alternatives --set php /usr/bin/php$PHP_VERSION