Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-version: ['7.4', '8.0']
php-version: ['8.1', '8.2']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/vendor
/vendor-bin
/*.phar
.idea
.phpunit.result.cache
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.0.0] - 2026-02-24
### Added
Docker image and makefile commands to build .phar file
### Changed
mysqldump to mariadb-dump to work with newer versions of MySQL and MariaDB.
Minimum requirement of php to be 8.1.
make build command to handle build and verify with docker installed and without;

## [5.2.0] - 2024-05-08
### Added
Added flags required for newer versions of MySQL defaults to ensure mysqldump works without required elevated permissions (no backwards-compatibility issues as the flags exists for previous versions too)
Expand Down
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM php:8.1-cli

# Install dependencies: make, git, unzip, zip, curl
RUN apt-get update \
&& apt-get install -y \
make \
git \
unzip \
zip \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install Composer globally
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

WORKDIR /app
56 changes: 44 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,59 @@
.PHONY: build clean test lint

build: magedbm2.phar
COMPOSER_EXECUTABLE := $(shell command -v composer 2>/dev/null || echo ./composer.phar)
IMAGE_NAME := magedbm-build-php81
DOCKER_EXECUTABLE := docker run -it --rm -v $(shell pwd):/app $(IMAGE_NAME) bash
# =========================
# PHAR build target commands
# =========================
build:
@if command -v docker >/dev/null 2>&1; then \
echo "Docker found. Running build inside Docker..."; \
$(MAKE) docker-build-phar; \
else \
echo "Docker not found. Running build locally..."; \
$(MAKE) build-phar; \
fi; \
echo "⚠️ ⚠️ Update manifest.json with provided signature for new version"

docker-build-phar: docker-build
@$(DOCKER_EXECUTABLE) -c "\
make build-phar; \
"

build-phar: $(shell find src -type f) composer.json composer.phar
$(COMPOSER_EXECUTABLE) install --no-dev
php -d phar.readonly=0 vendor/bin/box compile
make verify

clean:
rm -rf vendor box.phar composer.phar magedbm2.phar
rm -rf vendor composer.phar magedbm2.phar

test: install
php -derror_reporting=E_ERROR ./vendor/bin/phpunit

install: composer.phar composer.lock
./composer.phar install
$(COMPOSER_EXECUTABLE) install

lint: install
./vendor/bin/phpcs --standard=./phpcs.xml src/ || exit 0
./vendor/bin/phpmd src/ text ./phpmd.xml || exit 0
./vendor/bin/phpcbf --standard=./phpcs.xml src/ || exit 0

magedbm2.phar: * box.phar composer.phar
./composer.phar install --no-dev
php -d phar.readonly=0 ./box.phar build

composer.phar:
curl -LSs https://getcomposer.org/installer | php

box.phar:
curl -LSs https://box-project.github.io/box2/installer.php | php
@if ! command -v composer >/dev/null 2>&1; then \
echo "Downloading local composer.phar..."; \
curl -LSs https://getcomposer.org/installer | php; \
chmod +x composer.phar; \
fi

verify:
vendor/bin/box verify magedbm2.phar

## Docker commands
docker-build:
@if ! docker image inspect magedbm-build-php81 > /dev/null 2>&1; then \
docker build -t magedbm-build-php81 . ; \
fi
docker-ssh: docker-build
$(DOCKER_EXECUTABLE)
ssh: docker-ssh
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ It was written with developers in mind and provides commands for:

## Requirements

* `>v6.0.0` PHP >=8.1
* `<v4.0.0` PHP >7.0 <8.0(with permission to run `exec` and `passthru`)
* `>v4.0.0` PHP 7.4+
* `mysql` client on the `$PATH`
Expand Down
7 changes: 2 additions & 5 deletions box.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
]
}
],
"main": "bin/magedbm2",
"compactors": [
"Herrera\\Box\\Compactor\\Php"
"KevinGH\\Box\\Compactor\\Json"
],
"compression": "GZ",
"chmod": "0755",
"stub": true
"compression": "GZ"
}
26 changes: 16 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,25 @@
"bin/magedbm2"
],
"require": {
"php": ">=7.4",
"symfony/console": "^3.4",
"symfony/yaml": "^3.4",
"php": "^8.1",
"symfony/console": "^5.4 || ^6.0",
"symfony/yaml": "^5.4 || ^6.0",
"aws/aws-sdk-php": "^3.52",
"meanbee/libmageconf": "^1.0",
"symfony/process": "^3.4",
"psr/log": "^1.0",
"php-di/php-di": "^6.0",
"adbario/php-dot-notation": "^2.0",
"fakerphp/faker": "^1.9",
"symfony/deprecation-contracts": "2.5"
"symfony/process": "^5.4 || ^6.0",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"php-di/php-di": "^6.4 || ^7.0",
"adbario/php-dot-notation": "^3.3",
"fakerphp/faker": "^1.21",
"symfony/deprecation-contracts": "^2.5 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.0.0",
"phpmd/phpmd": "^2.11",
"php-vfs/php-vfs": "^1.4",
"phpcompatibility/php-compatibility": "^9.3"
"phpcompatibility/php-compatibility": "^9.3",
"bamarni/composer-bin-plugin": "^1.9"
},
"autoload": {
"psr-4": {
Expand All @@ -53,5 +54,10 @@
"psr-4": {
"Meanbee\\Magedbm2\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
}
}
Loading