Want to make PHP's exceptions more helpful to your users, even if they're speaking to it over a JSON API or command line script? github.com/paragonie/corn…
Note: v1.x of this library targets EOL versions of PHP. You'll ideally want to use version 2 at a minimum.

But anyway, consider this a holiday gift to the PHP community. (I might have proposed it to FIG, if I were a member, and wasn't wary of endless bikeshedding.)
So what does Corner do? It transforms thorny corner-case errors into something that developers will find more useful.

It was inspired by this tweet:
If you want to make your exceptions more useful, the methods that Corner adds to the Exception and Error classes should allow you to reproduce the awesomeness of Rust's error reporting.
If you want to be lazier, you can just link the end user to a specific page/section of your online documentation that pertains to that specific error message, so long as it discusses common causes and troubleshooting strategies.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Scott Arciszewski

Scott Arciszewski Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @CiPHPerCoder

Oct 29, 2018
Fun activity:

Go through the plugins/extensions/whathaveyou for your favorite CMS/framework (especially eCommerce) and see which ones disable certificate validation for HTTPS requests.

paragonie.com/blog/2017/10/c…
Plugins for payment gateways that disable either are worth 5 points, unless they disable both, in which case they're worth 20 points.
If you expected to not find anything, well, I hope you didn't bet the farm on that:

Read 11 tweets
Oct 28, 2018
Let's talk about some of the open source libraries that @ParagonIE has created over the years to make it easier to make secure PHP applications.

paragonie.com/software
First, the polyfill libraries:

random_compat exists so that your framework can use the newer PHP 7 CSPRNG API even if they support PHP 5. It's used by a lot of projects, including WordPress.

github.com/paragonie/rand…
In a similar spirit, sodium_compat reimplements (most of) libsodium in pure PHP, and even supports 32-bit operating systems. Its purpose is to help projects transition toward PHP 7.2+ support.

github.com/paragonie/sodi…
Read 16 tweets
Feb 6, 2018
I've drafted several blog posts in the past week and scrapped them all. None of them feel important enough to write about, let alone publish.
This isn't coming from a position of writer's block. This is coming from a position of empathy. Time is precious, and I hate to waste anyone's.
Application security: I don't know whether it's better classified as "poorly understood" or "underappreciated".
Read 30 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(