Skip to content

Commit

Permalink
Enabled CLI opcode caching and improved opcode invalidation in valida…
Browse files Browse the repository at this point in the history
…tion.

The PHP.ini configuration has been updated to enable opcode caching for CLI (Command Line Interface). This will contribute to better performance when executing PHP scripts from the command line. Additionally, the opcode invalidation logic in the abstract validation class has been modified. Instead of invalidating the cache for schema file paths directly, it now correctly invalidates the cache for their string representation.
  • Loading branch information
SmetDenis committed Apr 9, 2024
1 parent 837ae9f commit 1aa1921
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,32 @@ RUN composer install --no-dev \
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY ./docker/php.ini /usr/local/etc/php/conf.d/docker-z99-php.ini

# Warmup caches
RUN php ./docker/build-preloader.php \
&& php /docker/preload.php


# Quick test
RUN time ./csv-blueprint --version --ansi \
&& time ./csv-blueprint validate:csv --help --ansi

# Warm up caches
RUN time php /app/docker/build-preloader.php \
&& time php /app/docker/preload.php \
&& echo "opcache.preload=/app/docker/preload.php" >> /usr/local/etc/php/conf.d/docker-z99-php.ini
# && time /app/csv-blueprint validate:csv -h \
# && time /app/csv-blueprint validate:schema \
# --schema=/app/schema-examples/*.yml \
# --schema=/app/schema-examples/*.php \
# --schema=/app/schema-examples/*.json -vvv \
# && echo "Warm up is ready!" \
#RUN time php ./docker/random-csv.php \
# && echo "opcache.preload=./docker/preload.php" >> /usr/local/etc/php/conf.d/docker-z99-php.ini
# && time ./csv-blueprint validate:csv -h \
# && time ./csv-blueprint validate:schema \
# --schema=./schema-examples/*.yml \
# --schema=./schema-examples/*.php \
# --schema=./schema-examples/*.json -vvv \
# && echo "Warm up is ready!" \

#RUN time php /app/docker/random-csv.php \
# && time /app/csv-blueprint validate:csv \
# --schema=/app/schema-examples/full.yml \
# --csv=/app/docker/random_data.csv \
# --apply-all=yes \
# --report=text --mute-errors > /dev/null \
# && echo "Tests are ready!" \
# && rm /app/docker/random_data.csv \
# && du -sh /app/docker
#RUN time php ./docker/random-csv.php \
# && time ./csv-blueprint validate:csv \
# --schema=./schema-examples/full.yml \
# --csv=./docker/random_data.csv \
# --apply-all=yes \
# --report=text --mute-errors > /dev/null \
# && echo "Tests are ready!" \
# && rm ./docker/random_data.csv \
# && du -sh ./docker

ENTRYPOINT ["/app/csv-blueprint"]

0 comments on commit 1aa1921

Please sign in to comment.