Title: add Adminer&#8217;s plugins
Last modified: April 13, 2020

---

# add Adminer’s plugins

 *  [Cyberchicken](https://wordpress.org/support/users/cyberchicken/)
 * (@cyberchicken)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/add-adminers-plugins/)
 * I know how to write and add plugins to the standard Adminer.
    I am able to add
   plugins to the AriAdminer, by modifing wrapper.php or by redefining function 
   adminer_object. But I don’t like this method a 100% because it needs to tamper
   the code one way or another.
 * I noticed that the loading of the code is dynamic:
 *     ```
               foreach ( glob( $plugins_path . '*.php' ) as $plugin_file ) {
                   require_once $plugin_file;
               }
       ```
   
 * but the instantiation is not:
 *     ```
               $plugins = array(
                   new AdminerDatabaseHide(
                       array( 'information_schema' )
                   ),
   
                   new AdminerDumpBz2,
       ```
   
 *  etc
 * I have a tested snippet of code that is able to detect which new classes are 
   loaded with each inlude/require.
 *     ```
       static::$loadedClasses = [];
       foreach (glob( $plugins_path.'*.php')as $plugin_file) {
       	require_once $plugin_file; // this can lead to compilation problems if the new class name is already present
       	$newDeclaredClasses = get_declared_classes();
       	$justLoadedClasses = array_diff($newDeclaredClasses, $previousDeclaredClasses);
       	foreach ($justLoadedClasses as $className) {
       		// take note of the class name or instatiate an object
       	}
       	$previousDeclaredClasses = $newDeclaredClasses;
       }
       ```
   
 * feel free to use it! (anybody)
 * BTW I’m adding “PHP Serialized Data” by Don Wilson.
    -  This topic was modified 6 years, 1 month ago by [Cyberchicken](https://wordpress.org/support/users/cyberchicken/).

The topic ‘add Adminer’s plugins’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ari-adminer_7a2e4b.svg)
 * [ARI Adminer - WordPress Database Manager](https://wordpress.org/plugins/ari-adminer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ari-adminer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ari-adminer/)
 * [Active Topics](https://wordpress.org/support/plugin/ari-adminer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ari-adminer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ari-adminer/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Cyberchicken](https://wordpress.org/support/users/cyberchicken/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/add-adminers-plugins/)
 * Status: not resolved