2017 © Pedro Peláez
 

library nucleus

PHP application scaffold

image

chillem/nucleus

PHP application scaffold

  • Wednesday, April 11, 2018
  • by CodyErekson
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 12 Versions
  • 50 % Grown

The README.md

Nucleus

PDS Skeleton Codeship Status for CodyErekson/Nucleus VERSION LICENSE, (*1)

A Slim based PHP application scaffolding., (*2)

This is more than a framework, thus the word "scaffolding." Nucleus is a fully functional out-of-the-box web application. All you need to do is build your environment, define values in config/.env, run the database migrations and seeds, then your app is ready to go!, (*3)

The major components and relevant documentation are below: - Slim (framework) https://www.slimframework.com/ - Twig (templates) https://twig.symfony.com/ - Phinx (database migrations) https://phinx.org/ - Eloquent (ORM) https://laravel.com/docs/5.5/eloquent - Monolog (logging) https://github.com/Seldaek/monolog - Respect Validation (validation) https://github.com/Respect/Validation - Whoops (error reporting) https://github.com/filp/whoops - League\Event (event emitter) http://event.thephpleague.com/2.0/ - League\CLImate (CLI output formatting) http://climate.thephpleague.com/ - Swiftmailer (email) https://swiftmailer.symfony.com/, (*4)

Requirements

  • PHP >= 7.1
  • Composer
  • NPM
  • MariaDB 10.1.30 or equivalent

Installation

php composer create-project chillem/nucleus [your-directory-name], (*5)

That command will create a new directory and clone Nucleus into it. Next you need to point a virtual host to the public/ directory and ensure that logs/ is writeable by your web server user., (*6)

Fetch the required NPM modules:, (*7)

npm install, (*8)

Copy config/env.dist to config/.env and edit that file with all of your required configuration values., (*9)

Next run the initial database migration to create the schema and populate some initial data:, (*10)

php vendor/bin/phinx migrate -e development, (*11)

If you want to insert the data that I initially use (some users and role associations) run the following:, (*12)

php vendor/bin/phinx seed:run -s GlobalSettings, (*13)

php vendor/bin/phinx seed:run -s Users, (*14)

php vendor/bin/phinx seed:run -s Roles, (*15)

php vendor/bin/phinx seed:run -s RoleUser, (*16)

Use the CLU utility to deploy the default template:, (*17)

bin/nucleate build, (*18)

Finally, update composer.json to reflect your application's details., (*19)

CLI Utility

v1.0.1-beta introduces a new semi-experimental feature -- a CLI command runner. The first functionality provider is that of a wrapper around those CLI scripts provided by other packages., (*20)

To run Phinx commands:, (*21)

bin/nucleate db migrate -e development, (*22)

To run PHPUnit:, (*23)

bin/nucleate test, (*24)

To run PHPCS:, (*25)

bin/nucleate cs -n --standard=PSR1,PSR2 src/, (*26)

bin/nucleate csfix -n --standard=PSR1,PSR2 src/, (*27)

Anything else is passed directly through to the command runner. Commands are defined in src/Helpers/Commands and extend the BaseCommand class., (*28)

More information about commands can be found here: https://github.com/adrianfalleiro/slim-cli-runner (Note: I have chosen to use the nomenclature "command" rather than "task" for the sake of consistency.), (*29)

Contact

Email: cody.erekson@gmail.com, (*30)

The Versions