nextpack/nextpack

Nextpack is a PHP Packages Framework (Starter Project)

v1.0.0 2016-07-22 01:40 UTC

This package is not auto-updated.

Last update: 2024-10-09 16:43:25 UTC


README

Latest Stable Version License Mahmoud Zalt

NextPack is a PHP & Laravel Packages Starter, (Designed to help building high quality PHP Packages faster).

Clone NextPack and build your next open source package on top of it.

NextPack strives to facilitates and boosts the development process of PHP Packages. And it highly recommend producing framework agnostic packages.

Produce more open source composer packages with the least amount of time.

Highlights

Nextpack includes:

  • Rich package skeleton, (containing common files required by almost every PHP package)
  • Ready Unit Test
  • Ready config files reader
  • Ready Servie Provider (for Laravel)
  • Ready Facade Class (for Laravel)
  • Version Control: Git (.gitattributes, .gitignore)
  • Continuous Integration: Travis and Scrutinizer (.scrutinizer.yml, .travis.yml)
  • Testing: PHPUnit (phpunit.xml)
  • Package Manager: Composer (composer.json)

Installation

Software Requirement
  • Git
  • Composer
Installation Steps
  1. git clone https://github.com/nextpack/nextpack.git
  2. composer update
  3. make sure everything is OK by running the tests phpunit

Customization

After you install a fresh copy of Nextpack, the only thing you need to do is customizing it to meet your needs, before start codig your package.

The steps include renaming the code samples shipped with the Nextpack:

  1. Change the namespace of the application from Nextpack\Nextpack to your Vendor-name\Package-name. (you can do this using the [Replace All] feature of your IDE).
  2. Update the following values in composer.json: name, description, keywords, authors, autoload and don't forget to update the namespaces. (you might need to run composer dump-autoload after the changes).
  3. Run composer install
  4. Rename SampleFacadeAccessor.php and update the returned string inside the getFacadeAccessor() function.
  5. Rename NextpackServiceProvider and update the content of the following functions: facadeBindings(), configPublisher() and implementationBindings().
  6. Update the config file nextpack.php, (or remove it if not necessary).
  7. Delete this README.md file. And rename the README.md.READY to README.md.
  8. Update LICENSE by replacing ::Vendor-Name and ::Package-Name with your vendor and package names.
  9. Edit the new README.md
  10. Delete the sample tests function. Keep the TestCase.php.
  11. Update the "testsuite" name in the phpunit.xml.

Test

To run the tests, run the following command from the project folder.

$ ./vendor/bin/phpunit

Credits

License

The MIT License (MIT). See the License File for more information.