This template is based on my past history with developing MediaWiki software, and largely based on MediaWiki's own repository template for PHP projects.
However, this project can be used for any PHP project, not just MediaWiki.
I hope this template can be useful for you!
This repository makes it easier to develop a PHP application or library by providing a basic project structure, continuous integration (CI) configuration, and other tools.
- PHP 8.2+ support
- Unit testing with PHPUnit (official website)
- Validates PHP syntax with php-parallel-lint
- Lint and auto-format PHP code with PHP CodeSniffer (PHPCS)
- Continuous integration with GitHub Actions
- auto-generated documentation with phpDocumentor, GitHub Pages
- Remote development with GitHub Codespaces
- Composer dependency updates auto-managed with Dependabot
You can create a new repository based on this template by clicking the "Use this template" button in the top-right corner of this page.
You can run the following command below with the GitHub CLI. Some notes:
- Replace placeholder with name of your extension in upper CamelCase
- Configure your repository's visibility with
--public
,--private
, or--internal
gh repo create {repo-name} --public --clone --template neoncitylights/php-template
Using your favorite text editor or IDE, find-and-replace the following placeholders:
{repo-name}
: Replace with the name of your repositoryauthor/package
: Replace with your own author and package name.neoncitylights/php-template
: Replace with the name of your GitHub repository.Neoncitylights\ExampleLibrary
: Replace with your own namespace.Neoncitylights\\ExampleLibrary\\
: Replace with your own namespace (escaped version using double backslashes).
Delete this README.md
, and rename LIBRARY.md
to README.md
.
Tool | File | Documentation |
---|---|---|
Composer package | composer.json |
docs, website, repo |
PHPCS (formatter + linter) | .phpcs.xml |
docs, repo |
PHPUnit (unit testing) | .phpunit.xml.dist |
docs, website, repo |
phpdoc (documentation generator) | phpdoc.dist.xml |
docs, website, repo |
Dependabot | .github/dependabot.yml |
docs, website |
- Quick start to reStructuredText (
.rst
), markup language used for phpDocumentor
This software is licensed under the MIT license (LICENSE-MIT
or http://opensource.org/licenses/MIT).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.