PHP Class Crud\Listener\ApiQueryLogListener

Very much like the DebugKit version, the SQL log will only be appended if the following conditions is true: 1) The request must be 'api' (.json/.xml) 2) The debug level must be 2 or above Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
Inheritance: extends BaseListener
Datei anzeigen Open project: friendsofcake/crud

Public Methods

Method Description
beforeRender ( Cake\Event\Event $event ) : void Appends the query log to the JSON or XML output
implementedEvents ( ) : array Returns a list of all events that will fire in the controller during its lifecycle.
setupLogging ( Cake\Event\Event $event ) : void Setup logging for all connections

Protected Methods

Method Description
_getQueryLogs ( ) : array Get the query logs for all sources
_getSource ( string $source ) : Cake\Datasource\ConnectionInterface Get a specific data source
_getSources ( ) : array Get a list of sources defined in database.php

Method Details

_getQueryLogs() protected method

Get the query logs for all sources
protected _getQueryLogs ( ) : array
return array

_getSource() protected method

Get a specific data source
protected _getSource ( string $source ) : Cake\Datasource\ConnectionInterface
$source string Datasource name
return Cake\Datasource\ConnectionInterface

_getSources() protected method

Get a list of sources defined in database.php
protected _getSources ( ) : array
return array

beforeRender() public method

Appends the query log to the JSON or XML output
public beforeRender ( Cake\Event\Event $event ) : void
$event Cake\Event\Event Event
return void

implementedEvents() public method

You can override this function to add you own listener callbacks We attach at priority 10 so normal bound events can run before us
public implementedEvents ( ) : array
return array

setupLogging() public method

Setup logging for all connections
public setupLogging ( Cake\Event\Event $event ) : void
$event Cake\Event\Event Event
return void