Skip to content
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
22 changes: 19 additions & 3 deletions src/components/CopyCodeButton.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,24 @@ const { code } = Astro.props;
---

<button
class="top-[0.9rem] right-2 absolute bg-gray-700 hover:bg-gray-600 px-2 copy-code py-1 rounded font-bold text-sm text-white"
class="top-[0.9rem] right-2 absolute flex items-center gap-1 bg-gray-700 hover:bg-gray-600 px-2 copy-code py-1 rounded font-bold text-sm text-white"
data-code={code}
>
<span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path
d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg
>
</span>
Copy
</button>

Expand All @@ -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);
});
});
</script>
70 changes: 51 additions & 19 deletions src/presets/laravel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
63 changes: 43 additions & 20 deletions src/presets/php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down