Curated list of packages
Packages we like
This page contains a list of packages that we often use at TheCodingMachine and that we like (a lot).
HTTP client libraries
Using cURL? Stop right there! cURL is hard to use. Error handling is poor (no exceptions, you have to check for errors manually), and there are a number of tricks one has to know to successfully use it (ask anyone who tried to do HTTPS with cURL).
You definitely want to use a "wrapper" around cURL that will make your life easier (we call that an "HTTP Client").
- Guzzle (6+)
- HTTPlug : an abstraction library on top of Guzzle. Use this (and this only) if you are writing a library meant to be used in several projects
File system access
Need to access the file system? Think
fwrite is enough? Think twice. Error handling is poorly done (no exceptions) and you might enjoy using a wrapper that will handle a lot of the tiny details onemust think about when accessing files.
- symfony/filesystem: a battle-tested tiny lib on top of common file system functions.
- The PHP league's flysystem: an abstraction library to easily swap out a local filesystem for a remote one. Think about accessing files using FTP, AWS S3, or Dropbox as easily as local files.
Do not use PHP's
- Swift mailer: an elegant object-oriented library to send emails
- thecodingmachine/swift-twig-mail-template: a bridge to easily turn Twig templates into Swift messages
You often need to display the same image using many resolutions (full size, thumbnails) and ratios (square, landscape or portrait). Worst thing to do would be loading the original (uploaded) image and resize or crop it using CSS, whitch will result in very low network performances. Also avoid developping your own "image preset manipulation" library.
- ThePHPLeague's Glide : API is exposed via HTTP, ex :
- Mouf's awesome MoufImagine package : A Mouf wrapper around the Imagine library. You can define URLs for each image preset inside Mouf.
CSS integration with JS frameworks & libraries (AngularJS, Vue.js or React, ...)
Re-implementing bootstrap, materialize form validation, or custom controls like datepickers, sliders, etc. is a wast of time and energy. You should be able implementations of Bootstrap, Materialize or Foundation for the main JS frameworks / libraries :