Skip to content

Releases: divengine/ways

Div PHP Ways 2.4.1

13 Dec 05:10
Compare
Choose a tag to compare

New feature: passing controller's properties to rules

<?php
ways::rule('is-admin-section', function($data, $args, $props){
	var_dump($props);
	return $args['section'] === 'admin';
});

Div PHP Ways 2.4.0

13 Dec 04:53
Compare
Choose a tag to compare

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

24 Aug 04:07
Compare
Choose a tag to compare

Minor fix

  • fix: rules for default action Run

Div PHP Ways 2.3.3

04 Aug 23:38
Compare
Choose a tag to compare

Fix the flow of the data before bootstrap and invoke.

Div PHP Ways 2.3.2

23 Jul 16:20
Compare
Choose a tag to compare

Simple release

  • bug fix in rules

Div PHP Ways 2.3.1

18 Jul 22:48
Compare
Choose a tag to compare

Urgent release!

  • fix. Fix lost data resulting from "file control points"
  • fix. Other fixes for nested calls of control points
  • fix. Other minor fixes
  • release. 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

18 Jul 16:36
Compare
Choose a tag to compare

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]}

Div PHp Ways 2.2.0

08 Jul 22:47
Compare
Choose a tag to compare

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

06 Jul 06:30
Compare
Choose a tag to compare

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

04 Jul 04:15
Compare
Choose a tag to compare

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"; 
});