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
3 changes: 1 addition & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ jobs:
matrix:
# operating-systems: ubuntu-latest, windows-latest, macos-latest
operating-system: [ubuntu-latest]
# php-versions: 8.0, 8.1, 8.2
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.0', '8.1', '8.2', '8.3']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
Expand Down
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [2.1.0] - 2025-04-13

### Added
- Support for PHP 8.3
- Support for Docker and Docker Compose

### Fixed
- Failed WebsiteCest

## [2.0.0] - 2023-01-02

See https://github.com/getherbie/herbie/issues/82.

## [1.1.0] - 2018-10-27
- Remove Composer minimum-stability
- Bump php version requirement to 5.6
Expand Down Expand Up @@ -31,6 +44,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

[Unreleased]: https://github.com/getherbie/herbie/compare/v1.0.1...HEAD
[Unreleased]: https://github.com/getherbie/herbie/compare/v2.1.0...HEAD
[2.1.0]: https://github.com/getherbie/herbie/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/getherbie/herbie/compare/v1.1.0...v2.0.0
[1.1.0]: https://github.com/getherbie/herbie/compare/v1.0.1...v1.1.0
[1.0.1]: https://github.com/getherbie/herbie/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/getherbie/herbie/compare/v0.5.0...v1.0.0
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG PHP_VERSION=8.3

FROM composer:lts AS composer

FROM php:$PHP_VERSION-cli

WORKDIR /app
VOLUME /app

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
libicu-dev \
libfreetype-dev \
libjpeg62-turbo-dev \
libpng-dev \
unzip \
&& rm -rf /var/lib/apt/lists/*

RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd intl

RUN pecl channel-update pecl.php.net \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

COPY --from=composer /usr/bin/composer /usr/bin/composer

EXPOSE 80
110 changes: 91 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,51 @@ Herbie is well tested:

- Unit, Integration and Acceptance Tests with [Codeception](https://codeception.com)
- Static Code Analysis with [PHPStan](https://phpstan.org)
- Code Fixing with [PHP Coding Standards Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
- Code Fixing with [PHP Coding Standards Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)

## Use Cases
## Supported PHP Versions

TBD
8.0 / 8.1 / 8.2 / 8.3

## Installation

### Composer
### With PHP and Composer on your machine

The easiest way to install Herbie is through Composer.
Run the following commands in your terminal to create a new project and install all dependent libraries.

composer create-project getherbie/start-website mywebsite

Change to the `mywebsite/web` directory:
Change to the `mywebsite/web` directory.

cd mywebsite/web

Start the internal webserver:
Start the built-in webserver.

php -S localhost:8888 index.php

Now open <http://localhost:8888> with your browser.
Open <http://localhost:8888> with your browser.
You should see your first Herbie website.

### With Docker and Docker Compose on your machine

Create website and install dependencies.

docker run --rm -v $PWD:/app composer create-project --ignore-platform-reqs getherbie/start-website mywebsite

Change to the `mywebsite` directory and start website.

cd mywebsite
docker compose up website

Open <http://localhost:8888> with your browser.

## Development Environment

If you need a development environment, you can follow these steps.

### With PHP and Composer on your machine

Clone the GitHub repository.

git clone https://github.com/getherbie/herbie.git
Expand All @@ -90,40 +105,97 @@ Change to the `website/web` directory.

Start PHP's internal web server.

php -S localhost:9999 index.php
php -S localhost:8888 index.php

Now, open `localhost:9999` with your favorite web browser.
Open `localhost:8888` with your favorite web browser.

If you want to have additional console output or logging information, set the debug environment variable.

HERBIE_DEBUG=1 php -S localhost:9999 index.php
HERBIE_DEBUG=1 php -S localhost:8888 index.php

If you want to use Xdebug (3.x), start the internal web server as follows.
Hint: For this to work, Xdebug must of course be installed.

XDEBUG_MODE=debug php -S localhost:9999 index.php
XDEBUG_MODE=debug php -S localhost:8888 index.php

### With Docker and Docker Compose on your machine

Clone the GitHub repository.

git clone https://github.com/getherbie/herbie.git

Change to the `herbie` directory.

cd herbie

Start PHP's built-in web server and launch website.

docker compose up website

Open `localhost:8888` with your favorite web browser.

Other Docker Compose commands are

# install Composer dependencies
docker compose run install

# run test suite
docker compose run test

# start test suite website
docker compose up test-website

# run bash terminal
docker compose run bash

You can use different PHP versions.

PHP_VERSION=8.0 docker compose up website
PHP_VERSION=8.1 docker compose up website
PHP_VERSION=8.2 docker compose up website
PHP_VERSION=8.3 docker compose up website

## Tests

Run unit tests
### With PHP on your machine

php vendor/bin/codecept run unit
# run tests
php vendor/bin/codecept run

Run integration tests
# run unit tests
php vendor/bin/codecept run unit

# run integration tests
php vendor/bin/codecept run integration

Run acceptance tests

# run acceptance tests
php vendor/bin/codecept run acceptance

Run all tests
# run tests with Code Coverage
XDEBUG_MODE=coverage php vendor/bin/codecept run --coverage --coverage-xml --coverage-html

### With Docker Compose on your machine

Open the container shell

docker compose run bash

Run tests within the container

# run tests
php vendor/bin/codecept run

Run tests with Code Coverage
# run unit tests
php vendor/bin/codecept run unit

# run integration tests
php vendor/bin/codecept run integration

# run acceptance tests
php vendor/bin/codecept run acceptance

XDEBUG_MODE=coverage vendor/bin/codecept run --coverage --coverage-xml --coverage-html
# run tests with Code Coverage
XDEBUG_MODE=coverage php vendor/bin/codecept run --coverage --coverage-xml --coverage-html

## More Information

Expand Down
60 changes: 60 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
services:
website:
build:
context: .
args:
- PHP_VERSION=${PHP_VERSION:-8.3}
profiles: [website]
environment:
- XDEBUG_MODE=debug
- XDEBUG_CONFIG="client_host=host.docker.internal"
working_dir: "/app/website"
command: ["php", "-S", "0.0.0.0:80", "-t", "/app/website/web"]
volumes:
- .:/app
ports:
- "8888:80"
depends_on:
- install
install:
build:
context: .
args:
- PHP_VERSION=${PHP_VERSION:-8.3}
profiles: [website]
working_dir: "/app"
command: ["composer", "install"]
volumes:
- .:/app
test:
build:
context: .
args:
- PHP_VERSION=${PHP_VERSION:-8.3}
profiles: [website]
working_dir: "/app"
command: ["php", "vendor/bin/codecept", "run"]
volumes:
- .:/app
test-website:
build:
context: .
args:
- PHP_VERSION=${PHP_VERSION:-8.3}
profiles: [website]
working_dir: "/app/tests/_data"
command: ["php", "-S", "0.0.0.0:80", "-t", "/app/tests/_data/web"]
volumes:
- .:/app
ports:
- "8888:80"
bash:
build:
context: .
args:
- PHP_VERSION=${PHP_VERSION:-8.3}
profiles: [website]
working_dir: "/app"
command: ["bash"]
volumes:
- .:/app
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"getherbie/plugin-simplecontact": "dev-master",
"getherbie/plugin-simplesearch": "dev-master",
"guzzlehttp/psr7": "^2.4",
"laminas/laminas-diactoros": "^2.24",
"laminas/laminas-diactoros": "^2.26 || ^3.5",
"netcarver/textile": "^4.0",
"nyholm/psr7": "^1.5",
"nyholm/psr7-server": "^1.0",
Expand Down
Loading
Loading