How to Monitor Client-Side Upload Progress (with XMLHttpRequest)

XMLHttpRequest Upload Progress

Showing a user something like a progress bar during a file upload is handy and let's them know that stuff is working. Higher level abstractions like fetch don't really provide a look into how much of a request body has been sent, but good ol' XMLHttpRequest does. In order to monitor upload progress, attach an… Continue reading How to Monitor Client-Side Upload Progress (with XMLHttpRequest)

In PHP Use is More Like an Alias than an Import

PHP Use is an Alias

PHP has a use statement that allows the importing or, more accurately, aliasing of classes into the current namespace. In other languages, like Python, importing a nonexistent class or module will fail at the import. In PHP, this doesn't happen, instead the program will fail later when the aliased class, function, or constant is is… Continue reading In PHP Use is More Like an Alias than an Import

Posted in PHP

Lifecycle Objects as Extension Points

lifecycle objects

Something I've found myself doing more and more is writing lifecycle objects that add notification-like extension points to other objects. A good example is the MessageLifecycle interface and its implementations in PMG's queue library. Rather than pollute the queue consumers with events or other more generic things directly, the lifecycle provides and extension point into… Continue reading Lifecycle Objects as Extension Points