Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Discussion] "Hello World" Redux (towards a possible Plugin SDK)
#16
I understand (and to note, you're already contributing to the PHP 5.2 discussion).

How about a very small wrapper for create_function:

PHP Code:
// Wrapper
if (!class_exists('Closure') && !function_exists('closure')) {
  function 
closure($params ''$use = array(), $body '') {
   
 return create_function($params"extract($use); " $body);
  }
}

// Example Usage
$i18n closure('$hash', array('id' => $id), '
  return i18n_r($id . "$hash");
'
); 

?

Not tested it yet.

Also, shawn: do you have a sketch of how you think an ideal plugin would end up looking once the refactoring is done (like in a GitHub issue or comment or something)?
Reply


Messages In This Thread
RE: [Discussion] "Hello World" Redux (towards a possible Plugin SDK) - by Angryboy - 2015-08-02, 11:33:33



Users browsing this thread: 2 Guest(s)