Skip to content

Commit

Permalink
MASSIVE overhaul & simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
henderjon committed Jul 6, 2016
1 parent 66d5ac3 commit c44654a
Show file tree
Hide file tree
Showing 56 changed files with 176 additions and 857 deletions.
30 changes: 1 addition & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,7 @@ and a few other frameworks to see how they did it. In trying to write code that
was a poor man's clone of any one system I wrestled with how I wanted Kernel to
function.

A web app needs a router, dispatcher, controller, and a few other things. The
trick is, decoupling these components makes them just shy of useful without some
elbow grease. I didn't want to be so generic that these pieces would require more
boiler plate. So I went round and round over my controller and landed on
"I'm not going to code one" ...

Basically, your front controller needs to route the request and dispatch it. Adding
a controller might be useful and reduce the boilerplate but means that I'll have to
be more opinionated than I want to be. So I chose to use an interface to define
what a dispatchable class should look like, and then asked my dispatcher to simply
wrap a class (matching the interface) in a closure. It's probably not for everyone
because it still requires a bit of boilerplate but in the end, it's simpler and
in my opinion, more straightforward.

I've left these two pieces decoupled against my better judgment. First, if you're
using Router, you're *probably* using Distacher. Also, Dispatcher accepts a $di in
the constructor. I think it'd be wise to typehint that to Containers\DiInterface.
I also think it'd be wise to typehint the constructor of DispatchableInterface.
But in order to play in the sandbox with the cool kids, I've left them without
opinions.

For historical purposes I've left the old Request and Controller work in a branch
unto themselves.

The `example/` dir has some samples of the boilerplate stuff with a bit more
direction in the comments on how **I** would structure a web app--be it good
or otherwise.

Peruse the tests or, if present, the examples directory to see usage.
To view how this module can interact with it's siblings try [chev](https://github.com/chevronphp/chev).

See [packagist](https://packagist.org/packages/chevron/kernel) for version/installation info.

Expand Down
Empty file removed example/.placeholder
Empty file.
36 changes: 0 additions & 36 deletions example/app/init.php

This file was deleted.

11 changes: 0 additions & 11 deletions example/app/layouts/index.php

This file was deleted.

9 changes: 0 additions & 9 deletions example/app/paths.php

This file was deleted.

46 changes: 0 additions & 46 deletions example/app/services/dbs.php

This file was deleted.

38 changes: 0 additions & 38 deletions example/app/services/globals.php

This file was deleted.

28 changes: 0 additions & 28 deletions example/app/services/loggers.php

This file was deleted.

13 changes: 0 additions & 13 deletions example/app/services/views.php

This file was deleted.

3 changes: 0 additions & 3 deletions example/app/views/index.php

This file was deleted.

Empty file removed example/conf/.placeholder
Empty file.
7 changes: 0 additions & 7 deletions example/conf/.user.ini

This file was deleted.

26 changes: 0 additions & 26 deletions example/conf/config.ini

This file was deleted.

1 change: 0 additions & 1 deletion example/example.php

This file was deleted.

32 changes: 0 additions & 32 deletions example/public/css/stylesheet.css

This file was deleted.

Binary file removed example/public/images/clear.gif
Binary file not shown.
4 changes: 0 additions & 4 deletions example/public/index.php

This file was deleted.

5 changes: 0 additions & 5 deletions example/without-controllers/ActionNotFoundException.php

This file was deleted.

26 changes: 0 additions & 26 deletions example/without-controllers/BaseController.php

This file was deleted.

9 changes: 0 additions & 9 deletions example/without-controllers/Di.php

This file was deleted.

Loading

0 comments on commit c44654a

Please sign in to comment.