PHPackages                             jtrw/php-make - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. jtrw/php-make

ActiveLibrary[CLI &amp; Console](/categories/cli)

jtrw/php-make
=============

Simple collections of make commands to increase productivity. This package gives you make commands to run your project easily. You can also customize the make commands to fit your project needs. Make commands o help work with docker, git, composer, migrations symfony, migrations laravel, tests, static analysis, and more.

1.3.1(1y ago)73.1k↓22.2%MITMakefilePHP &gt;=7.1

Since Oct 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jtrw/php-make)[ Packagist](https://packagist.org/packages/jtrw/php-make)[ RSS](/packages/jtrw-php-make/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (21)Used By (0)

PHP Make
========

[](#php-make)

Useful PHP Makefile for PHP projects. Why Makefile? Because it's simple and easy to use and it's a standard tool for Unix systems. Simple collections of make commands to increase productivity. In this project I collect useful commands for PHP projects. Most of the commands are related to Docker projects.

Install
-------

[](#install)

1. `composer require jtrw/php-make`
2. Run `/vendor/bin/php-make` command for copy template Makefile to your project if Makefile exists it will be not overwritten.
3. If you use your own Makefile, you can add the following line to your Makefile:

```
include vendor/jtrw/php-make/.make/utils.mk
include vendor/jtrw/php-make/.make/colours.mk
include vendor/jtrw/php-make/.make/docker-compose-shared-services.mk
include vendor/jtrw/php-make/.make/composer.mk
include vendor/jtrw/php-make/.make/static-analysis.mk
include vendor/jtrw/php-make/.make/migrations-symfony.mk
```

4. Add to your .env file variable `PHP_FPM_NAME` and `APP_ENV` for example:

```
PHP_FPM_NAME=php-fpm
APP_ENV=dev
```

5. Use `make help` to see all available commands.

Usage
-----

[](#usage)

image: [![make help](/docs/make-help.jpg)](/docs/make-help.jpg)

Description
-----------

[](#description)

File `composer.mk` contains commands for composer.

File `docker.mk` contains commands for docker.

File `migrations-symfony.mk` contains commands for Symfony migrations.

File `migrations-laravel.mk` contains commands for Laravel migrations.

File `static-analysis.mk` contains commands for static analysis.

File `utils.mk` contains useful commands.

File `docker-compose-shared-services.mk` contains commands for docker-compose. Shared services `docker-compose-shared-services.yml` it is a file with shared services for docker-compose. For example it's services that use in local development environment. Example of `docker-compose-shared-services.yml`:

```
version: "3.7"

services:
  mysql:
    container_name: ${APP_COMPOSE_PROJECT_NAME}_mysql
    image: mysql:8.0
    networks:
      - backend
    cap_add:
      - SYS_NICE
    restart: always
    volumes:
      - mysql:/var/lib/mysql
    ports:
      - 3306:3306
    env_file:
      - .env
    command: --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
  rabbitmq3:
    container_name: ${APP_COMPOSE_PROJECT_NAME}_rabbitmq
    image: rabbitmq:3.11.4-management-alpine
    networks:
      - backend
    environment:
      RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
      RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS}
    ports:
      - '5674:5672'
      - '15674:15672'
  redis:
    container_name: ${APP_COMPOSE_PROJECT_NAME}_redis
    image: redis:latest
    networks:
      - backend
    volumes:
      - ./.docker/redis/redis-cache/redis.conf:/usr/local/etc/redis/redis.conf
      - redis:/data
    command: /usr/local/etc/redis/redis.conf
    ports:
      - 6381:6379
    healthcheck:
      test: [ "CMD", "bash", "-c", "exec 3 /dev/tcp/127.0.0.1/6379 && echo PING >&3 && head -1
