Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 138 | All time: 9,029 This week: 317![]() |
Version | Licenses | PHP version | Categories | |||
kohana-orm-audit 1.0 | Artistic License, F... | 5.3 | PHP 5, Databases, Logging, Design Pat... |
# Ordit Ordit is a Kohana 3.x module that adds automatic auditing to the Official ORM module. Ordit is a transparent extension that audits all CUD actions on your objects. It includes a Log Viewer to view all Audit logs. ## Getting started Before we use Ordit, we must enable the modules required Kohana::modules(array( ... 'database' => MODPATH.'database', 'orm' => MODPATH.'orm', 'ordit' => MODPATH.'ordit', ... )); [!!] Ordit requires the ORM module (plus its dependencies) to work. ### Setting up the database You need to create a table in your database to hold all your logs. A script is included in the module named `ordit_logs.sql` The script is for a mysql database running the InnoDB engine. The table is configured as follows: Table Name :: `ordit_logs` Columns :: `id` INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY `model` CHAR(50) NOT NULL, `action` CHAR(7) NOT NULL, `values` TEXT NOT NULL, `user` CHAR(50) NOT NULL, `timestamp_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, ### Overriding the Ordit::get_username Method In order to provide the current logged in user's username for auditing, create a class in your classes folder named `Ordit` that extends the `Model_Ordit` class. Then override the `get_username` method to return the current logged in user's username. The example below uses the default `Auth` module. class Ordit extends Model_Ordit { protected function get_username() { return Auth::instance()->get_user()->username; } } ### Auditing Your Models To enable auditing of your ORM models, you simple extend `Ordit`. class Model_Model extends Ordit { ... } Any CREATE, UPDATE and DELETE actions are automatically and transparently logged. You don't have to do anything else. ### Viewing Your Logs The module includes a log viewer. You can view logs at (http://site_root/ordit) [!!]The log viewer was modified from [Kohana Log Viewer](https://github.com/ajaxray/Kohana-Log-Viewer) viewer. ## TODO ### Log Changes to Related Modules Currently, changes to related modules are logged as an empty array. ##Improve Viewer Add pagination to the log results Add ability to search by currently `undefined parameters` |
Screenshots | ||
![]() |
/ | assets |
File | Role | Description |
---|---|---|
![]() ![]() |
Data | Auxiliary data |
![]() ![]() |
Data | Auxiliary data |
![]() ![]() |
Data | Auxiliary data |
![]() |
/ | classes |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
Class | Class source |
![]() |
/ | guide | / | ordit |
File | Role | Description |
---|---|---|
![]() ![]() |
Doc. | Documentation |
![]() ![]() |
Doc. | Documentation |
![]() ![]() |
Doc. | Documentation |
![]() ![]() |
Doc. | Documentation |
![]() ![]() |
Doc. | Documentation |
![]() |
/ | views | / | ordit |
File | Role | Description |
---|---|---|
![]() ![]() |
Output | Sample output |
![]() ![]() |
Output | Sample output |
![]() ![]() |
Output | Sample output |
![]() ![]() |
Output | Sample output |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
95% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
Github Repository The Github repository for this module |
Documentation Read the documentation online |