Questions tagged [zend-servicemanager]

30 questions
0
votes
2 answers

Logger does not log Exceptions thrown in application

I use the configuration below to create a logger: 'log' => [ 'logger' => [ 'writers' => [ 'stream' => [ 'name' => 'stream', 'priority' => \Zend\Log\Logger::INFO, 'options' => [ …
ciro
  • 771
  • 1
  • 8
  • 30
0
votes
1 answer

ZF3: ServiceNotFoundException while creating a class with Abstract Factory registered in ServiceManager

I got problem with the Abstract Factories example. I get ServiceNotFoundException while creating a class with Abstract Factory registered in the ServiceManager. First I download zend-servicemanager with composer composer require…
0
votes
2 answers

Using AbstractPluginManager with Zend Expressive 3

I'd like to inject an array of objects that implement a common interface into one of my services. I am using zend servicemanager as the DI container. I have been reading the docs for quite a bit now and it seems to me that AbstractPluginManager is…
Frank
  • 49
  • 7
0
votes
0 answers

Build new Object Instances in Zend Service Manager Component

I would like to know in best practice questions and think of easily testable classes, when I need multiple different instances of the same (fabricated) object within a specific class, which approach is recommended? Before I used the Service Manager…
0
votes
2 answers

Mock view helper in Zend Framework 3 in PHPUnit test

I want to test a specific controller action in Zend Framework 3. Because I use ZfcUser (https://github.com/ZF-Commons/ZfcUser) and Bjyauthorize (https://github.com/bjyoungblood/BjyAuthorize) I need to mock some view helpers. For example I need to…
0
votes
1 answer

is it possible to use Zend Service Manager with custom codebase?

I would like to use Zend Service Manager in my custom codebase. It is not built on Zend MVC and instead I am only using a few Zend Packages like Zend Console and Zend Config. I would like to use Zend Service Manager with a functionality, as soon as…
0
votes
1 answer

Zendframework 3 - Overwrite CSRF Validator

I try to migrate from ZF2 to ZF3 but many viewHelpers and validators do not work. But only the ones who overwrite ZendFrameworks viewhelpers / validators do not work... I want f.e. to overwrite the CSRF validator to allow a higher timeout by…
0
votes
2 answers

ZF3 Translator Remote Loader Factory Unable to resolve service

I have a problem using MVCTranslator with translations stored in the database. I configured the translations to use remote_translation, but I can not create a factory for my custom loader. My files look like this: module.config.php 'translator' =>…
0
votes
2 answers

How to access services from a view script in Zend Framework 3?

I have a custom authentication service and in ZF2 I accessed this as follows: Application/view/layout/layout.phtml $authenticationService = $this->getHelperPluginManager() ->getServiceLocator() …
0
votes
1 answer

Migrating ZF2 to ZF3: Hot to convert the "realServiceLocator"?

In the Factory classes of my Zend Framework 2 application, I often used such a construction: // The signature was actually wrong, since it was always the `AbstractPluginManager` (or the `Zend\ServiceManager\ServiceManager` for the "common" services)…
0
votes
1 answer

Factory not being loaded in ZF2 - Missing argument 1

I have a factory within Module/src/Module/Service/Factory/CourseServiceFactory.php I have defined this factory in module.config.php as follows: 'service_manager' => array( 'factories' => array( 'CourseServiceFactory' =>…
0
votes
2 answers

zf2 - getting controller plugins in form/controller factory

Is it possible to access controller plugins from a form/controller factory (any factory implementing FactoryInterface)? I have a form factory that i want to set the form action depending on the request parameter, but need to access the url from the…
John Crest
  • 201
  • 1
  • 4
  • 24
0
votes
1 answer

Am I configuring my error handler and exception manager for Zend-Log correctly?

I have a ZF 3 application. Messages I explicitly log with e.g $log->debug() Show up just fine. Exceptions don't. Errors seem to show up because that's the default php config to go to stderr. Here is the relevant lines from…
Justin Dearing
  • 14,270
  • 22
  • 88
  • 161
0
votes
1 answer

Getting "ServiceNotFoundException" when routing from "In-Depth" tutorial

I've made all Zend Framework 2 tutorials stopping in "routing", exactly this: https://docs.zendframework.com/tutorials/in-depth-guide/understanding-routing/ My problem is I've made everything in my code as suggested but I'm facing this error when I…
RPichioli
  • 3,245
  • 2
  • 25
  • 29
0
votes
2 answers

How can I use getServiceLocator() to get an adapter in a Model?

I am learning ZF2. Can I use getServiceLocator() to get a adapter in a Model? /config/autoload/global.php return array( 'db' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=zf2tutorial;host=localhost', …
1
2