Librarian

Overview

Librarian allows you to group Kohana 2.x classes into subfolders, making it easier to organise your files once your libraries folder starts getting full.

Library classes in subfolders

Download it here: librarian.zip, or feedback.

Quick start

Installation

Librarian is not actually a module, but a hook.

To install the hook:

  1. Copy the libraian.php file to your hooks directory
  2. Enable hooks in your main application config file

Usage

For any classes that have a common suffix, i.e. Table, simply place them in a new subfolder,i.e. tables (lowercase and plural).

Librarian also supports inflection (at the expense of lazy-loading the inflection helper) so for example if your classes were Some_Body, Every_Body, you would place them in the subfolder bodies.

Kohana will then find and load the classes as normal.

How it works

Librarian registers an additional SPL_Autoload function, which kicks in after the standard autoloader has failed to find the classes in the main libraries folder. It then looks for the classes in the plural of the class name suffix.