User Tools

Site Tools

Translations of this page:

plugin:common

Common

Compatible with version

phplist 3

plugin Supporting classes required by some other plugins.

Last updated on
2016-06-22
Repository
Source
Requires
php 5.4
By Duncan Cameron

This plugin provides support classes required by some other plugins. It also provides three pages which are added to the Config menu

  • display the output of the phpinfo() function
  • display the config.php file (user id and passwords are removed)
  • display the contents of the php session

When installing or upgrading a plugin ensure that the latest CommonPlugin is installed as well.

Installation

See the README file on the GitHub page https://github.com/bramley/phplist-plugin-common for how to install the plugin.

Logging database queries

There is a mechanism to log the sql queries created by most plugins. This might be useful in debugging or to be able to run a query manually.

Add the following to the config.php file (at the end of the file is ok)

$log_options = array(
    'threshold' => 'DEBUG',
    'classes' => array(
        'phpList\plugin\Common\DB' => true,
    ),
);

Now queries will be logged to a file in the phplist temporary directory, identfied by the $tmpdir variable in config.php. The file will be named for the current day, e.g. log_2018-07-13.txt.

Alternatively you can specify a particular directory for the log file. The directory must be writeable by the web server process.

$log_options = array(
    'threshold' => 'DEBUG',
    'classes' => array(
        'phpList\plugin\Common\DB' => true,
    ),
    'dir' => '/path/to/directory',
);

Each query will be logged similar to this

[Fri 13 Jul 2018 10:09:15] [debug] phpList\plugin\Common\DB::_query, line 39
elapsed time 11.165857315063 ms
SELECT id, email, confirmed, blacklisted
            FROM phplist_user_user u
            LEFT JOIN phplist_listuser lu ON u.id = lu.userid
            WHERE userid is NULL

To stop logging queries simply change DEBUG to OFF.

plugin/common.txt · Last modified: 2018/07/13 14:58 by duncanc

Resources
Contact Us

e: info@phplist.com

Boring Bit

phpList is a registered limited company

UK Company No. 07582966

VAT Registration 122 0788 37

© phpList 2016