You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me first say a thank you for forking the original BjyAuthorize and modifying it for Laminas. I'm currently in the middle of an application migration from ZF2 to Laminas and am trying to setup BjyAuthorize. I'm getting errors with the cache service named "memory". I've tried to set it up for memcahce, but am obviously missing something. Could you please post an example of how to configure the service factory with cache (memcache preferrable)?
Also, I noticed the Module Dependencies message that Laminas\Cache module needed to be loaded before the BjyAuthorize module. That was a nice addition. I re-ordered by modules list in my application config to correct that. Thanks.
Here's what I've done so far for the cache.
FIrst, I changed the config option "name" from "memory" to something more meaningful to me.
`<?php
// cache options have to be compatible with Laminas\Cache\StorageAdapterFactoryInterface::create
'cache_options' => [
'adapter' => [
'name' => 'BjyauthorizeMemcache',
],
'plugins' => [
[
'name'=> 'serializer',
],
],
],
`
Then I went ahead and added a service_manager factories entry.
Then I created a Factory class file in /MyApp/src/MyApp/Factory/BjyauthorizeMemcacheFactory.php. MyApp was used/changed for this post.
`<?php
namespace MyApp\Factory;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\Cache\Service\StorageAdapterFactoryInterface;
use Laminas\Cache\Service\StoragePluginFactoryInterface;
use Psr\Container\ContainerInterface;
class BjyauthorizeMemcacheFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): mixed {
But, then I noticed you have a BjyAuthorize\Service\CacheFactory class available. I should probably be using that Factory class to create the cache object. I see there's similar code to what I was trying to do. Any advice would be appreciated. So, I tried to use BjyAuthorize\Service\CacheFactory, but I got the same resolve service error.
Thank you,
Jeff
The text was updated successfully, but these errors were encountered:
I figured it out last night. I was indeed trying to make it more complicated than necessary. I just needed to add a few modules into my composer.json. I had the base laminas/laminas-cache, but none of the adapters. Added and ran a composer update.
Hi Guru,
Let me first say a thank you for forking the original BjyAuthorize and modifying it for Laminas. I'm currently in the middle of an application migration from ZF2 to Laminas and am trying to setup BjyAuthorize. I'm getting errors with the cache service named "memory". I've tried to set it up for memcahce, but am obviously missing something. Could you please post an example of how to configure the service factory with cache (memcache preferrable)?
Also, I noticed the Module Dependencies message that Laminas\Cache module needed to be loaded before the BjyAuthorize module. That was a nice addition. I re-ordered by modules list in my application config to correct that. Thanks.
Here's what I've done so far for the cache.
FIrst, I changed the config option "name" from "memory" to something more meaningful to me.
`<?php
`
Then I went ahead and added a service_manager factories entry.
'BjyauthorizeMemcache' => \MyApp\Factory\BjyauthorizeMemcacheFactory::class,
Then I created a Factory class file in /MyApp/src/MyApp/Factory/BjyauthorizeMemcacheFactory.php. MyApp was used/changed for this post.
`<?php
namespace MyApp\Factory;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\Cache\Service\StorageAdapterFactoryInterface;
use Laminas\Cache\Service\StoragePluginFactoryInterface;
use Psr\Container\ContainerInterface;
class BjyauthorizeMemcacheFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): mixed {
}
`
But, then I noticed you have a BjyAuthorize\Service\CacheFactory class available. I should probably be using that Factory class to create the cache object. I see there's similar code to what I was trying to do. Any advice would be appreciated. So, I tried to use BjyAuthorize\Service\CacheFactory, but I got the same resolve service error.
Thank you,
Jeff
The text was updated successfully, but these errors were encountered: