6. Things I Make Myself
Part of
• Sentry (with Bruno Gaspar & Daniel Petrie of
Cartalyst).
• Laravel 4 (currently the biggest code
contributor behind Taylor).
7. Things I Make Myself
Part of
• Cartalyst’s Platform 1 / 2
• Approximately 1 billion Cartalyst packages
• OAuth 1 Client (League of Extraordinary
Packages).
8. Things I Make Myself
Part of
• PyroCMS
• FuelPHP (including various packages)
• There’s probably more…
18. What Went Wrong?
• I switched frameworks:
• CodeIgniter ~1.4
• Kohana ~3.0
• FuelPHP - days of “Carbon” and the
awkwardly named “ThrustPHP”
• Laravel ~3.1
• Laravel 4
19. What Went Wrong?
• Your new framework still didn’t do all the
things.
• You had a bunch of incompatible, near useless
add-ons.
32. OAuth 2
• Code diverged
• Bug fixes not global
• Bug fixed on Kohana didn’t fix CodeIgniter,
FuelPHP or Laravel.
• API changes meant re-learning add-ons
33. Scenario
• You now work with Laravel
• Client asks for you to integrate with
Facebook on their legacy CodeIgniter site.
• You had to research CodeIgniter add-ons
• The job took 3x as long as it should
34. Scenario
• You now work with Laravel
• Client asks for you to integrate with Tumblr
on their legacy CodeIgniter site.
• You can’t find any suitable add-ons
• You resort to using PHP’s horrible cURL API
• Even worse, file_get_contents().
• The job took 5x as long as it should
42. Packagist Says
• There’s around 540 packages tagged “laravel”
• A good portion of them have
laravel/framework listed as a dependency.
• Many others are dependent on Laravel, even
though it’s not specified.
100. Don’t Do That, Do This
• Never reference Facades in your package
• They’re specific to the standard Laravel 4
app.
• Inject config values through a service
provider.
108. Don’t Do That, Do This
• Don’t use dependencies for the sake of
using dependencies.
• Delegate request-specific code to app
• Delegate all app-specific code to app
122. Bridging Packages Are
Drivers
• Same code, different package
• It’s impossible to include drivers for all
frameworks.
• Keeps package core light. Only download
what you need.
127. It’s Easier to Be Lazy
• Not in the long run, it’s not
• Not for everybody using another
framework, it’s not.
• Not when the framework changes, it’s not
131. tl;dr
• Forget all frameworks when making a
package:
• De-couple packages
• Simplify code
• Speeds up a developer’s 3 steps of
discovery.
132. tl;dr
• Code to allow for easy integration:
• Integrate through drivers
• Integrate through bridging packages
• Strengthen community:
• People working to make a package
stronger helps everybody
133. tl;dr
• There’s a bunch of valid reasons for starting
fresh.
• Starting fresh is a per-case basis
- Actually, currently 34 packages at Cartalyst. - PHP League currently has 10 packages. - Invite everybody to come join the PHP league - “If you have an idea or existing package which solves a common problem”
- Phil Sturgeon comes yelling to fix Sentry working with PyroCMS - Fuel-PDF (a great example of what would these days be a terrible package)
- Ask who started on CodeIgniter, FuelPHP, Zend, others?