I have used this guide http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/ and now I have a working Doctrine 2 + ZF2 software.
I use a versioning system and I want then use Doctrine MIGRATIONS tool to have a database migration system.
If I put on a shell ./doctrine-module orm:schema-tool:update it works correctly, but if I use a migration tools for example ./doctrine-module migrations:status the system give me an error:
[Doctrine\DBAL\Migrations\MigrationException]
Migrations namespace must be configured in order to use Doctrine migrations.
Which configurations are needs? Does DoctrineOrmModule support Doctrine migration?
I have found this for zf1 http://moxune.com/blog/2011/10/configure-doctrine-migrations-2-zend_config/
If you check the current Travis CI CLI test for DoctrineORMModule you will notice that there's a --configuration parameter pointing to an XML configuration, as described in Doctrine Migrations documentation. Setting that parameter and having DoctrineORMModule configured correctly should allow you to use the CLI.
Related
In Zf3 Project i have added Doctrine and migration module and also configure doctrine and migration configuration.
now i create migration through following command
anyone help me what's problem?
the data directory in your project root, either does not exist or doesn't have the correct permissions.
I'm on windows 7 64 bits.
I will have to do the migration of a Symfony 1.4 website.
I found the command orm:convert-d1-schema to convert the Symfony 1.4 DB Schema to Symfony 2.
But this command is not implemented in Symfony 2.4
http://forum.symfony-project.org/viewtopic.php?f=23&t=33149
https://github.com/symfony/symfony/issues/1442
I tried to install the doctrine 2 CLI to do the converting but I got errors and stopped trying this as this is probably a bad idea.
Do you know how I can get this command working on Symfony ?
In order to use all the orm:* commands available in Doctrine 2 you will need to configure/setup the Commandline Tools.
If you've followed a standard symfony 2 project setup you probably have a bin/ directory under your project root. Inside that folder you should file two files doctrine and doctrine.php.
You should use this doctrine executable or probably the doctrine.php since you're on Windows instead of the app/console one.
This way you'll be able to use the Doctrine ORM commands directly instead of the "alias provided by symfony" for them.
If you have further questions regarding this let me know.
Regards,
I found this website listing several interesting Doctrine CLI commands.
I set up a Doctrine model class like it is described in one of these tutorials.
But I still wonder how to use the CLI commands. How can Zend or Doctrine know where my classes are and how does Windows know that my Doctrine executable lies within my projects library?
Does anyone know how to utilize these CLI commands?
Doctrine cli is based on the symfony console package.
If you use composer for installing, take a look in the vendor/bin directory. You will find .bat files for the doctrine cli there.
I want to use some features of Doctrine 2 command line interface that Symfony 2 does not enable on app/console.
How can I do that?
Your best bet would be to add a new Command to your Symfony2 console.
http://symfony.com/doc/2.0/components/console.html
But which Doctrine cli feature is missing?
I'm trying to create my first page in Symfony2 according to this tutorial: http://symfony.com/doc/2.0/book/page_creation.html. Can anyone please tell how should I run this command:
php app/console init:bundle "Acme\StudyBundle" src
I'm new to symfony and I have no idea what this means...
php app/console init:bundle "Acme\StudyBundle" src
is a shell command you're meant to run at the command line of the machine you've installed Symfony on. You change into the directory where you installed symfony, and run it -- how you do that is obviously operating system- and installation-dependent.
The command itself invokes the command-line version of your PHP interpreter (php) to run Symfony's console script (app/console) to initialise a new Symfony bundle (init:bundle) called StudyBundle, from the (pretend!) company Acme (Acme\StudyBundle) in the directory src.
For me, running it would look a bit like this (from Terminal, on a Mac):
Matt-Gibsons-iMac:~ matt$ cd Sites/Symfony
Matt-Gibsons-iMac:Symfony matt$ php app/console init:bundle "Acme\StudyBundle" src
Summary of actions
- The bundle "AcmeStudyBundle" was created at "src/Acme/StudyBundle" and is using the namespace "Acme\StudyBundle".
...
A word of warning, though: Symfony 2 is still very new -- not yet even officially released -- and while what documentation there is is okay, the docs are nothing like as complete or helpful to the beginner as the excellent, mature documentation for Symfony 1.4. Also, Symfony 2 best practices have yet to be established.
So, if you're a complete Symfony novice you might find Symfony 1.4 easier going, especially following the Jobeet tutorial. Even though Symfony 2 is quite a big change from Symfony 1, learning Symfony 1 will introduce you to a lot of concepts that remain familiar in Symfony 2, such as generating new code modules from the command line, like you're trying to do here.