Skip to content

Commit

Permalink
Fix issue with constructing PackageRepository, update api domain to c…
Browse files Browse the repository at this point in the history
…urrent stage
  • Loading branch information
KorvinSzanto committed Apr 29, 2024
1 parent 9eb9d8e commit f74b198
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion concrete/config/concrete.php
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@
'concrete' => 'http://marketplace.concretecms.com',
'concrete_secure' => 'https://marketplace.concretecms.com',
'concrete_community' => 'https://community.concretecms.com',
'package_repository' => 'http://dl.concretecms.com.test',
'package_repository' => 'https://dl.market.stage.concretecms.com',
'marketplace' => 'http://depot.concretecms.com.test',
'background_feed' => 'https://backgroundimages.concretecms.com/wallpaper',
'privacy_policy' => '//www.concretecms.com/about/legal/privacy-policy',
Expand Down
19 changes: 12 additions & 7 deletions concrete/src/Marketplace/MarketplaceServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Concrete\Core\Config\Repository\Repository;
use Concrete\Core\Foundation\Service\Provider;
use Concrete\Core\Site\Service;
use GuzzleHttp\Client;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
Expand All @@ -15,13 +17,16 @@ public function register()
$this->app->bind(PackageRepositoryInterface::class, PackageRepository::class);
$this->app->bind(PackageRepository::class, function(): PackageRepository {
$config = $this->app->make(Repository::class);
return $this->app->make(PackageRepository::class, [
'serializer' => new Serializer([new ObjectNormalizer()], [new JsonEncoder()]),
'config' => $config,
'databaseConfig' => $this->app->make('config/database'),
'baseUri' => $config->get('concrete.urls.package_repository'),
'paths' => $config->get('concrete.urls.paths.package_repository'),
]);

return new PackageRepository(
$this->app->make(Client::class),
new Serializer([new ObjectNormalizer()], [new JsonEncoder()]),
$config,
$this->app->make('config/database'),
$this->app->make(Service::class),
$config->get('concrete.urls.package_repository'),
$config->get('concrete.urls.paths.package_repository')
);
});
}
}

0 comments on commit f74b198

Please sign in to comment.