Title: Setup with SQLite Database Integration
Last modified: November 6, 2023

---

# Setup with SQLite Database Integration

 *  Resolved [predaytor](https://wordpress.org/support/users/predaytor/)
 * (@predaytor)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setup-with-sqlite-database-integration/)
 *     ```wp-block-code
       <?php
   
       function extend_configuration() {
           function adminer_object() {
               include_once PEXLECHRIS_ADMINER_DIR . '/inc/class-pexlechris-adminer.php';
               include_once "./plugins/plugin.php";
               include_once "./plugins/login-password-less.php";
   
               class AdminerCustomization extends \AdminerPlugin  {
                   function loginFormField($name, $heading, $value) {
                       return parent::loginFormField($name, $heading, str_replace('value="server"', 'value="sqlite"', $value));
                   }
                   function database() {
   
                       return WP_CONTENT_DIR . '/database/.ht.sqlite';
                   }
               }
   
               return new AdminerCustomization(array(
                   new \Pexlechris_Adminer(),
                   new \AdminerLoginPasswordLess(password_hash("password", PASSWORD_DEFAULT)),
               ));
           }
       }
       add_action('pexlechris_adminer_before_adminer_loads', 'extend_configuration', 999);
       ```
   
 * Following setup for Adminer Plugins, I cannot get this work for sqlite 🙁

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Pexle Chris](https://wordpress.org/support/users/pexlechris/)
 * (@pexlechris)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setup-with-sqlite-database-integration/#post-17186297)
 * Hi,
 * First of all why do you need to login without a password?
 * In adminers documentation, I have found this
 * [https://github.com/vrana/adminer/blob/master/adminer/sqlite.php](https://github.com/vrana/adminer/blob/master/adminer/sqlite.php)
 * In your code there is \ for different namespace… I don’t know your folders and
   the namespace that you use. Have you tested that your function is executed?
 * And also
 *     ```wp-block-code
           include_once PEXLECHRIS_ADMINER_DIR . '/inc/class-pexlechris-adminer.php';
           include_once "./plugins/plugin.php";
           include_once "./plugins/login-password-less.php";
       ```
   
 * these are included successfully?
 *  Plugin Author [Pexle Chris](https://wordpress.org/support/users/pexlechris/)
 * (@pexlechris)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setup-with-sqlite-database-integration/#post-17186309)
 * You could try to do something like this…
 *     ```wp-block-code
       function extend_configuration() {
       	function adminer_object() {
   
       		include_once PEXLECHRIS_ADMINER_DIR . '/inc/class-pexlechris-adminer.php';
   
       		class AdminerLoginPasswordLess extends Pexlechris_Adminer{
       			/** @access protected */
       			var $password_hash;
   
       			/** Set allowed password
       			 * @param string result of password_hash
       			 */
       			function __construct($password_hash) {
       				$this->password_hash = $password_hash;
       			}
   
       			function credentials() {
       				$password = get_password();
       				return array(SERVER, $_GET["username"], (password_verify($password, $this->password_hash) ? "" : $password));
       			}
   
       			function login($login, $password) {
       				if ($password != "") {
       					return true;
       				}
       			}
   
       		}
   
       		class AdminerCustomization extends AdminerLoginPasswordLess  {
       			function loginFormField($name, $heading, $value) {
       				return parent::loginFormField($name, $heading, str_replace('value="server"', 'value="sqlite"', $value));
       			}
       			function database() {
   
       				return WP_CONTENT_DIR . '/database/.ht.sqlite';
       			}
       		}
       		return new AdminerCustomization();
   
       	}
       }
       add_action('pexlechris_adminer_before_adminer_loads', 'extend_configuration', 999);
       ```
   
 * but I think you dont need to include AdminerLoginPasswordLess plugin because 
   I have its methods in my class Pexlechris_Adminer
 *  Plugin Author [Pexle Chris](https://wordpress.org/support/users/pexlechris/)
 * (@pexlechris)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setup-with-sqlite-database-integration/#post-17186941)
 * And also have in mind that adminer’s hook customizations can be placed in a mu-
   plugin or a custom plugin. If you try to place to your child theme, the code 
   will not work
 *  Thread Starter [predaytor](https://wordpress.org/support/users/predaytor/)
 * (@predaytor)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setup-with-sqlite-database-integration/#post-17189098)
 * I thank you for fast response. But, unfortunately, this setup does not work. 
   I have used this hook in `functions.php` in currently active theme. Actually,
   it seems this hook is never fired, I cannot output some data to `debug.log` 🙁
   
   I’m using Bedrock setup with SQLite database as mu-plugin.
 *  Plugin Author [Pexle Chris](https://wordpress.org/support/users/pexlechris/)
 * (@pexlechris)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setup-with-sqlite-database-integration/#post-17189131)
 * Yes ffrom theme dont fired.
 * You nneed to Place it either in a must use plugin or in a custom plugin.
 * Instructions on how to create a mu plugin you can find here [https://www.pexlechris.dev/how-to-add-php-hooks-in-your-wordpress-site/](https://www.pexlechris.dev/how-to-add-php-hooks-in-your-wordpress-site/)
 * Have iin mind that display errors is disabled even WP_DEBUG_DISPLAY is set to
   true
 *  Thread Starter [predaytor](https://wordpress.org/support/users/predaytor/)
 * (@predaytor)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/setup-with-sqlite-database-integration/#post-17189134)
 * Thank you! I will try later.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Setup with SQLite Database Integration’ is closed to new replies.

 * ![](https://ps.w.org/pexlechris-adminer/assets/icon-256x256.png?rev=2685107)
 * [Database Manager - WP Adminer](https://wordpress.org/plugins/pexlechris-adminer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pexlechris-adminer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pexlechris-adminer/)
 * [Active Topics](https://wordpress.org/support/plugin/pexlechris-adminer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pexlechris-adminer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pexlechris-adminer/reviews/)

## Tags

 * [sqlite](https://wordpress.org/support/topic-tag/sqlite/)

 * 6 replies
 * 2 participants
 * Last reply from: [predaytor](https://wordpress.org/support/users/predaytor/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/setup-with-sqlite-database-integration/#post-17189134)
 * Status: resolved