pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
297 stars 442 forks source link

Replace pimple with laravel's dependency injection container #9913

Open touhidurabir opened 2 months ago

touhidurabir commented 2 months ago

Describe the proposal There are some implementations in the codebase that use the Pimple for the purpose of dependency injection. This package is a part of micro framework Silex which as been deprecated quite some times ago. Also as we have laravel's own dependency injection container, it's better to use that as we are adopting more from laravel's toolset .

What application are you using? OJS, OMP or OPS version main (3.5.0 pre release)

Additional information Only few classes are using it such as

  1. PKP\core\PKPServices
  2. APP\core\Services
  3. APP\services\OJSServiceProvider
  4. APP\services\OMPServiceProvider
  5. APP\services\OPSServiceProvider

Probably a good approach is to utilize the app or shared lib(pkp-lib) specific AppServiceProvider to put the functionalities there .

PRs pkp-lib --> https://github.com/pkp/pkp-lib/pull/10177 ojs --> https://github.com/pkp/ojs/pull/4358

jonasraoni commented 2 months ago

I think this can be closed as a duplicate of https://github.com/pkp/pkp-lib/issues/7131

touhidurabir commented 6 hours ago

@asmecher can you check the PRs at https://github.com/pkp/pkp-lib/issues/9913#issue-2263387287. This simple PRs centralize all services to use the laravel container and remove pimple container . If all ok, I plan to remove all reference of Services::get with app()->get() and port it to OMP and OPS .