<commit_before>Oak php
=======

*Oak* is an *unframework* in PHP. It's aimed at small, lightweight, do-it-yourself apps, completely avoiding the heavy weight of bloated frameworks. It builds up from the strengths of php, instead of over-engineering and using automagical smoke and mirrors.

What it implements:
 - Path routing.
 - Standardized class autoloading.

	
Principles:
 - Ultra-explicit configuration, no magic.
 - Ultra-thin layer over plain php, no wizardry.
 - Ultra-loose coupling, no convoluted architecture.

	
Organization
---------

Organization is a solved problem. Follow the PSR-0 standard, where classes and namespace structure is reflected in the file system. A class called `myapp\validators\DataValidator` is expected in `myapp/validators/DataValidator.php`. Autoloading is done with a simple class loader.

The autoloading mechanism is the only thing that isn't strictly explicit in Oak, but it's part of PHP and is backed by a standard. So it isn't some conjured up magical behavior.

Decoupling
----------

Oak only contains a few classes at its core, and they're decoupled using simple dependency injection. Whenever a class needs another class' functionality, it accepts an instance object as a paramter. There are no hardcoded dependencies. Follow this convention for the rest of your app and you're all set.

Keeping things minimal, the Oak classes don't use interface classes. Adding interfaces would make things more formal and strict, but it's debatable whether it's actually worth it. 

Explicit configuration
----------------------

A straightforward mod_rewrite directive routes all requests to a single php file. This file is yours to edit and modify. By default, `init.php` includes the global Oak init file, which sets up some useful path constants and the class autoloader. All object instantiations are done right there; nothing is hidden behind the scenes. Modify it as much as you like -- you can just grab the default one if you need to go back.

Simple control flow
-------------------

At the end of the init file, the dispatcher is called and it routes the request to the appropriate controller method. The Dispatcher class uses two servant classes to do this: the Router, which selects a controller based on the request path, and the Invoker, which instantiates the controller class and calls the handler method. These can easily be replaced with your own classes.

Getting started<commit_msg>readme fix<commit_after>Oak php
=======

_Oak_ is an _unframework_ in PHP. It's aimed at small, lightweight, do-it-yourself apps, completely avoiding the heavy weight of bloated frameworks. It builds up from the strengths of php, instead of over-engineering and using automagical smoke and mirrors.

What it implements:
 * Path routing.
 * Standardized class autoloading.

	
Principles:
 * Ultra-explicit configuration, no magic.
 * Ultra-thin layer over plain php, no wizardry.
 * Ultra-loose coupling, no convoluted architecture.

	
Organization
---------

Organization is a solved problem. Follow the PSR-0 standard, where classes and namespace structure is reflected in the file system. A class called `myapp\validators\DataValidator` is expected in `myapp/validators/DataValidator.php`. Autoloading is done with a simple class loader.

The autoloading mechanism is the only thing that isn't strictly explicit in Oak, but it's part of PHP and is backed by a standard. So it isn't some conjured up magical behavior.

Decoupling
----------

Oak only contains a few classes at its core, and they're decoupled using simple dependency injection. Whenever a class needs another class' functionality, it accepts an instance object as a paramter. There are no hardcoded dependencies. Follow this convention for the rest of your app and you're all set.

Keeping things minimal, the Oak classes don't use interface classes. Adding interfaces would make things more formal and strict, but it's debatable whether it's actually worth it. 

Explicit configuration
----------------------

A straightforward mod_rewrite directive routes all requests to a single php file. This file is yours to edit and modify. By default, `init.php` includes the global Oak init file, which sets up some useful path constants and the class autoloader. All object instantiations are done right there; nothing is hidden behind the scenes. Modify it as much as you like -- you can just grab the default one if you need to go back.

Simple control flow
-------------------

At the end of the init file, the dispatcher is called and it routes the request to the appropriate controller method. The Dispatcher class uses two servant classes to do this: the Router, which selects a controller based on the request path, and the Invoker, which instantiates the controller class and calls the handler method. These can easily be replaced with your own classes.

Getting started
{'fraction_non_alphanumeric': 0.06515058389674247, 'fraction_numerical': 0.0004097520999795124, 'mean_word_length': 3.9263370332996974, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4242221', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1128, 'n_words': 710}