Div PHP Ways 2.3.0
Multi-ways, optimization and fixes
improvement
: Independent "ways" for invocations:
The execution of the PHP script (CLI or HTTP) have a main "request id" or "thread id", that is named WAY ID. Then each ways::invoke() have their own way id.
<?php
ways::listen("app://config", function(){
$data['config'] = [1,2,3];
return $data;
});
$config = ways::invoke("app://config");
echo json_encode($config); // {"track":1,"config":[1,2,3]}
// the second call did not work in 2.2.0 version
$config = ways::invoke("app://config");
echo json_encode($config); // {"track":1,"config":[1,2,3]}
fix
: Bug fix in nested calls of control pointsfix
: Check if exists methods, before execute an actionimprovement
: * pattern is now for all protocols
<?php
ways::listen("*", function($data){
$data['track'] = 1;
return $data;
});
ways::listen("app://config", function(){
$data['config'] = [1,2,3];
return $data;
});
$config = ways::invoke("app://config");
echo json_encode($config); // {"track":1,"config":[1,2,3]}