Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-143

Mismatch in configuration classes, can't enable logging

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.0.0BETA3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      My bootstrap:

       
              $config = new Doctrine\ODM\MongoDB\Configuration();
              $config->setProxyDir(APPLICATION_PATH . '/../data/cache');
              $config->setProxyNamespace('Proxies');
              $config->setDefaultDB([skip]);
      
              $config->setHydratorDir(APPLICATION_PATH . '/../data/cache');
              $config->setHydratorNamespace('Hydrators');
      
              $config->setLoggerCallable(function(array $log) { print_r($log); });
      
              $reader = new \Doctrine\Common\Annotations\AnnotationReader();
              $reader->setDefaultAnnotationNamespace('Doctrine\ODM\MongoDB\Mapping\\');
              $config->setMetadataDriverImpl(
                  new \Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver($reader, __DIR__ . '/Documents')
              );
      
              $manager = \Doctrine\ODM\MongoDB\DocumentManager::create(
                  new \Doctrine\MongoDB\Connection(),
                  $config
              );
      

      And nothing happens

      Trace from Doctrine\MongoDB\Configuration::getLoggerCallable():

      #0 [skip]/Doctrine/MongoDB/Connection.php(248): Doctrine\MongoDB\Configuration->getLoggerCallable()
      #1 [skip]/Doctrine/MongoDB/Connection.php(231): Doctrine\MongoDB\Connection->wrapDatabase(Object(MongoDB))
      #2 [skip]/Doctrine/ODM/MongoDB/DocumentManager.php(287): Doctrine\MongoDB\Connection->selectDatabase([skip])
      #3 [skip]/Doctrine/ODM/MongoDB/DocumentManager.php(316): Doctrine\ODM\MongoDB\DocumentManager->getDocumentDatabase('BPM\User')
      #4 [skip]/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php(148): Doctrine\ODM\MongoDB\DocumentManager->getDocumentCollection('BPM\User')
      #5 [skip]/Doctrine/ODM/MongoDB/UnitOfWork.php(319): Doctrine\ODM\MongoDB\Persisters\DocumentPersister->__construct(Object(Doctrine\ODM\MongoDB\Persisters\PersistenceBuilder), Object(Doctrine\ODM\MongoDB\DocumentManager), Object(Doctrine\Common\EventManager), Object(Doctrine\ODM\MongoDB\UnitOfWork), Object(Doctrine\ODM\MongoDB\Hydrator\HydratorFactory), Object(Doctrine\ODM\MongoDB\Mapping\ClassMetadata), '$')
      #6 [skip]/Doctrine/ODM/MongoDB/DocumentRepository.php(115): Doctrine\ODM\MongoDB\UnitOfWork->getDocumentPersister('BPM\User')
      #7 [skip]application/library/BPM/UserData.php(43): Doctrine\ODM\MongoDB\DocumentRepository->find('4dc9d0192d91365...')
      [skip]
      

      get_class($this) from Doctrine\MongoDB\Configuration::setLoggerCallable() write 'Doctrine\ODM\MongoDB\Configuration' like expected, but in getLoggerCallable() write 'Doctrine\MongoDB\Configuration'

      Do you have any ideas about this behaviour?

        Activity

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Stanislav Korchagin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: