Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2486

Getting started does not work with current release

    Details

    • Type: Documentation Documentation
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4.1
    • Fix Version/s: 2.4
    • Component/s: ORM
    • Security Level: All
    • Labels:
    • Environment:
      Ubuntu 12.04

      Description

      The tutorial states: "This tutorial assumes you work with Doctrine 2.3 and above. Some of the code will not work with lower versions."

      I'm using 2.3.4

      When running "php vendor/bin/doctrine orm:schema-tool:create"

      this happens:

      PHP Fatal error: Call to undefined method Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet() in /var/www/project/cli-config.php on line 5
      PHP Stack trace:
      PHP 1.

      {main}() /var/www/project/vendor/doctrine/orm/bin/doctrine:0
      PHP 2. include() /var/www/project/vendor/doctrine/orm/bin/doctrine:4
      PHP 3. require() /var/www/project/vendor/doctrine/orm/bin/doctrine.php:31

      Fatal error: Call to undefined method Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet() in /var/www/project/cli-config.php on line 5

      Call Stack:
      0.0001 619840 1. {main}

      () /var/www/project/vendor/doctrine/orm/bin/doctrine:0
      0.0003 632072 2. include('/var/www/project/vendor/doctrine/orm/bin/doctrine.php') /var/www/project/vendor/doctrine/orm/bin/doctrine:4
      0.0012 730208 3. require('/var/www/project/cli-config.php') /var/www/project/vendor/doctrine/orm/bin/doctrine.php:31

      This is because some commits are not yet in the release. The current GIT version probably works but is not an option for me.

        Activity

        Hide
        Vishal Bandre added a comment -

        Will you please share/paste full error message here?

        Check for missing db password, etc.

        Show
        Vishal Bandre added a comment - Will you please share/paste full error message here? Check for missing db password, etc.
        Hide
        Igor Timoshenkov added a comment -

        Hi, guys.

        Igor Timoshenkov's question was solved at http://stackoverflow.com/q/22336256/347063

        My question is not solved.

        If you are using sqlite the conn parameters to be used are user, password, path, memory as described on http://docs.doctrine-project.org/projects/doctrine-dbal/en/2.0.x/reference/configuration.html but your connection array is showing wrong settings (these are MYSQL specific). Please check required db driver and try again.

        I have corrected the configuration parameters - I needed pdo_mysql, not pdo_sqlite. But the php vendor/bin/doctrine orm:schema-tool:create is still not working. Any ideas what else could that be?

        BTW, the link to the configuration should be added to the Tutorial.

        Show
        Igor Timoshenkov added a comment - Hi, guys. Igor Timoshenkov's question was solved at http://stackoverflow.com/q/22336256/347063 My question is not solved. If you are using sqlite the conn parameters to be used are user, password, path, memory as described on http://docs.doctrine-project.org/projects/doctrine-dbal/en/2.0.x/reference/configuration.html but your connection array is showing wrong settings (these are MYSQL specific). Please check required db driver and try again. I have corrected the configuration parameters - I needed pdo_mysql , not pdo_sqlite . But the php vendor/bin/doctrine orm:schema-tool:create is still not working. Any ideas what else could that be? BTW, the link to the configuration should be added to the Tutorial .
        Hide
        Marco Pivetta added a comment - - edited

        Igor Timoshenkov's question was solved at http://stackoverflow.com/q/22336256/347063

        Basically, his vendor/bin/doctrine was broken, but running php vendor/doctrine/orm/bin/doctrine worked fine.

        Show
        Marco Pivetta added a comment - - edited Igor Timoshenkov 's question was solved at http://stackoverflow.com/q/22336256/347063 Basically, his vendor/bin/doctrine was broken, but running php vendor/doctrine/orm/bin/doctrine worked fine.
        Hide
        Vishal Bandre added a comment -

        Which db driver are you using?

        If you are using sqlite the conn parameters to be used are user, password, path, memory as described on http://docs.doctrine-project.org/projects/doctrine-dbal/en/2.0.x/reference/configuration.html but your connection array is showing wrong settings (these are MYSQL specific). Please check required db driver and try again.

        Show
        Vishal Bandre added a comment - Which db driver are you using? If you are using sqlite the conn parameters to be used are user, password, path, memory as described on http://docs.doctrine-project.org/projects/doctrine-dbal/en/2.0.x/reference/configuration.html but your connection array is showing wrong settings (these are MYSQL specific). Please check required db driver and try again.
        Hide
        Igor Timoshenkov added a comment -

        Hello, everyone.

        I am trying to follow the Tutorial, but I am stuck with the cli generation. Here is my cli-config.php file:

        <?php
        use Doctrine\ORM\EntityManager;
        use Doctrine\ORM\Tools\Console\ConsoleRunner;
        use Doctrine\ORM\Tools\Setup;

        require_once "vendor/autoload.php";

        $modelsPath = realpath(_DIR_.'/../model');
        $config = Setup::createAnnotationMetadataConfiguration(array($modelsPath), true);

        // database configuration parameters
        $conn = array(
        'driver' => 'pdo_sqlite',
        'host' => 'localhost',
        'user' => 'root',
        'password' => '',
        'dbname' => 'someDb',
        );

        return ConsoleRunner::createHelperSet(EntityManager::create($conn, $config));

        Now, when I run

        php vendor/bin/doctrine orm:schema-tool:create
        or
        php vendor/bin/doctrine orm:schema-tool:drop

        I get Access denied. What am I doing wrong?

        P.S. I am not using Symfony, Doctrine version is 2.4.1.

        Show
        Igor Timoshenkov added a comment - Hello, everyone. I am trying to follow the Tutorial , but I am stuck with the cli generation. Here is my cli-config.php file: <?php use Doctrine\ORM\EntityManager; use Doctrine\ORM\Tools\Console\ConsoleRunner; use Doctrine\ORM\Tools\Setup; require_once "vendor/autoload.php"; $modelsPath = realpath(_ DIR _.'/../model'); $config = Setup::createAnnotationMetadataConfiguration(array($modelsPath), true); // database configuration parameters $conn = array( 'driver' => 'pdo_sqlite', 'host' => 'localhost', 'user' => 'root', 'password' => '', 'dbname' => 'someDb', ); return ConsoleRunner::createHelperSet(EntityManager::create($conn, $config)); Now, when I run php vendor/bin/doctrine orm:schema-tool:create or php vendor/bin/doctrine orm:schema-tool:drop I get Access denied . What am I doing wrong? P.S. I am not using Symfony, Doctrine version is 2.4.1.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Julian Picht
          • Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: