Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7929849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:13:25+00:00 2026-06-03T20:13:25+00:00

Zend Framework 2 + Doctrine 2 Refering to this question, I have a simple

  • 0

Zend Framework 2 + Doctrine 2

Refering to this question, I have a simple question about the installation process.

Since I’m using Zend Server CE on a Windows 8 machine, and I don’t have a GitHub account, I had to manually download DoctrineModule and DoctrineORM Module to the vendor folder. My question is, do I also need to download Doctrine library and cd it to the vendor folder?

*EDIT

I installed through GIT, I get this error in my php_error.log

[13-May-2012 01:37:22] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class Doctrine\ORM\Mapping\Driver\AnnotationDriver does not exist' in C:\Zend\Apache2\htdocs\zf2\vendor\DoctrineORMModule\Module.php:71
Stack trace:
#0 C:\Zend\Apache2\htdocs\zf2\vendor\DoctrineORMModule\Module.php(71): ReflectionClass->__construct('Doctrine\ORM\Ma...')
#1 [internal function]: DoctrineORMModule\Module->registerAnnotations(Object(Zend\Module\ModuleEvent))
#2 C:\Zend\Apache2\htdocs\zf2\vendor\ZendFramework\library\Zend\EventManager\EventManager.php(463): call_user_func(Array, Object(Zend\Module\ModuleEvent))
#3 C:\Zend\Apache2\htdocs\zf2\vendor\ZendFramework\library\Zend\EventManager\EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('loadModules.pos...', Object(Zend\Module\ModuleEvent), NULL)
#4 C:\Zend\Apache2\htdocs\zf2\vendor\ZendFramework\library\Zend\Module\Manager.php(87): Zend\EventManager\EventManager->trigger('loadModules.pos...', Object(Zend\Module\Manager), Object(Zend\Module\ModuleEvent))
#5 C:\Zend\Apache2 in C:\Zend\Apache2\htdocs\zf2\vendor\DoctrineORMModule\Module.php on line 71

Here’s Module.php

<?php
/*
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many individuals
 * and is licensed under the LGPL. For more information, see
 * <http://www.doctrine-project.org>.
 */

namespace DoctrineORMModule;

use RuntimeException;
use ReflectionClass;
use Zend\EventManager\Event;
use Zend\Module\Consumer\AutoloaderProvider;
use Zend\Module\Manager;
use Zend\Module\ModuleEvent;
use Zend\Loader\StandardAutoloader;
use Doctrine\Common\Annotations\AnnotationRegistry;

/**
 * Base module for Doctrine ORM.
 *
 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @link    www.doctrine-project.org
 * @since   1.0
 * @version $Revision$
 * @author  Kyle Spraggs <theman@spiffyjr.me>
 * @author  Marco Pivetta <ocramius@gmail.com>
 */
class Module implements AutoloaderProvider
{
    /**
     * @param Manager $moduleManager
     */
    public function init(Manager $moduleManager)
    {
        $moduleManager->events()->attach('loadModules.post', array($this, 'registerAnnotations'));
    }

    /**
     * Registers annotations required for the Doctrine AnnotationReader
     *
     * @param  ModuleEvent $e
     * @throws RuntimeException
     */
    public function registerAnnotations(ModuleEvent $e)
    {
        $config = $e->getConfigListener()->getMergedConfig();
        $config = $config['doctrine_orm_module'];

        if ($config->use_annotations) {
            $annotationsFile = false;

            if (isset($config->annotation_file)) {
                $annotationsFile = realpath($config->annotation_file);
            }

            if (!$annotationsFile) {
                // Trying to load DoctrineAnnotations.php without knowing its location
                $annotationReflection = new ReflectionClass('Doctrine\ORM\Mapping\Driver\AnnotationDriver');
                $annotationsFile = realpath(dirname($annotationReflection->getFileName()) . '/DoctrineAnnotations.php');
            }

            if (!$annotationsFile) {
                throw new RuntimeException('Failed to load annotation mappings, check the "annotation_file" setting');
            }

            AnnotationRegistry::registerFile($annotationsFile);
        }

        if (!class_exists('Doctrine\ORM\Mapping\Entity', true)) {
            throw new RuntimeException('Doctrine could not be autoloaded: ensure it is in the correct path.');
        }
    }

    /**
     * Retrieves configuration that can be consumed by Zend\Loader\AutoloaderFactory
     *
     * @return array
     */
    public function getAutoloaderConfig()
    {
        if (realpath(__DIR__ . '/vendor/doctrine-orm/lib')) {
            return array(
                'Zend\Loader\StandardAutoloader' => array(
                    StandardAutoloader::LOAD_NS => array(
                        __NAMESPACE__                   => __DIR__ . '/src/' . __NAMESPACE__,
                        __NAMESPACE__ . 'Test'          => __DIR__ . '/tests/' . __NAMESPACE__ . 'Test',
                    ),
                ),
            );
        }

        return array();
    }

    /**
     * @return array
     */
    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:13:26+00:00Added an answer on June 3, 2026 at 8:13 pm

    When you installed from git, did you also update the submodules? If not, cd into the DoctrineORMModule directory and use this command:

    git submodule update --init

    By the way, composer install is the recomended method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several question about integrating integrating Doctrine 2.2 & Zend framework. I know
I am using Doctrine 2 and Zend Framework 1.11. I have set up my
I'm using Doctrine 1.2 as my ORM for a Zend Framework Project. I have
Using doctrine 2.1 (and zend framework 1.11, not that it matters for this matter),
I've been working with Zend Framework (using Doctrine as the ORM) for quite a
When creating an association using Doctrine 2 and the Zend Framework, if the associated
I'm using Zend Framework with Doctrine. I'm creating an object, editing, then saving it.
I'm using Doctrine with Zend Framework. For my model, I'm using a base class,
I've a question related to Doctrine 2 and Zend Framework. If you use Zend
I'm using Doctrine 2 in a Zend Framework application and require functionality similar to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.