Skip to content

Fatal error: Uncaught Error: Class "AdminerPlugin" not found #1056

@aug70

Description

@aug70

5.2.1 (upgraded from 5.1.0) please use latest published or Git
SQLite alpine/sqlite:3.45.3
See below for plugins

    index.php: |-
        <?php
        function adminer_object() {
            // Required to run any plugin.
            include_once(__DIR__ . "/plugins/plugin.php");

            // Load plugins.
            foreach (glob(__DIR__ . "/plugins/*.php") as $file) {
                include_once($file);
            }

            $plugins = [
                new AdminerLoginSqlite()
            ];

            return new AdminerPlugin($plugins);
        }

        // Include original Adminer or Adminer Editor.
        include "./adminer.php";
    login-sqlite.php: |-
        <?php
        # Place in `plugins/`

        /** Enable auto-login for SQLite
        * @link https://www.adminer.org/plugins/#use
        * @author Jakub Vrana, https://www.vrana.cz/
        * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
        * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
        */
        class AdminerLoginSqlite {

            function login($login, $password) {
                return true;
            }

            function loginForm() {
                ?>
        <script <?php echo nonce()?> type="text/javascript">
        addEventListener('load', function () {
            var driver = document.getElementsByName('auth[driver]')[0];
            if (isTag(driver, 'select')) {
                driver.onchange = function () {
                    var trs = parentTag(driver, 'table').rows;
                    for (var i=1; i < trs.length - 1; i++) {
                        var disabled = /sqlite/.test(driver.value);
                        alterClass(trs[i], 'hidden', disabled);
                        trs[i].getElementsByTagName('input')[0].disabled = disabled;
                    }
                };
            }
            driver.onchange();
        });
        </script>
        <?php
            }

        }

After upgrading to 5.2.1 from 5.1.0 I'm getting the below error.
The above config map was working fine in 5.1.0.

Warning: include_once(/var/www/html/plugins/plugin.php): Failed to open stream: No such file or directory in /var/www/html/index.php on line 4

Warning: include_once(): Failed opening '/var/www/html/plugins/plugin.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/index.php on line 4

Fatal error: Uncaught Error: Class "AdminerPlugin" not found in /var/www/html/index.php:15 Stack trace: #0 /var/www/html/adminer.php(1151): adminer_object() #1 /var/www/html/index.php(19): include('/var/www/html/a...') #2 {main} thrown in /var/www/html/index.php on line 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions