Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-367

Reverse engnering do not work with Oracle DB

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.5
    • Component/s: Drivers, Schema Managers
    • Environment:

      Description

      $ doctrine orm:convert-mapping --filter="ms$ions" xml .
      
        [Doctrine\DBAL\DBALException]
        Unknown database type binary_float requested, Doctrine\DBAL\Platforms\OraclePlatform may not support it.
      

      cli-config.php:

      
      use Doctrine\Common\Annotations\AnnotationReader;
      use Doctrine\Common\Annotations\AnnotationRegistry;
      
      require_once 'Doctrine/Common/ClassLoader.php';
      
      define('APPLICATION_ENV', "development");
      error_reporting(E_ALL);
      
      $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
      $classLoader->register();
      
      $config = new \Doctrine\ORM\Configuration();
      $config->setProxyDir(__DIR__);
      $config->setProxyNamespace('Proxies');
      
      $config->setAutoGenerateProxyClasses((APPLICATION_ENV == "development"));
      
      AnnotationRegistry::registerFile("Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
      $reader = new AnnotationReader();
      $driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array(__DIR__ . "/../php/ru/niifhm/bioinformatics/biodb/model"));
      $config->setMetadataDriverImpl($driverImpl);
      
      if (APPLICATION_ENV == "development") {
          $cache = new \Doctrine\Common\Cache\ArrayCache();
      } else {
          $cache = new \Doctrine\Common\Cache\ApcCache();
      }
      
      $config->setMetadataCacheImpl($cache);
      $config->setQueryCacheImpl($cache);
      
      $connectionOptions = array(
          'driver'   => 'oci8',
          'host'     => 'host.name',
          'dbname'   => 'db.name',
          'user'     => 'user.name',
          'password' => 'user.password'
      );
      
      $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
      $platform = $em->getConnection()->getDatabasePlatform();
      $platform->registerDoctrineTypeMapping('enum', 'string');
      
      $em->getConfiguration()->setMetadataDriverImpl(
          new \Doctrine\ORM\Mapping\Driver\DatabaseDriver(
              $em->getConnection()->getSchemaManager()
          )
      );
      
      $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
          'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
          'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
      ));
      

        Activity

        Zelenin Alexandr created issue -
        Zelenin Alexandr made changes -
        Field Original Value New Value
        Environment PHP 5.3.3-1ubuntu9.10 with Suhosin-Patch (cli) (built: Feb 11 2012 06:21:15)
        oci8-1.4.7 as PHP extension builded from pecl repository with instantclient-basic-linux.x64-11.2.0.3.0.zip and instantclient-sdk-linux.x64-11.2.0.3.0.zip
        PHP 5.3.3-1ubuntu9.10 with Suhosin-Patch (cli) (built: Feb 11 2012 06:21:15)
        oci8-1.4.7 as PHP extension builded from pecl repository with instantclient-basic-linux.x64-11.2.0.3.0.zip and instantclient-sdk-linux.x64-11.2.0.3.0.zip
        Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
        Zelenin Alexandr made changes -
        Labels Cli oracle schematool
        Marco Pivetta made changes -
        Description $ doctrine orm:convert-mapping --filter="ms$ions" xml .

          [Doctrine\DBAL\DBALException]
          Unknown database type binary_float requested, Doctrine\DBAL\Platforms\OraclePlatform may not support it.

        $ ls
        cli-config.php
        $ cat cli-config.php
        <?php

        use Doctrine\Common\Annotations\AnnotationReader;
        use Doctrine\Common\Annotations\AnnotationRegistry;

        require_once 'Doctrine/Common/ClassLoader.php';

        define('APPLICATION_ENV', "development");
        error_reporting(E_ALL);

        $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
        $classLoader->register();

        $config = new \Doctrine\ORM\Configuration();
        $config->setProxyDir(__DIR__);
        $config->setProxyNamespace('Proxies');

        $config->setAutoGenerateProxyClasses((APPLICATION_ENV == "development"));

        AnnotationRegistry::registerFile("Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
        $reader = new AnnotationReader();
        $driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array(__DIR__ . "/../php/ru/niifhm/bioinformatics/biodb/model"));
        $config->setMetadataDriverImpl($driverImpl);

        if (APPLICATION_ENV == "development") {
            $cache = new \Doctrine\Common\Cache\ArrayCache();
        } else {
            $cache = new \Doctrine\Common\Cache\ApcCache();
        }

        $config->setMetadataCacheImpl($cache);
        $config->setQueryCacheImpl($cache);

        $connectionOptions = array(
            'driver' => 'oci8',
            'host' => 'host.name',
            'dbname' => 'db.name',
            'user' => 'user.name',
            'password' => 'user.password'
        );

        $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
        $platform = $em->getConnection()->getDatabasePlatform();
        $platform->registerDoctrineTypeMapping('enum', 'string');

        $em->getConfiguration()->setMetadataDriverImpl(
            new \Doctrine\ORM\Mapping\Driver\DatabaseDriver(
                $em->getConnection()->getSchemaManager()
            )
        );

        $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
            'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
            'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
        ));
        {code}
        $ doctrine orm:convert-mapping --filter="ms$ions" xml .

          [Doctrine\DBAL\DBALException]
          Unknown database type binary_float requested, Doctrine\DBAL\Platforms\OraclePlatform may not support it.
        {code}

        cli-config.php:

        {code}

        use Doctrine\Common\Annotations\AnnotationReader;
        use Doctrine\Common\Annotations\AnnotationRegistry;

        require_once 'Doctrine/Common/ClassLoader.php';

        define('APPLICATION_ENV', "development");
        error_reporting(E_ALL);

        $classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
        $classLoader->register();

        $config = new \Doctrine\ORM\Configuration();
        $config->setProxyDir(__DIR__);
        $config->setProxyNamespace('Proxies');

        $config->setAutoGenerateProxyClasses((APPLICATION_ENV == "development"));

        AnnotationRegistry::registerFile("Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
        $reader = new AnnotationReader();
        $driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array(__DIR__ . "/../php/ru/niifhm/bioinformatics/biodb/model"));
        $config->setMetadataDriverImpl($driverImpl);

        if (APPLICATION_ENV == "development") {
            $cache = new \Doctrine\Common\Cache\ArrayCache();
        } else {
            $cache = new \Doctrine\Common\Cache\ApcCache();
        }

        $config->setMetadataCacheImpl($cache);
        $config->setQueryCacheImpl($cache);

        $connectionOptions = array(
            'driver' => 'oci8',
            'host' => 'host.name',
            'dbname' => 'db.name',
            'user' => 'user.name',
            'password' => 'user.password'
        );

        $em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
        $platform = $em->getConnection()->getDatabasePlatform();
        $platform->registerDoctrineTypeMapping('enum', 'string');

        $em->getConfiguration()->setMetadataDriverImpl(
            new \Doctrine\ORM\Mapping\Driver\DatabaseDriver(
                $em->getConnection()->getSchemaManager()
            )
        );

        $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
            'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
            'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
        ));
        {code}
        Steve Müller made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.5 [ 10523 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Zelenin Alexandr
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: