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,
Related
I am trying to create a symfony2 project, with the symfony2.8 version. However whenever I create a symfony project in netbeans I cannot find where to specify the version of symfony and it always creates a symfony3 project. Is there any way to tell netbeans to use the symfony2 version instead of 3?
I'd save yourself the headache and time of trying to figure that out, and instead use the Symfony recommended way.
php -r "readfile('https://symfony.com/installer');" > symfony
# for example, if WAMP is used ...
">c:\> move symfony c:\wamp\bin\php
# ... then, execute the command as:
">c:\> symfony
# moving it to your projects folder ...
">c:\> move symfony c:\projects
# ... then, execute the command as
">c:\> cd projects
">c:\projects\> php symfony
https://symfony.com/doc/current/setup.html
Net-beans will still recognise your project as a Symfony project along with all the added benefits, but also with the ease of setting up new Symfony projects with one command from the CLI.
If you really want to stick to the Net-beans way, simply allow Net-beans to install it, however it chooses. Once it's installed change the version number within the composer.json file. The biggest issue you'll have for this is you'll have to check all your version numbers are compatible.
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 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.
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.
I have several web projects built with Symfony v1.0, but I am excited by the new features in Symfony version 1.4 (Improved security, native email support and improved performance).
How can I continue to develop my 1.0 projects but also create a testing environment for version 1.4?
Guide to Installing Multiple versions of Symfony
Thankyou to Guillaume Flandre for pointing it out, there is a fantastic article written by eHabib on SymfonyNerds.com - http://symfonynerds.com/blog/?p=123
Here is the basic outline, read the whole article here.
Step 1 - Un-install Symfony via PEAR
Step 2 - Setup a structure for Symfony: Install symfony in /usr/share/php/symfony
Step 3 - Checkout each Symfony version you need
Use SVN checkout to grab each Symfony version. Put these in a different folder under the base Symfony directory.
Step 4 - Create symbolic links for each version
Create and test symlinks for each version of Symfony. Lets place these in the standard bin directory
Step 5 - Creating a new project
Use the relevant Symfony command. For example, to create a Symfony 1.0 project:
sudo symfony10 init-project test1
sudo symfony11 generate:project test11
sudo symfony12 generate:project test12
Step 6 - Check in the project Config to ensure its picked up the right version.
This link should be useful: http://symfonynerds.com/blog/?p=123
It points to an article named: Your complete guide to running multiple Symfony versions on the same environment
It's fairly easy to do.
As also said in the article, I define it in lib/vendor as svn:externals: symfony http://svn.symfony-project.com/branches/1.2
So there's no symfony to be installed on the server at all and you can use as many versions without influence on other apps.