Skip to content

Div PHP Ways 2.3.0

Compare
Choose a tag to compare
@rafageist rafageist released this 18 Jul 16:36
· 11 commits to master since this release

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 points
  • fix: Check if exists methods, before execute an action
  • improvement: * 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]}