Fix null check for cart row in cart.blade.php to prevent errors when row is null

This commit is contained in:
Frank John Begornia
2026-02-23 01:50:12 +08:00
parent 59fc920498
commit 8b6a1cbbc8
4 changed files with 37 additions and 5856 deletions

View File

@@ -1,34 +1,30 @@
# Use PHP 7.0 with Apache (has native mcrypt support for Laravel 5.0)
FROM php:7.0-apache
# Update to use archived Debian repositories
RUN sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list \
&& sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list \
&& sed -i '/stretch-updates/d' /etc/apt/sources.list
# Use PHP 7.4 with Apache for Laravel 6.x
FROM php:7.4-apache
# Install system dependencies
RUN apt-get update && apt-get install -y --allow-unauthenticated \
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libmcrypt-dev \
libzip-dev \
zip \
unzip \
libfreetype6-dev \
libjpeg62-turbo-dev \
openssh-client \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
# Install PHP extensions (mcrypt is built-in for PHP 7.0)
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath mcrypt tokenizer zip
# Install PHP extensions (mcrypt removed - not available in PHP 7.4)
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath zip
# Enable Apache mod_rewrite
RUN a2enmod rewrite
# Install Composer (version 1.x for better compatibility with Laravel 5.0)
COPY --from=composer:1.10 /usr/bin/composer /usr/bin/composer
# Install Composer (version 2.x for Laravel 6.x)
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
@@ -51,20 +47,17 @@ RUN chown -R www-data:www-data /var/www/html \
# Create .env file if it doesn't exist
RUN if [ ! -f .env ]; then cp .env.example .env; fi
# Install PHP dependencies (Laravel 5.0 compatible)
RUN composer install --no-dev --no-interaction --prefer-dist
# Install PHP dependencies
# Note: composer install will be run via docker-entrypoint.sh or manually
# to avoid build-time network timeouts
# RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
# Generate application key
RUN php artisan key:generate || true
# Generate application key (will be done at runtime)
# RUN php artisan key:generate || true
# Run Laravel 5.0 optimization
RUN php artisan clear-compiled && php artisan optimize
# Note: yakpro-po obfuscation requires PHP 7.1+, incompatible with PHP 7.0
# For code protection with PHP 7.0, consider:
# 1. ionCube Encoder (commercial, most secure)
# 2. Keeping source code private and using proper access controls
# 3. Using --optimize flag in composer (already done above)
# Cache Laravel configuration and routes (will be done at runtime)
# RUN php artisan config:cache || true
# RUN php artisan route:cache || true
# Configure Apache DocumentRoot to point to Laravel's public directory
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public