PHPackages                             earthit/php-template-project - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. earthit/php-template-project

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

earthit/php-template-project
============================

PHP Template Project

0.9.1(9y ago)0361[2 issues](https://github.com/EarthlingInteractive/PHPTemplateProject/issues)MITPHPPHP ^5.2

Since Nov 14Pushed 7y ago17 watchersCompare

[ Source](https://github.com/EarthlingInteractive/PHPTemplateProject)[ Packagist](https://packagist.org/packages/earthit/php-template-project)[ RSS](/packages/earthit-php-template-project/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (15)Versions (36)Used By (0)

PHP Template Project Technical Documentation
============================================

[](#php-template-project-technical-documentation)

This README was automatically generated by PHPProjectInitializer. If this paragraph is still present it probably means nobody's bothered to write any project-specific documentation, yet.

See also:

- [PHP Application Architecture](PHP-APP-ARCHITECTURE.md)
- [Tutorials](tut/)
    - [Make a simple page](tut/pages.md)
- [Upgrading from the template project](UPGRADING.md)

Folder structure
----------------

[](#folder-structure)

- `composer.json` - PHP package and dependency information, used by Composer.
- `package.json` - Node package and dependency information, used by NPM.
- `init-*.php` - Scripts to initialize global state in PHP.
- `src/db-migrations/` - Database scripts
    - `upgrades/` - Upgrades to be run in order to build the schema
    - `test-data/` - Run interleaved with upgrades for additional unit test data
    - miscellaneous handy scripts
- `src/` - Source code for this project.
    - `main/` - Primary application code, broken down by language
    - `test/` - Unit tests
    - `views/` - View templates
- `build/` and/or `target/` - Compiled stuff. Not checked in.
- `node_modules/` - External node libraries, managed my NPM.
- `vendor/` - External PHP libraries, managed by Composer.
- `config/` - Deployment configuration.
- `www/` - Serves as the 'document root' for your project. Contains files to be served directly and a `.htaccess` and `bootstrap.php`to handle paths that don't correspond to existing files.
- `Vagrantfile` - configuration file for Vagrant.
- `vm-files/` - files to be imported into the vagrant Virtual machine.
- `provision.sh` - Virtual machine provisioning script.

Note that the `src//` directory is a Maven convention. It's verbose, but gives enough information to keep projects with multiple languages and components (unit tests, build system, runtime, etc) organized.

`build/` and `target/` are basically the same thing. Within one project you should probably pick one or the other and stick with it. `target` is a Maven convention. C and JavaScript people like to call it `build`.

Database
--------

[](#database)

### Create the database

[](#create-the-database)

If you're using Vagrant, don't do this. Just `vagrant up` and you should be good to go. The following only applies if you want to run outside of Vagrant.

`make create-database` will attempt to create the database for you based on configuration in `config/dbc.json`.

If that fails (due to e.g. your system is not set up in a way for which that script is designed) you can create the database yourself:

Set up a new postgres database by logging in as root (`sudo -u postgres psql` often does the trick) and running:

```
CREATE DATABASE phptemplateprojectdatabase;
CREATE USER phptemplateprojectdatabaseuser WITH PASSWORD 'phptemplateprojectdatabasepassword';
GRANT ALL PRIVILEGES ON DATABASE phptemplateprojectdatabase TO phptemplateprojectdatabaseuser;
```

If you've changed the name of the database or user in `config/dbc.json`, make the corresponding changes to the above SQL.

### Initialize the database

[](#initialize-the-database)

Once a database exists and permissions are set up for our user, you should be able to run `make rebuild-database`, which will empty the database and rebuild it from the upgrade scripts.

### Rebuilding The Database

[](#rebuilding-the-database)

Run `make rebuild-database` to empty the database and rebuild it from the upgrade scripts in `src/db-migrations/upgrades/`.

Run `make rebuild-database-with-test-data` to rebuild-database the database and also adddata from `src/db-migrations/test-data/`.

### Upgrading The Database

[](#upgrading-the-database)

Run `make upgrade-database` to run newly made upgrade scripts in `src/db-migrations/upgrades/`.

Unit Testing
------------

[](#unit-testing)

All tests are in `src/test/`

The structure of `src/test/` should mimic that of `src/main/`, where a single test file tests a single application file.

To run PHPUnit tests, run `make run-tests`. This will run both unit and integration tests. Run `make run-unit-tests` to just run unit tests and `make run-integration-tests` to just run integration tests.

Integration tests are ones that use the database.

### PHP Styles

[](#php-styles)

Follow the conventions used by existing Phrebar code. Namely, [tabs for leading indentation](http://www.nuke24.net/docs/2012/Tabs.html), opening brackets on the same line for functions and control structures.

(It may be that 'tabs for leading indentation' and 'Smart Tabs' refer to the exact same practice.)

Deploying
---------

[](#deploying)

Deployment to the various environments is handled automatically by [CircleCI](https://circleci.com/). [Read these docs](https://github.com/EarthlingInteractive/EarthlingDocs/blob/master/CircleCI.md) about how Earthling has set up CircleCI.

Web serving
-----------

[](#web-serving)

If you're using Vagrant, you can just HTTP to whatever IP address you told Vagrant to use. e.g.

If you accepted the default.

If you are running Apache (and Postgres, and other required programs) on your development machine, and this directory is checked out somewhere under the DocumentRoot or an Alias, you may be able to just browse to the www directory and have things work. For me, that's

Most people probably need to run Vagrant though.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 99.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~7 days

Total

32

Last Release

3602d ago

PHP version history (3 changes)0.1.0PHP &gt;=5.2.0

0.3.1PHP ~5.2

0.3.3PHP ^5.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/84f2846fb867825e6831a99f7ba5ca9301de56a424928e2c494f81c2c6061677?d=identicon)[TOGoS](/maintainers/TOGoS)

---

Top Contributors

[![TOGoS](https://avatars.githubusercontent.com/u/57142?v=4)](https://github.com/TOGoS "TOGoS (320 commits)")[![sbrudz](https://avatars.githubusercontent.com/u/1520763?v=4)](https://github.com/sbrudz "sbrudz (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/earthit-php-template-project/health.svg)

```
[![Health](https://phpackages.com/badges/earthit-php-template-project/health.svg)](https://phpackages.com/packages/earthit-php-template-project)
```

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[eliashaeussler/typo3-form-consent

Extension for TYPO3 CMS that adds double opt-in functionality to EXT:form

1481.0k](/packages/eliashaeussler-typo3-form-consent)[ronasit/laravel-helpers

Provided helpers function and some helper class.

1475.7k13](/packages/ronasit-laravel-helpers)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
