Developed with love by KnpLabs Hire us for your project!
0

JSMysqlndBundle

by johannes

A Symfony2 Bundle for collecting mysqlnd statistics

JSMysqlndBundle

The JSMysqlndBundle is an extension to th Symfony2 profiling toolbar. It
extends the data collection with information gathered from PHP's mysqlnd
database driver, giving more insight on the performance.

Screenshot

Requirements

For making use of this bundle you need Symfony2 running on a PHP setup
where the mysqli extension is activated and mysqlnd is being used. The mysqli
extension is only used to retrieve data. It is no requirement for your
application to use to use mysqli. Applications using Doctrine and PDO are
fully supported.

Installation

Installation is a quick process:

  1. Download JSMysqlndBundle or install it via Composer
  2. Configure the Autoloader
  3. Enable the Bundle

Step 1: Download JSMysqlndBundle

Ultimately, the JSMysqlndBundle files should be downloaded to the
vendor/bundles/JS/MysqlndBundle directory.

This can be done in several ways, depending on your preference. The first
method is the standard method for Symfony 2.1+.

Using Composer

$ php composer.phar require "js/mysqlnd-bundle=v1.1.3"

Take a look at the page on Packagist web site for more details and up-to-date version numbers.

Using the vendors script

This method is the standard method for Symfony 2.0
Add the following lines in your deps file:

[JSMysqlndBundle]
    git=git://github.com/johannes/JSMysqlndBundle.git
    target=bundles/JS/MysqlndBundle

Now, run the vendors script to download the bundle:

$ php bin/vendors install

Using submodules

If you prefer instead to use git submodules, the run the following:

$ git submodule add git://github.com/johannes/JSMysqlndBundle.git vendor/bundles/JS/MysqlndBundle
$ git submodule update --init

Step 2: Configure the Autoloader

This step should be omitted if you used Composer to install this Bundle.

Add the JS namespace to your autoloader:

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    // ...
    'JS' => __DIR__.'/../vendor/bundles',
));

Step 3: Enable the bundle

Finally, enable the bundle in the kernel. Note: You probably want to do this
for development and test systems only.

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
    );

    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        // ...
        $bundles[] = new \JS\MysqlndBundle\JSMysqlndBundle();
    }
}
Copyright (c) 2012, Johannes Schl├╝ter <johannes@schlueters.de>
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name JSMysqlndBundle nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.