/phpackage

PHP package scaffolding.

Primary LanguagePHPMIT LicenseMIT

Package icon PHPackage - rapid package scaffolding.

License Latest Stable Version Total Downloads

How often do you find yourself doing the same things over and over when you want to create a new package?

This package allows you to run a simple console command to quiclkly scaffold a new folder structure for your PHP packages.


 

Installation

Start by installing this package on your global composer directory:

$ composer global require skoyah/phpackage

 

Usage

Now everytime you want to create a new package just run the following command on your terminal:

$ phpackage new awesome-package-name

This will create a folder sructure similar to this:

Folder Structure

 

In addition, if you want to use the well-known template Skeleton, from The PHP League, just run the same command with the --src skeletonflag. This will install the most recent version of that template.

$ phpackage new awesome-package-name --src="skeleton"

 

Adding PHPUnit

If you like to start writting your tests using PHPUnit, make sure to pass the optional flag --unit when creating a new package. This will add the phpunit/phpunit dev-dependency to your composer.json and also create the initial boilerplate to run your tests.

$ phpackage new awesome-package-name --unit

 

Easy, right?

You're almost done! Just remember to edit the fields on your composer.json and then run $ composer install inside your project folder.

Happy coding!