@@ -8,23 +8,22 @@ How to Create and store a Symfony2 Project in Subversion
8
8
9
9
Once you've read through :doc: `/book/page_creation ` and become familiar with
10
10
using Symfony, you'll no-doubt be ready to start your own project. The
11
- preferred method to manage Symfony2 projects is using `git `_ but some people
12
- are stuck with `Subversion `_ and don't have a choice . In this cookbook article,
13
- you'll learn how to manage your project using `svn `_ in a similar manner you
11
+ preferred method to manage Symfony2 projects is using `git `_ but some prefer
12
+ to use `Subversion `_ which is totally fine! . In this cookbook article, you'll
13
+ learn how to manage your project using `svn `_ in a similar manner you
14
14
would do with `git `_.
15
15
16
- .. caution ::
16
+ .. tip ::
17
17
18
- This is **a ** method to import your Symfony2 project in a Subversion
18
+ This is **a ** method to tracking your Symfony2 project in a Subversion
19
19
repository. There are several ways to do and this one is simply one that
20
- works. Furthermore, it is quite complex to do so you should probably
21
- consider using `git `_ anyway.
20
+ works.
22
21
23
- Subversion repository
24
- ---------------------
22
+ The Subversion Repository
23
+ -------------------------
25
24
26
25
For this article we will suppose that your repository layout follows the
27
- widespread standard structure :
26
+ widespread standard structure:
28
27
29
28
.. code-block :: text
30
29
@@ -35,16 +34,16 @@ widespread standard structure :
35
34
36
35
.. tip ::
37
36
38
- Most of the subversion hosting should follow this standard practice. This
37
+ Most subversion hosting should follow this standard practice. This
39
38
is the recommended layout in `Version Control with Subversion `_ and the
40
39
layout used by most free hosting (see :ref: `svn-hosting `).
41
40
42
41
Initial Project Setup
43
42
---------------------
44
43
45
- To get started, you'll need to download Symfony2 and get the basic Subversion setup :
44
+ To get started, you'll need to download Symfony2 and get the basic Subversion setup:
46
45
47
- 1. Download the `Symfony2 Standard Edition `_ without vendors.
46
+ 1. Download the `Symfony2 Standard Edition `_ without or without vendors.
48
47
49
48
2. Unzip/untar the distribution. It will create a folder called Symfony with
50
49
your new project structure, config files, etc. Rename it to whatever you
@@ -63,34 +62,28 @@ To get started, you'll need to download Symfony2 and get the basic Subversion se
63
62
64
63
$ mv Symfony/* myproject/
65
64
66
- 5. Let's now set the ignore rules, this is the complex part compared to `git `_.
67
- You need to add some specific files/folders to the subversion repository and
68
- edit ``svn:ignore `` properties:
65
+ 5. Let's now set the ignore rules. Not everything *should * be stored in your
66
+ subversion repository. Some files (like the cache) are generated and
67
+ others (like the database configuration) are meant to be customized
68
+ on each machine. This makes use of the ``svn:ignore `` property, so that
69
+ we can ignore specific files.
69
70
70
71
.. code-block :: bash
71
72
72
73
$ cd myproject/
73
74
$ svn add --depth=empty app app/cache app/logs app/config web
74
- $ svn propedit svn:ignore .
75
- vendor
76
- $ svn propedit svn:ignore app/
77
- bootstrap*
78
- $ svn propedit svn:ignore app/config/
79
- parameters.ini
80
- $ svn propedit svn:ignore app/cache/
81
- *
82
- $ svn propedit svn:ignore app/logs/
83
- *
84
- $ svn propedit svn:ignore web
85
- bundles
86
- $ svn ci -m " commit basic symfony ignore list (vendor, app/bootstrap*, app/config/parameters.ini, app/cache/*, app/logs/*, web/bundles)"
87
75
88
- .. tip ::
76
+ $ svn propset svn:ignore " vendor" .
77
+ $ svn propset svn:ignore " bootstrap*" app/
78
+ $ svn propset svn:ignore " parameters.ini" app/config/
79
+ $ svn propset svn:ignore " *" app/cache/
80
+ $ svn propset svn:ignore " *" app/logs/
89
81
90
- This part is a bit painful but this is the only way to make sure that those
91
- files and folders will **never ** appear in your project repository.
82
+ $ svn propset svn:ignore " bundles" web
92
83
93
- 6. The rest of the files can now be added and commited to the project:
84
+ $ svn ci -m " commit basic symfony ignore list (vendor, app/bootstrap*, app/config/parameters.ini, app/cache/*, app/logs/*, web/bundles)"
85
+
86
+ 6. The rest of the files can now be added and committed to the project:
94
87
95
88
.. code-block :: bash
96
89
@@ -113,9 +106,10 @@ To get started, you'll need to download Symfony2 and get the basic Subversion se
113
106
.. tip ::
114
107
115
108
`git `_ has to be installed to run ``bin/vendors ``, this is the protocol
116
- used to fetch vendor libraries.
109
+ used to fetch vendor libraries. This only means that ``git `` is used as
110
+ a tool to basically help download the libraries in the ``vendor/ `` directory.
117
111
118
- At this point, you have a fully-functional Symfony2 project, followed in your
112
+ At this point, you have a fully-functional Symfony2 project stored in your
119
113
Subversion repository. The development can start with commits in the Subversion
120
114
repository.
121
115
@@ -127,54 +121,15 @@ to learn more about how to configure and develop inside your application.
127
121
The Symfony2 Standard Edition comes with some example functionality. To
128
122
remove the sample code, follow the instructions on the `Standard Edition Readme `_.
129
123
130
- .. _cookbook-managing-vendor-libraries :
131
-
132
- Managing Vendor Libraries with bin/vendors and deps
133
- ---------------------------------------------------
134
-
135
- Every Symfony project uses a large group of third-party "vendor" libraries.
136
-
137
- By default, these libraries are downloaded by running the ``php bin/vendors install ``
138
- script. This script reads from the ``deps `` file, and downloads the given
139
- libraries into the ``vendor/ `` directory. It also reads ``deps.lock `` file,
140
- pinning each library listed there to the exact git commit hash.
141
-
142
- In this setup, the vendors libraries aren't part of your repository,
143
- not even as submodules. Instead, we rely on the ``deps `` and ``deps.lock ``
144
- files and the ``bin/vendors `` script to manage everything. Those files are
145
- part of your repository, so the necessary versions of each third-party library
146
- are version-controlled, and you can use the vendors script to bring
147
- your project up to date.
148
-
149
- Whenever a developer clones a project, he/she should run the ``php bin/vendors install ``
150
- script to ensure that all of the needed vendor libraries are downloaded.
151
-
152
- .. sidebar :: Upgrading Symfony
153
-
154
- Since Symfony is just a group of third-party libraries and third-party
155
- libraries are entirely controlled through ``deps `` and ``deps.lock ``,
156
- upgrading Symfony means simply upgrading each of these files to match
157
- their state in the latest Symfony Standard Edition.
158
-
159
- Of course, if you've added new entries to ``deps `` or ``deps.lock ``, be sure
160
- to replace only the original parts (i.e. be sure not to also delete any of
161
- your custom entries).
162
-
163
- .. caution ::
164
-
165
- There is also a ``php bin/vendors update `` command, but this has nothing
166
- to do with upgrading your project and you will normally not need to use
167
- it. This command is used to freeze the versions of all of your vendor libraries
168
- by updating them to the version specified in ``deps `` and recording it
169
- into the ``deps.lock `` file.
124
+ .. include :: _vendor_deps.rst.inc
170
125
171
126
.. _svn-hosting :
172
127
173
128
Subversion hosting solutions
174
129
----------------------------
175
130
176
131
The biggest difference between `git `_ and `svn `_ is that Subversion *needs * a
177
- central repository to work. You then have several solutions :
132
+ central repository to work. You then have several solutions:
178
133
179
134
- Self hosting: create your own repository and access it either through the
180
135
filesystem or the network. To help in this task you can read `Version Control
0 commit comments