Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w") // stderr
);
$scripts_dir = $Configuration['EXTENSIONS_PATH'].$EXTENSION_NAME.'/scripts/';
foreach ( executables( $scripts_dir ) => $script) {
$process = process_open ($scripts_dir.$script, $descriptorspec, $pipes);
fwrite($pipes[0], serialize_context());
fclose($pipes[0]);
$stuff_to_unserialize = stream_get_contents($pipes[1]);
fclose($pipes[1]);
if (proc_close($process)) {
unserialize_context_and_delegates($stuff_to_unserialize)
}
}
function DelegateFor{$script}{$FunctionName} () {
// some initialization here
$process = process_open ($scripts_dir.$script, $descriptorspec, $pipes);
fwrite($pipes[0], serialize_context_and_delegates('$FunctionName'));
fclose($pipes[0]);
$stuff_to_unserialize = stream_get_contents($pipes[1]);
fclose($pipes[1]);
if (proc_close($process)) {
unserialize_context_and_delegates($stuff_to_unserialize)
}
}
1 to 9 of 9