2015-08-01, 01:31:11
(2015-07-30, 21:12:05)Angryboy Wrote: In line with Tyblitz's comments on showcasing a Hello World plugin without external dependencies, I've created a branch that shows how this can be done in PHP 5.3+. That branch has a portable GetSimple environment on Vagrant along with it.
I really like the new example, still clean & doesn't abstract away too much.
You think it's good to include a note like:
PHP Code:
call_user_func(function($id) {
include $id . '/index.php';
}, basename(__FILE__, '.php'));
// If you have to work with PHP 5.2 or older, replace the anonymous functions in the code
// with named functions & their references, like so:
//
/* call_user_func('myplugin_init', basename(__FILE__, '.php'));
function myplugin_init() {
include $id . '/index.php';
}
*/