Slide 1

Slide 1 text

Evolve faster. Darwin Analytics

Slide 2

Slide 2 text

For PHP and Laravel Package development

Slide 3

Slide 3 text

• Full Time PHP Developer • Using Laravel since 4.0 ~ beta 2 • Previously CodeIgniter & fuelPHP Hannes Van De Vreken

Slide 4

Slide 4 text

• Composer & Packagist • Testing & Travis CI • Git tag • Documentation • Support classes for frameworks Talking about

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

• composer self-update • composer install • composer update • composer search • composer require guzzle/guzzle 3.9.* • composer validate • composer list COMPOSER — USAGE ! Loading composer repositories… ! ! ./composer.json has been updated ./composer.json is valid

Slide 7

Slide 7 text

• PSR-0: class Zend_Mail_Message • PSR-4: Acme\Has\A\Lot\Of\Namespaces\Foo COMPOSER — AUTOLOAD

Slide 8

Slide 8 text

{ "autoload": { "classmap": [ "app/commands", "app/controllers", "app/filters", "app/database/migrations", "app/tests/unit/TestCase.php" ], "files": [ "app/helpers.php" ], "psr-0": { "Guzzle": "src/" }, "psr-4": { "GuzzleHttp\\": “src/" } } } COMPOSER — AUTOLOAD

Slide 9

Slide 9 text

Composer dump-autoload — optimize (-o) ! — “Optimizes PSR0 packages to be loaded with class maps too, good for production.” COMPOSER — AUTOLOAD

Slide 10

Slide 10 text

Composer in action. COMPOSER — AUTOLOAD

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Prove your code is doing what it is supposed to do. Testing

Slide 18

Slide 18 text

• Documentation • PR TESTING

Slide 19

Slide 19 text

• PHPUnit & Mockery • PHPSpec TESTING

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

• Every push, every PR TRAVIS-CI

Slide 22

Slide 22 text

• Code coverage • Code Sniffer (PHPCS) • Mess Detector (PHPMD) TRAVIS-CI

Slide 23

Slide 23 text

TRAVIS-CI - .TRAVIS.YML language: php! ! php:! - 5.3! - 5.4! - 5.5! - hhvm! ! before_script:! - composer self-update! - composer install --prefer-source --dev! ! script: phpunit

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

TAGGED COMMITS git tag -a “v0.0.1” -m “First release”

Slide 29

Slide 29 text

TRAVIS-CI SemVer {MAJOR}.{MINOR}.{PATCH}

Slide 30

Slide 30 text

TRAVIS-CI dev-{branch}

Slide 31

Slide 31 text

readme.md

Slide 32

Slide 32 text

README.MD Document your package.

Slide 33

Slide 33 text

• license.md • contributing.md • changelog.md README.MD

Slide 34

Slide 34 text

README.MD Badges

Slide 35

Slide 35 text

Support for frameworks

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Laravel Support

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

• php artisan config:publish • php artisan asset:publish • php artisan view:publish • php artisan migrate --package="vendor/package" LARAVEL SUPPORT

Slide 43

Slide 43 text

@hannesvdvreken Thank you. Questions?

Slide 44

Slide 44 text

• https://getcomposer.org • https://packagist.org • https://github.com/php-fig/fig-standards/tree/master/accepted • http://phpunit.de • http://www.phpspec.net • https://travis-ci.org/ • https://scrutinizer-ci.com/ • http://git-scm.com/docs/git-tag • http://semver.org/ • http://github.github.com/github-flavored-markdown/ • http://shields.io/ • http://laravel.com/docs/packages REFERENCE