relesbao / php-service-skeleton

A PHP skeleton for a service oriented architecture
MIT License
0 stars 0 forks source link

Composer Optimizer #6

Closed wandersonwhcr closed 7 years ago

wandersonwhcr commented 7 years ago

Hello,

I have a suggestion: you can create a Makefile to install dependencies in development and optimize in production.

Example:

COMPOSER_FLAGS = --prefer-dist

all: install

.PHONY: install
install:
    composer install ${COMPOSER_FLAGS}

.PHONY: optimize
optimize: COMPOSER_FLAGS = --no-dev --optimize-autoloader --classmap-authoritative
optimize: install
wandersonwhcr commented 7 years ago

You can create another recipe named tests:

.PHONY: tests
tests: install
    php vendor/bin/phpunit

... and use with Travis CI at #5 .

relesbao commented 7 years ago

Nice suggestion, i will look forward to implement this when i solve #5

Thanks!

relesbao commented 7 years ago

Added Makefile and made changes on composer.json to solve the issue.