Skip to content

Custom plugin classes are not loaded before config/cms.php is executed #1282

@goldmont

Description

@goldmont

Winter CMS Build

1.2

PHP Version

8.1

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

Hi,

In my Goldmont.System plugin, there's a class named Docker which I use to read Docker secrets and to set the values into the project config. Today, I needed to read AWS S3 credentials in order to setup a new resource storage in cms.php. However, for some reason, the Docker class is not loaded by the autoloader yet. Furthermore, this problem exists only in cms.php file. The Docker class is properly loaded when I use it in filesystems.php file. What's going on? Isn't the autoloader run before everything?

Plugin structure:
. <-- Goldmont.System
├── helpers <-- LOWER CASE
│   ├── Docker.php <-- NAMESPACE: Goldmont\System\Helpers

Error:
Class "Goldmont\System\Helpers\Docker" not found

Steps to replicate

Workaround

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions