fluxoft/rebar
Rebar: A simple but sturdy support framework.
Requires
- php: >=5.4.0
- doctrine/dbal: 2.5.*
- psr/log: ^1.0
Requires (Dev)
- phpunit/phpunit: 4.1.*
- squizlabs/php_codesniffer: *
Suggests
- smarty/smarty: Allows the use of the Smarty Presenter class.
- twig/twig: Allows the use of the Twig Presenter class.
- firebase/php-jwt: Allows the use of the Auth\Jwt authentication class.
- dev-master
- 0.23.12
- 0.23.11
- 0.23.10
- 0.23.9
- 0.23.8
- 0.23.7
- 0.23.6
- 0.23.5
- 0.23.4
- 0.23.3
- 0.23.2
- 0.23.1
- 0.23.0
- 0.22.4
- 0.22.3
- 0.22.2
- 0.22.1
- 0.22.0
- 0.21.9
- 0.21.8
- 0.21.7
- 0.21.6
- 0.21.5
- 0.21.4
- 0.21.3
- 0.21.2
- 0.21.1
- 0.21.0
- 0.20.1
- 0.20.0
- 0.19.1
- 0.19.0
- 0.18.9
- 0.18.8
- 0.18.7
- 0.18.6
- 0.18.5
- 0.18.4
- 0.18.3
- 0.18.2
- 0.18.1
- 0.18.0
- 0.17.18
- 0.17.17
- 0.17.16
- 0.17.15
- 0.17.14
- 0.17.13
- 0.17.12
- 0.17.11
- 0.17.10
- 0.17.9
- 0.17.8
- 0.17.7
- 0.17.6
- 0.17.5
- 0.17.4
- 0.17.3
- 0.17.2
- 0.17.1
- 0.17.0
- 0.16.0
- 0.15.1
- 0.15.0
- 0.14.5
- 0.14.4
- 0.14.3
- 0.14.2
- 0.14.1
- 0.14.0
- 0.13.1
- 0.13.0
- 0.12.0
- 0.11.2
- 0.11.1
- 0.11.0
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.8
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.5.0
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- v0.3.0-beta
- 0.1.0
- dev-releases
README
http://en.wikipedia.org/wiki/Rebar
This is a framework. There are many like it. This one is mine.
This is beta software. Use at your own risk (although I feel pretty close to making a 1.0 release).
Why Another Framework?
Short answer: why not? Slightly longer answer: I wanted something that was an extremely lightweight solution for knocking together a quick and dirty website that would allow me to easily add various components as needed. Rebar should be a simple, easy-to-use framework that adds strength while offering flexibility.
It should have as few moving parts as possible, so that it's easily understood and maintained when I inevitably have to revisit something a year from now.
How Does It Work?
At its simplest, I use Rebar by directing all traffic to an index.php which calls the Router class.
**/index.php**
$loader = require_once 'vendor/autoload.php';
$request = new Fluxoft\Rebar\Http\Request(
Fluxoft\Rebar\Http\Environment::GetInstance()
);
$response = new Fluxoft\Rebar\Http\Response();
$router = new Fluxoft\Rebar\Router(array(
'namespace' => 'SiteSpecificClasses'
));
$router->Route($request, $response);
If no special routes are configured, the Router will split the path into parts and use those parts to instantiate an Actor, call a method (action), and pass in the rest as "URL params." For instance, a request to /test/url/123/456 will create an object from the following class and call its Url method, passing in the rest of the path parts:
**/app/Actors/Test.php**
namespace SiteSpecificClasses\Actors;
class Test extends \Fluxoft\Rebar\Actor {
public function Url(array $params) {
$this->Set('url', $params['url'];
}
}
If no Presenter is specified in the controller, the default Debug presenter will then render the data as so:
url (Array) => [
0 => 123
1 => 456
]
I really wouldn't recommend anyone use this for anything other than maybe to play around a bit at this point, as I am freely breaking backward-compatibility on a whim from time to time. Watch this space; if I ever get to a point where I think this is "done" enough that other people could feel safe using it, I will release a 1.x release and start caring about backwards compatibility. For now, I'm just experimenting.