An object storage producing real speaking code implemented in PHP.
You ever wanted to put some stuff in a cool object in PHP? You already can, I hear you say. No, this one is cooler!
You can find a demo file with a lot of comments in this repo called demo.php with all stuff KnowledgeBase.php can do at the moment.
You can run automated tests using PHPUnit: Simply run
$ phpunit
from the root directory of the repo.
Have fun!
There are some simple reasons why I did that as an four-hour project. Here they are:
- There are some languages like Prolog or SQL doing exactly that: Offering a way to parse spoken words as valid code. Why not offer such a way for objects in PHP? :)
- Some people always say "Let your code and variable names speak so someone can understand it!". Here you go!
- I wanted to make more cool stuff using jQuery-like query stuff. Actually inspired by Kirby CMS - it has exactly that for all objects making working with it easier and cooler. So that was a learning project for me.
- It is cool. Period.
Yeah, you can. If you really want to use it.
It does not seem to have bugs, but do you really need it? Maybe use a simpler structure :).
As I already said: It is a learning project. So if you know a better way to implement that features, let me know on Twitter or create a Pull Request!
Thanks a lot!
- Idea to implement a jQuery-like query syntax in a PHP project: Kirby CMS
- Development and query syntax: Lukas Bestle
