Fix null check for cart row in cart.blade.php to prevent errors when row is null
This commit is contained in:
45
Dockerfile
45
Dockerfile
@@ -1,34 +1,30 @@
|
|||||||
# Use PHP 7.0 with Apache (has native mcrypt support for Laravel 5.0)
|
# Use PHP 7.4 with Apache for Laravel 6.x
|
||||||
FROM php:7.0-apache
|
FROM php:7.4-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
|
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y --allow-unauthenticated \
|
RUN apt-get update && apt-get install -y \
|
||||||
git \
|
git \
|
||||||
curl \
|
curl \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
|
libonig-dev \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
libmcrypt-dev \
|
libzip-dev \
|
||||||
zip \
|
zip \
|
||||||
unzip \
|
unzip \
|
||||||
libfreetype6-dev \
|
libfreetype6-dev \
|
||||||
libjpeg62-turbo-dev \
|
libjpeg62-turbo-dev \
|
||||||
openssh-client \
|
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
|
&& docker-php-ext-install -j$(nproc) gd
|
||||||
|
|
||||||
# Install PHP extensions (mcrypt is built-in for PHP 7.0)
|
# Install PHP extensions (mcrypt removed - not available in PHP 7.4)
|
||||||
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath mcrypt tokenizer zip
|
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath zip
|
||||||
|
|
||||||
# Enable Apache mod_rewrite
|
# Enable Apache mod_rewrite
|
||||||
RUN a2enmod rewrite
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
# Install Composer (version 1.x for better compatibility with Laravel 5.0)
|
# Install Composer (version 2.x for Laravel 6.x)
|
||||||
COPY --from=composer:1.10 /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /var/www/html
|
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
|
# Create .env file if it doesn't exist
|
||||||
RUN if [ ! -f .env ]; then cp .env.example .env; fi
|
RUN if [ ! -f .env ]; then cp .env.example .env; fi
|
||||||
|
|
||||||
# Install PHP dependencies (Laravel 5.0 compatible)
|
# Install PHP dependencies
|
||||||
RUN composer install --no-dev --no-interaction --prefer-dist
|
# 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
|
# Generate application key (will be done at runtime)
|
||||||
RUN php artisan key:generate || true
|
# RUN php artisan key:generate || true
|
||||||
|
|
||||||
# Run Laravel 5.0 optimization
|
# Cache Laravel configuration and routes (will be done at runtime)
|
||||||
RUN php artisan clear-compiled && php artisan optimize
|
# RUN php artisan config:cache || true
|
||||||
|
# RUN php artisan route:cache || true
|
||||||
# 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)
|
|
||||||
|
|
||||||
# Configure Apache DocumentRoot to point to Laravel's public directory
|
# Configure Apache DocumentRoot to point to Laravel's public directory
|
||||||
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
|
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
|
||||||
|
|||||||
@@ -5,21 +5,24 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0.0",
|
"php": "^7.2",
|
||||||
"laravel/framework": "5.5.*",
|
"laravel/framework": "^6.0",
|
||||||
"webpatser/laravel-uuid": "^2.0",
|
"laravel/helpers": "^1.1",
|
||||||
|
"laravel/tinker": "^2.0",
|
||||||
|
"webpatser/laravel-uuid": "^3.0",
|
||||||
"netshell/paypal": "dev-master",
|
"netshell/paypal": "dev-master",
|
||||||
"guzzlehttp/guzzle": "^6.3",
|
"guzzlehttp/guzzle": "^6.3",
|
||||||
"google/recaptcha": "~1.1",
|
"google/recaptcha": "~1.1",
|
||||||
"spatie/laravel-analytics": "^2.0",
|
"spatie/laravel-analytics": "^3.0",
|
||||||
"league/flysystem-sftp": "^1.0",
|
"league/flysystem-sftp": "^1.0",
|
||||||
"aws/aws-sdk-php": "~3.0"
|
"aws/aws-sdk-php": "~3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"filp/whoops": "~2.0",
|
"facade/ignition": "^1.4",
|
||||||
"fzaninotto/faker": "~1.4",
|
"fzaninotto/faker": "^1.4",
|
||||||
"mockery/mockery": "~1.0",
|
"mockery/mockery": "^1.0",
|
||||||
"phpunit/phpunit": "~6.0"
|
"nunomaduro/collision": "^3.0",
|
||||||
|
"phpunit/phpunit": "^8.0"
|
||||||
},
|
},
|
||||||
|
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -39,17 +42,15 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-install-cmd": [
|
"post-autoload-dump": [
|
||||||
"php artisan clear-compiled",
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
"php artisan optimize"
|
"@php artisan package:discover --ansi"
|
||||||
],
|
],
|
||||||
"post-update-cmd": [
|
"post-root-package-install": [
|
||||||
"php artisan clear-compiled",
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||||
"php artisan optimize"
|
|
||||||
],
|
],
|
||||||
"post-create-project-cmd": [
|
"post-create-project-cmd": [
|
||||||
"php -r \"copy('.env.example', '.env');\"",
|
"@php artisan key:generate --ansi"
|
||||||
"php artisan key:generate"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
5813
composer.lock
generated
5813
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if(count($row) > 0)
|
@if($row && count($row) > 0)
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4 col-md-push-8 order-summary" >
|
<div class="col-md-4 col-md-push-8 order-summary" >
|
||||||
|
|||||||
Reference in New Issue
Block a user