Always check $e->getPrevious() on exceptions.
The skeleton application already handles that in the error view.
Otherwise, use a try-catch block like that
try {
// buggy block
} catch (\Exception $e) {
do {
echo $e->getMessage();
} while ($e = $e->getPrevious);
}
Marco Pivetta
http://twitter.com/Ocramius
http://marco-pivetta.com
On 21 September 2012 01:43, poashoas <[email protected]> wrote:
> File:
> C:\Program
>
> Files\Zend\Apache2\htdocs\vendor\ZF2\library\Zend\ServiceManager\ServiceManager.php:843
>
> Message:
> An abstract factory could not create an instance of
> logineventauthentication(alias: Login\Event\Authentication).
>
>
> ------------------------------------------------------------------------------------------------------
>
> *Module.php*
>
> namespace Login;
>
> use Zend\ModuleManager\Feature\AutoloaderProviderInterface,
> Zend\EventManager\StaticEventManager;
>
> class Module implements AutoloaderProviderInterface
> {
> public function init()
> {
> $events = StaticEventManager::getInstance();
> $events->attach('Zend\Mvc\Controller\AbstractActionController',
> 'dispatch', array($this, 'loadConfiguration'), 100);
> }
>
> public function getConfig()
> {
> return include __DIR__ . '/config/module.config.php';
> }
>
> public function getAutoloaderConfig()
> {
> return array(
> 'Zend\Loader\ClassMapAutoloader' => array(
> __DIR__ . '/autoload_classmap.php'
> ),
> 'Zend\Loader\StandardAutoloader' => array(
> 'namespaces' => array(
> __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
> ),
> ),
> );
> }
>
> public function loadConfiguration($event)
> {
> $di = $event->getTarget()->getServiceLocator();
> $auth = $di->get('Login\Event\Authentication');
> return $auth->preDispatch($event);
> }
> }
>
> <
> http://zend-framework-community.634137.n4.nabble.com/file/n4656989/Untitled-2.jpg
> >
>
> *I am a big idiot with this stuff, can anyone help me rewriting this stuff
> below??????*
> I already checked the namespaces, my debugger tells me the instance
> logineventauthentication doesn't appear in the list of instances
>
> <?php
> return array(
> 'di' => array(
> 'allowed_controllers' => array(
> 'Login\Controller\FormController'
> ),
> 'instance' => array(
> 'alias' => array(
> 'login' => 'Login\Controller\FormController'
> ),
> 'login' => array(
> 'parameters' => array(
> 'broker' => 'Zend\Mvc\Controller\PluginBroker'
> )
> ),
> 'Login\Event\Authentication' => array(
> 'parameters' => array(
> 'userAuthenticationPlugin' =>
> 'Login\Controller\Plugin\UserAuthentication',
> 'aclClass' => 'Login\Acl\Acl'
> )
> ),
> 'Login\Acl\Acl' => array(
> 'parameters' => array(
> 'config' => include __DIR__ . '/acl.config.php'
> )
> ),
> 'Login\Controller\Plugin\UserAuthentication' => array(
> 'parameters' => array(
> 'authAdapter' => 'Zend\Authentication\Adapter\DbTable'
> )
> ),
> 'Zend\Authentication\Adapter\DbTable' => array(
> 'parameters' => array(
> 'zendDb' => 'Zend\Db\Adapter\Adapter',
> 'tableName' => 'users',
> 'identityColumn' => 'email',
> 'credentialColumn' => 'password',
> 'credentialTreatment' => 'SHA1(CONCAT(?, "secretKey"))'
> )
> ),
> 'Zend\Db\Adapter\Adapter' => array(
> 'parameters' => array(
> 'driver' => 'pdo',
> 'dsn' => 'mysql:dbname=mydatabase;host=localhost',
> 'database' => 'mydatabase',
> 'username' => 'root',
> 'password' => '',
> 'hostname' => 'localhost',
> )
> ),
>
> 'Zend\Mvc\Controller\PluginLoader' => array(
> 'parameters' => array(
> 'map' => array(
> 'userAuthentication' =>
> 'Login\Controller\Plugin\UserAuthentication'
> )
> )
> ),
> 'Zend\View\PhpRenderer' => array(
> 'parameters' => array(
> 'options' => array(
> 'script_paths' => array(
> 'user' => __DIR__ . '/../views'
> )
> )
> )
> )
> )
> ),
> 'router' => array(
> 'routes' => array(
> 'login' => array(
> 'type' => 'Zend\Mvc\Router\Http\Literal',
> 'options' => array(
> 'route' => '/login',
> 'defaults' => array(
> 'controller' => 'Login\Controller\Form',
> 'action' => 'index',
> ),
> ),
> ),
> )),
> );
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Dependincy-Injector-can-t-find-instance-tp4656989.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>