Instead of updating 60+ scripts to read e.g.
$session = get_session() or Site::CGI->go_login; I decided to get hackier.$session = get_session() or Site::CGI->go_login; I decided to get hackier.--disable-all to build with a minimal number of extensions by default, and that’s not really great for showing just what could work on rumprun.libjpeg-turbo and libpng so that this PHP can use gd.libmemcached-1.0 is written in C++ and depends on some exception-handling symbols. PHP links with $(CC), which doesn’t include any C++ support.php-cgi SAPI… which is also not a multithreaded option. It expects to run single-threaded child processes under a FastCGI process manager. (php-fpm simply integrates a process manager, so that you don’t need to find a separate one and integrate it; it’s also multi-process.)markup-menu.php. This is a stupidly simple program that takes a unique filename prefix, finds the matching *.md file, and passes it to the much larger markup.php.$.getJSON(url [, data] [, success])
LIB) has a function like:LIB.getJSON(url, data, success [, error])
{Error:true,ErrorMsg:"boom"} and the LIB.getJSON catches these and invokes the error callback instead of the success one.LIB.getJSON is to pass an error handler and let the user know “okay. we are not loading anymore.” But notice that the error handler is still considered optional for some reason.)function success (data, txt, xhr) {
// ...
}
function error (xhr, txt, err) {
var r;
try {
r = $.parseJSON(xhr.responseText);
} catch (e) {}
// ...
}
$.getJSON(url, data)
.then(success, error);
newErrorHandler(showErrorUI) as the error callback into .then(). But the point is, there’s no need to have LIB.getJSON as a whole anymore, to both accept an error callback and filter ‘successfully returned error’ values.
And fundamentally, inheritance is the wrong tool for reuse. Providing lots of small methods to make for improved reuse through inheritance is an equally wrong approach.
accept() method.say and maybe the // operator. For the most part, assume a use v5.10; line before any code. I may not adhere to use strict; use warnings; in this post, but my production code does.)