Skip to content

Commit

Permalink
pkp/pkp-lib#9913 Removed pimple container dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Jul 9, 2024
1 parent 7e803f9 commit fe14da3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 108 deletions.
26 changes: 22 additions & 4 deletions classes/core/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
/**
* @file classes/core/AppServiceProvider.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2003-2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class AppServiceProvider
*
* @ingroup core
*
* @brief Resolves requests for application classes such as the request handler
* to support dependency injection
*/

namespace APP\core;

use APP\services\ContextService;
use APP\services\NavigationMenuService;
use APP\services\StatsEditorialService;
use APP\services\StatsIssueService;
use APP\services\StatsPublicationService;
use PKP\core\PKPRequest;

class AppServiceProvider extends \PKP\core\AppServiceProvider
Expand All @@ -29,5 +32,20 @@ public function register()
parent::register();

$this->app->bind(Request::class, PKPRequest::class);

// Navigation Menu service
$this->app->singleton('navigationMenu', fn ($app) => new NavigationMenuService());

// Context service
$this->app->singleton('context', fn ($app) => new ContextService());

// Publication statistics service
$this->app->singleton('publicationStats', fn ($app) => new StatsPublicationService());

// Issue statistics service
$this->app->singleton('issueStats', fn ($app) => new StatsIssueService());

// Editorial statistics service
$this->app->singleton('editorialStats', fn ($app) => new StatsEditorialService());
}
}
20 changes: 5 additions & 15 deletions classes/core/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,22 @@
/**
* @file classes/core/Services.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2000-2021 John Willinsky
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2000-2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class Services
*
* @ingroup core
*
* @see Core
*
* @brief Pimple Dependency Injection Container.
*
* @deprecated 3.5.0 Consider using {@see app()->get('SERVICE_NAME')}
* @see app()->get('SERVICE_NAME')
*/

namespace APP\core;

use APP\services\OJSServiceProvider;

class Services extends \PKP\core\PKPServices
{
/**
* container initialization
*/
protected function init()
{
$this->container->register(new OJSServiceProvider());
}
}

if (!PKP_STRICT_MODE) {
Expand Down
89 changes: 0 additions & 89 deletions classes/services/OJSServiceProvider.php

This file was deleted.

0 comments on commit fe14da3

Please sign in to comment.