| 1 |
lars |
1 |
symfony sandbox
|
|
|
2 |
===============
|
|
|
3 |
|
|
|
4 |
Thank you for downloading the symfony sandbox. This pre-configured symfony
|
|
|
5 |
project will allow you to experiment with the symfony framework immediately,
|
|
|
6 |
without any installation or configuration.
|
|
|
7 |
|
|
|
8 |
Quick start
|
|
|
9 |
-----------
|
|
|
10 |
|
|
|
11 |
The sandbox project will work "out of the box", provided that you extract the
|
|
|
12 |
.tgz archive under the root web directory configured for your server (usually
|
|
|
13 |
`web/`).
|
|
|
14 |
|
|
|
15 |
After unpacking the archive, test the sandbox by requesting the following URL:
|
|
|
16 |
|
|
|
17 |
http://localhost/sf_sandbox/web/
|
|
|
18 |
|
|
|
19 |
You should see a congratulations page.
|
|
|
20 |
|
|
|
21 |
Command line
|
|
|
22 |
------------
|
|
|
23 |
|
|
|
24 |
If you are in the `sf_sandbox/` directory, you can use the command line to do
|
|
|
25 |
usual site management operations. For instance, to clear the cache, type:
|
|
|
26 |
|
|
|
27 |
$ ./symfony.sh clear-cache (*nix)
|
|
|
28 |
symfony clear-cache (Windows)
|
|
|
29 |
|
|
|
30 |
To discover all the available actions of the symfony command line, type:
|
|
|
31 |
|
|
|
32 |
$ ./symfony.sh -T (*nix)
|
|
|
33 |
symfony -T (Windows)
|
|
|
34 |
|
|
|
35 |
Environments
|
|
|
36 |
------------
|
|
|
37 |
|
|
|
38 |
The sandbox already contains one application called `frontend`, accessible
|
|
|
39 |
through two environments:
|
|
|
40 |
|
|
|
41 |
- the default environment is the `prod` one, in which the application is fast
|
|
|
42 |
but outputs few error messages
|
|
|
43 |
- the `dev` environment is slower but gives access to a lot of information
|
|
|
44 |
about the current request
|
|
|
45 |
|
|
|
46 |
To access the `frontend` application in the `dev` environment, type:
|
|
|
47 |
|
|
|
48 |
http://localhost/sf_sandbox/web/frontend_dev.php/
|
|
|
49 |
(don't forget the final /)
|
|
|
50 |
|
|
|
51 |
Modules
|
|
|
52 |
-------
|
|
|
53 |
|
|
|
54 |
To create a new module `mymodule`, just type in the command line:
|
|
|
55 |
|
|
|
56 |
$ ./symfony.sh init-module frontend mymodule (*nix)
|
|
|
57 |
symfony init-module frontend mymodule (Windows)
|
|
|
58 |
|
|
|
59 |
To access it, call:
|
|
|
60 |
|
|
|
61 |
http://localhost/sf_sandbox/web/mymodule
|
|
|
62 |
|
|
|
63 |
If, at this point, you meet an error, this means that your web server doesn't
|
|
|
64 |
support mod_rewrite. Delete the `.htaccess` file from the `web/` directory and
|
|
|
65 |
call instead:
|
|
|
66 |
|
|
|
67 |
http://localhost/sf_sandbox/web/index.php/mymodule
|
|
|
68 |
|
|
|
69 |
What's in the sandbox?
|
|
|
70 |
----------------------
|
|
|
71 |
|
|
|
72 |
The sandbox is an empty symfony project where all the required libraries
|
|
|
73 |
(symfony, pake, creole, propel and phing) are already included (in the
|
|
|
74 |
`sf_sandbox/lib/` directory). It is configured to work without any
|
|
|
75 |
configuration if unpacked under the web root, but you can install it anywhere
|
|
|
76 |
in your disk. In this case,
|
|
|
77 |
|
|
|
78 |
- delete the 22nd line of the `sf_sandbox/apps/frontend/config/settings.yml`
|
|
|
79 |
(`relative_url_root: /sf_sandbox/web/`)
|
|
|
80 |
- create a virtual host in your web server configuration to address the
|
|
|
81 |
`sf_sandbox/web` directory
|
|
|
82 |
|
|
|
83 |
The sandbox is intended for you to practice with symfony in a local computer,
|
|
|
84 |
not really to develop complex applications that may end up on the web.
|
|
|
85 |
However, the version of symfony shipped with the sandbox is fully functional
|
|
|
86 |
and equivalent to the one you can install via PEAR.
|
|
|
87 |
|
|
|
88 |
Beware that the sandbox is not upgradeable.
|
|
|
89 |
|
|
|
90 |
Happy symfony!
|
|
|
91 |
--------------
|
|
|
92 |
|
|
|
93 |
Feel free to experiment and try the various techniques described in the
|
|
|
94 |
www.symfony-project.com website. All the tutorials can also work in a sandbox.
|
|
|
95 |
But in the long run, if you decide to go on with symfony, we advise you to
|
|
|
96 |
switch to a PEAR installation, which will guarantee you with the possibility
|
|
|
97 |
to use the latest patches and enhancements.
|
|
|
98 |
|
|
|
99 |
The symfony team
|
|
|
100 |
http://www.symfony-project.com/
|