Symfony_cookbook_2.1.pdf

(1779 KB) Pobierz
The Cookbook
for Symfony 2.1
generated on January 8, 2013
967058513.016.png 967058513.017.png 967058513.018.png 967058513.019.png 967058513.001.png 967058513.002.png 967058513.003.png 967058513.004.png 967058513.005.png
The Cookbook (2.1)
This work is licensed under the “Attribution-Share Alike 3.0 Unported” license ( http://creativecommons.org/
licenses/by-sa/3.0/ ).
You are free to share (to copy, distribute and transmit the work), and to remix (to adapt the work) under the
following conditions:
Attribution : You must attribute the work in the manner specified by the author or licensor (but
not in any way that suggests that they endorse you or your use of the work).
Share Alike : If you alter, transform, or build upon this work, you may distribute the resulting work
only under the same, similar or a compatible license. For any reuse or distribution, you must make
clear to others the license terms of this work.
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor SensioLabs shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by
the information contained in this work.
If you find typos or errors, feel free to report them by creating a ticket on the Symfony ticketing system
( http://github.com/symfony/symfony-docs/issues ).
Based
on
tickets
and
users
feedback,
this
book
is
continuously updated.
Contents at a Glance
PDF brought to you by
generated on January 8, 2013
Contents at a Glance | iii
967058513.006.png 967058513.007.png 967058513.008.png
Contents at a Glance | 4
iv | Contents at a Glance
Chapter 1
How to Create and store a Symfony2 Project in
git
Though this entry is specifically about git, the same generic principles will apply if you're storing
your project in Subversion.
Once you've read through Creating Pages in Symfony2 and become familiar with using Symfony, you'll
no-doubt be ready to start your own project. In this cookbook article, you'll learn the best way to start a
new Symfony2 project that's stored using the git 1 source control management system.
Initial Project Setup
To get started, you'll need to download Symfony and initialize your local git repository:
1.
Download the Symfony2 Standard Edition 2 without vendors.
2.
Unzip/untar the distribution. It will create a folder called Symfony with your new project
structure, config files, etc. Rename it to whatever you like.
Create a new file called .gitignore at the root of your new project (e.g. next to the
composer.json file) and paste the following into it. Files matching these patterns will be
ignored by git:
3.
1
2
3
4
5
6
/web/bundles/
/app/bootstrap*
/app/cache/*
/app/logs/*
/vendor/
/app/config/parameters.yml
Listing 1-1
1. http://git-scm.com/
2. http://symfony.com/download
PDF brought to you by
generated on January 8, 2013
Chapter 1: How to Create and store a Symfony2 Project in git | 5
967058513.009.png 967058513.010.png 967058513.011.png 967058513.012.png 967058513.013.png 967058513.014.png 967058513.015.png
Zgłoś jeśli naruszono regulamin