diff --git a/guides/symfony1.rst b/guides/symfony1.rst index f1d4380ae56..b994536c3df 100644 --- a/guides/symfony1.rst +++ b/guides/symfony1.rst @@ -164,6 +164,60 @@ via a ``env=`` option. A common practice is to have one console command file per environment. Usually, this means a ``console`` file for the ``prod`` environment and a ``console_dev`` for the ``dev`` environment. + +Create a new project +-------------------- + +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:: + + 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 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 --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: + +.. code-block:: + + ln -s ../../symfony-bootstrapper/src/vendor src/vendor + + + +Use the console +--------------- + +In symfony 1, the console is directly in the base directory and is 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 ------------ @@ -245,4 +299,4 @@ include a routing resource from a bundle, you might do the following:: To bring in configuration from the bundle, you'll need to import that configuration from your application configuration. -.. _`Symfony2 Sandbox`: https://github.com/symfony/symfony-sandbox \ No newline at end of file +.. _`Symfony2 Sandbox`: https://github.com/symfony/symfony-sandbox