Releases: divengine/ways
Releases · divengine/ways
Div PHP Ways 2.4.1
Div PHP Ways 2.4.0
New feature: passing data and args to rules.
<?php
ways::rule('is-admin-section', function($data, $args){
return $args['section'] === 'admin';
});
ways::listen("/{section}/login", function(){
echo "admin login";
}, ['rules' => ['is-admin-section']]);
Div PHP Ways 2.3.4
Minor fix
fix
: rules for default action Run
Div PHP Ways 2.3.3
Fix the flow of the data before bootstrap and invoke.
Div PHP Ways 2.3.2
Simple release
- bug fix in rules
Div PHP Ways 2.3.1
Urgent release!
fix
. Fix lost data resulting from "file control points"fix
. Other fixes for nested calls of control pointsfix
. Other minor fixesrelease
. Urgent release 2.3.1!new
: New method for get current data on the way
<?php
$current_data_on_the_way = ways::getCurrentData();
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]}
Div PHp Ways 2.2.0
Support namespaces
Now divengine\ways
detect namespace instruction. You can do this:
<?php
namespace MyApp;
#listen = /
class MyController {
static function Run() {
echo "Hello universe";
}
}
Div PHP Ways 2.1.0
Adding rules!
ways::rule('some-rule', function() {return true or false;});
ways::listen("/secret", function() {...}, [
ways::PROPERTY_RULES => [
'some-rule',
function () {
return true; // another rule
}
]
]);
In class controllers:
class SomeController {
#listen@someAction = /some/action
#rules@someAction = some-rule
static function someAction() {
...
}
}
Div PHP Ways 2.0.0
Initiating a new form of implementation. Now Div Software Solutions projects will be inside the divengine
namespace. The divWays class was renamed simply ways
.
use divengine\ways;
ways::listen("/", function () {
echo "Hello universe";
});