jeDbCheckPlugin - 1.0.1

Framework to help you do sanity checks on your database.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

jeDbCheckPlugin plugin

Overview

This plugin provides a framework to help you write and run sanity check on your database. This plugins is in fact a single task which call the sanity check functions you define in your models and tables.

As a rule of thumb, if your sanity check is related to a single instance of a model, then you define it in the model class. But if it is related to several instances of this model, then you define it in the Table class. It is up to you to decide, the plugin will call what you defined, wherever it is.

Here is an example of a callback function

public function jeDbCheckCallback(){
  /* insert your sanity check code here */
  /* note: this is not a static function, so $this is an instance
     of the current class */
}

If you want to log something inside this function use

jeDbCheck::log_info("the message to log");

If you want to notify an error, throw an exception

throw new jeDbCheckException('Something failed');

Installation

To install jeDbCheckPlugin:

./symfony plugin-install jeDbCheckPlugin

or

svn co http://svn.symfony-project.com/plugins/jeDbCheckPlugin plugins/jeDbCheckPlugin

Clear your cache

./symfony cc

You're done!

Usage

To check the configuration of the host:

./symfony jeDbCheck

Change Log

  • 1.0.0
    • Initial release

License

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.