Announcement

Collapse
No announcement yet.

How to create object of Custom Manager/Loader when the application starts?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create object of Custom Manager/Loader when the application starts?

    tanya

    ​​​​​​​I am trying to integrate with Sentry and it requires me register in the \Espo\Core\Application constructor. Now i can add it in Container as a loader, but without $this->getContainer()->get('MyCustomManager') this manager won't load.

    So, my question here is, is there a way to load managers when the application kicks off or when index.php of application is called
    Last edited by theBuzzyCoder; 01-28-2019, 07:54 AM.

  • #2
    Hi,

    I found the solution!

    I can create the autoload.json file in this paths which will be loaded upon calling espocrm/index.php

    application/Espo/Resources/autoload.json
    application/Espo/Modules/{*}/Resources/autoload.json
    custom/Espo/Custom/Resources/autoload.json

    Code:
    {
         "ManagerName": "path from espocrm folder"
    }

    Comment

    Working...
    X