ip-location-block-live-log

May 11, 2021
Darko G.

Database source name (DSN) of SQLite for Live update.

Description

The filter hook “ip-location-block-live-log” assigns the database source name of SQLite for Live update.

Parameters

  • $dsn
    (string) get_temp_dir() . “ip-location-block-live-log-%d.sqlite” (%d is blog ID)

Use case

The following code in your functions.php can override the default value.

function my_sqlite_dsn( $path ) {
    return '/tmp/' . basename( $path );
}
add_filter( 'ip-location-block-live-log', 'my_sqlite_dsn' );

Note

This plugin uses PDO_SQLITE driver. If you specify :memory: as an DSN, then “Live update” would not work properly because PDO::ATTR_PERSISTENT is set as false in a constructor of PDO.

NOTE: When you select "mu-plugins" (ip-location-block-mu.php) as Validation timing , you should put your code snippet into drop-in.php in Geolocation API folder instead of functions.php. See My custom functions in “functions.php” doesn’t work. in FAQ for detail.

Since

0.3.0.5

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2022 - IP Location Block by IDEOLOGIX Media