From 5124dcde56b6b17cadc6824fbd7cd5cd8b76f09b Mon Sep 17 00:00:00 2001 From: Fabrice Bernhard Date: Sun, 30 Jan 2011 22:02:15 +0100 Subject: [PATCH 1/3] First steps contributing to symfony 1 to Symfony2 documentation --- guides/symfony1.rst | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/guides/symfony1.rst b/guides/symfony1.rst index 7ba07889926..b27be962e9e 100644 --- a/guides/symfony1.rst +++ b/guides/symfony1.rst @@ -1,6 +1,52 @@ Symfony2 for symfony 1 users ============================ + +Create a new project +-------------------- + +In a symfony 1 environment, to create a new project, you used the global "symfony" executable, or the one contained in the data/bin folder of the symfony1 source: + +.. code-block:: + + svn checkout http://svn.symfony-project.com/branches/1.4/ symfony1 + mkdir mynewproject + cd mynewproject + php ../symfony1/data/bin/symfony generate:project mynewproject + +In Symfony2, to create a new project you need to use the symfony bootstrapper: + +.. code-block:: + + git clone git://github.com/symfony/symfony-bootstrapper.git + mkdir mynewproject + cd mynewproject + php ../symfony-bootstrapper/symfony.phar init --name=mynewproject + +and you will have to link all external libraries yourself: + +.. code-block:: + + ln -s ../../symfony-bootstrapper/src/vendor src/vendor + + + +Use the console +--------------- + +In symfony 1, the console was directly in the base directory and was called ```symfony```: + +.. code-block:: + + php symfony + +In Symfony2, the console is now in the app sub-directory and is called ```console```: + +.. code-block:: + + php app/console + + Applications ------------ From 8ffb8a8c8c6902e60a5d695c156838bf11f87b94 Mon Sep 17 00:00:00 2001 From: Fabrice Bernhard Date: Sun, 30 Jan 2011 23:26:05 +0100 Subject: [PATCH 2/3] Contribution to symfony 1 to Symfony2 : - Create a new project - Console - Modules - Plugins To be continued --- guides/symfony1.rst | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/guides/symfony1.rst b/guides/symfony1.rst index b27be962e9e..08220cfe7dc 100644 --- a/guides/symfony1.rst +++ b/guides/symfony1.rst @@ -5,7 +5,7 @@ Symfony2 for symfony 1 users Create a new project -------------------- -In a symfony 1 environment, to create a new project, you used the global "symfony" executable, or the one contained in the data/bin folder of the symfony1 source: +In a symfony 1 environment, to create a new project, you use the global "symfony" executable, or the one contained in the data/bin folder of the symfony1 source: .. code-block:: @@ -14,16 +14,24 @@ In a symfony 1 environment, to create a new project, you used the global "symfon cd mynewproject php ../symfony1/data/bin/symfony generate:project mynewproject -In Symfony2, to create a new project you need to use the symfony bootstrapper: +In Symfony2, to create a new project you need to install the symfony bootstrapper first: .. code-block:: git clone git://github.com/symfony/symfony-bootstrapper.git + cd symfony-bootstraper/src + sh ../bin/install_vendors.sh + cd ../../ + +And then use it to create your project. Note that the default format for configuration files is now ```xml```, so if you want to keep the ```yml``` format to which you are used to in symfony 1, you need to specifiy it: + +.. code-block:: + mkdir mynewproject cd mynewproject - php ../symfony-bootstrapper/symfony.phar init --name=mynewproject + php ../symfony-bootstrapper/symfony.phar init --format=yml --name=mynewproject -and you will have to link all external libraries yourself: +Finally you now have multiple external libraries to include in your project. To avoid downloading them for every new project, you can use a symbolic link: .. code-block:: @@ -34,7 +42,7 @@ and you will have to link all external libraries yourself: Use the console --------------- -In symfony 1, the console was directly in the base directory and was called ```symfony```: +In symfony 1, the console is directly in the base directory and is called ```symfony```: .. code-block:: @@ -65,4 +73,21 @@ different semantic configurations, separate routing configurations, and so on. .. tip:: Read the definition of a :term:`Project`, an :term:`Application`, and a - :term:`Bundle` in the glossary. \ No newline at end of file + :term:`Bundle` in the glossary. + + + +Bundles +------- + +In a symfony 1 project, you usually have multiple modules inside your application. A module is a coherent set of controllers and templates. + +In a Symfony2 project, you replace the concept of modules with Bundles. + + +Plugins +------- + +In a symfony 1 project, you usually download a lot of useful plugins to reuse the many functionalities developed by the community. + +In a Symfony2 project, you download Bundles. There are not many differences between the "module" Bundles and the "plugin" Bundles, except that a "plugin" Bundle usually contains multiple "module" Bundles using the "category namespace". From 32688fa7732781d731d705d720494249fc2a547c Mon Sep 17 00:00:00 2001 From: Fabrice Bernhard Date: Sun, 30 Jan 2011 23:30:13 +0100 Subject: [PATCH 3/3] symfony 1 to Symfony2: replace tabs with spaces in the file --- guides/symfony1.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/guides/symfony1.rst b/guides/symfony1.rst index 08220cfe7dc..9bbb8b16986 100644 --- a/guides/symfony1.rst +++ b/guides/symfony1.rst @@ -9,7 +9,7 @@ In a symfony 1 environment, to create a new project, you use the global "symfony .. code-block:: - svn checkout http://svn.symfony-project.com/branches/1.4/ symfony1 + svn checkout http://svn.symfony-project.com/branches/1.4/ symfony1 mkdir mynewproject cd mynewproject php ../symfony1/data/bin/symfony generate:project mynewproject @@ -18,10 +18,10 @@ In Symfony2, to create a new project you need to install the symfony bootstrappe .. code-block:: - git clone git://github.com/symfony/symfony-bootstrapper.git - cd symfony-bootstraper/src - sh ../bin/install_vendors.sh - cd ../../ + git clone git://github.com/symfony/symfony-bootstrapper.git + cd symfony-bootstraper/src + sh ../bin/install_vendors.sh + cd ../../ And then use it to create your project. Note that the default format for configuration files is now ```xml```, so if you want to keep the ```yml``` format to which you are used to in symfony 1, you need to specifiy it: @@ -29,7 +29,7 @@ And then use it to create your project. Note that the default format for configu mkdir mynewproject cd mynewproject - php ../symfony-bootstrapper/symfony.phar init --format=yml --name=mynewproject + php ../symfony-bootstrapper/symfony.phar init --format=yml --name=mynewproject Finally you now have multiple external libraries to include in your project. To avoid downloading them for every new project, you can use a symbolic link: @@ -46,15 +46,15 @@ In symfony 1, the console is directly in the base directory and is called ```sym .. code-block:: - php symfony - + php symfony + In Symfony2, the console is now in the app sub-directory and is called ```console```: .. code-block:: - php app/console - - + php app/console + + Applications ------------