https://github.com/d3p1/lib-php-template
A template to build PHP libraries
https://github.com/d3p1/lib-php-template
composer php project template templates
Last synced: 1 day ago
JSON representation
A template to build PHP libraries
- Host: GitHub
- URL: https://github.com/d3p1/lib-php-template
- Owner: d3p1
- License: mit
- Created: 2026-04-22T00:14:16.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-05T21:26:23.000Z (2 months ago)
- Last Synced: 2026-05-05T23:24:03.787Z (2 months ago)
- Topics: composer, php, project, template, templates
- Language: Shell
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# [LIBRARY PHP TEMPLATE]
[](https://github.com/prettier/prettier)
[](https://github.com/d3p1/lib-php-template/actions/workflows/release.yml)
[](https://github.com/semantic-release/semantic-release)
## Introduction
A template to build [PHP](https://www.php.net/) libraries.
The goal of this template is to simplify the process of creating, maintaining,
and publishing libraries. It provides a ready-to-use setup with sensible
defaults, including
an [automated release workflow triggered on every push to the repository](./.github/workflows/release.yml).
## Usage
Using this library is straightforward:
---
### 1. Create a repository
Click the
**[Use this template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)**
button to create a new repository based on this template.
---
### 2. Update `package.json`
Edit the [`package.json`](./package.json) file to reflect your library’s
metadata:
- `name` – Your library name
- `version` – Use `0.0.0`
- `description` – Short and meaningful description
- `repository` - Repository information
- `author` – Author information
- `bugs` – Bug reporting information
- `homepage` – Homepage
---
### 3. Update `composer.json`
Edit the [`composer.json`](./composer.json) file to reflect your library’s
metadata:
- `name` – Your library name
- `description` – Short and meaningful description
- `authors` – Author information
- `require` - Library dependencies
- `autoload` - Autoload configuration
---
### 4. Install dependencies
Execute the following commands:
```bash
composer install
```
---
### 5. Develop your library
Start developing your library inside the [`src` folder](./src).
Every commit must follow
this [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
format:
```
(): []
```
> [!NOTE]
> This is required by
> the [release workflow, which analyzes every commit to automatically generate the releases](./.github/workflows/release.yml).
---
### 6. Finalize documentation
Update the [`README.md`](./README.md) to describe your library’s purpose and
usage.
> [!IMPORTANT]
> Don’t forget to update the release badge URL at the top of this file if you
> keep it — it currently points to this repository.
---
> [!NOTE]
> To gain a deeper understanding of how to use this library and how it works
> under the hood, visit
> the [wiki page](https://github.com/d3p1/lib-php-template/wiki) _(in
progress)_.
> [!NOTE]
> There is a [ticket](https://github.com/d3p1/lib-php-template/issues/2) to add
> testing tools to improve the library's validation workflow.
## Changelog
Detailed changes for each release are documented in [
`CHANGELOG.md`](./CHANGELOG.md).
## License
This work is published under [MIT License](./LICENSE).
## Author
Always happy to receive a greeting on:
- [LinkedIn](https://www.linkedin.com/in/cristian-marcelo-de-picciotto/)
- [Web](https://d3p1.dev/)