Changeset 10064
- Timestamp:
- 07/02/08 14:38:19 (5 months ago)
- Files:
-
- doc/branches/1.0/askeet/en/1.txt (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.0/askeet/en/1.txt
r8173 r10064 29 29 We'll assume that you use a Unix-like system with Apache, MySQL and PHP 5 installed. If you run a Windows system, don't panic: it will also work fine, you'll just have to type a few commands in the `cmd` prompt. 30 30 31 >**Note**: Unix shell commands can come in handy in a Windows environment. If you would like to use tools like `tar`, `gzip`, or `grep` on Windows you can install [Cygwin](http://cygwin.com/). The official docs are a little sparse, so a good installation guide can be found [here](http://www.soe.ucsc.edu/~you/notes/cygwin-install.html). The adventurous may also like to try Microsoft's [Windows Services for Unix](http://technet.microsoft.com/en-gb/interopmigration/bb380242.aspx). 32 31 33 Symfony installation 32 34 -------------------- … … 45 47 46 48 $ pear install symfony/symfony 47 48 Check that symfony is installed by using the command line to check the version: 49 50 If a specific version is desired, say 1.0.11, it can be specified as follows: 51 52 $ pear upgrade symfony/symfony-1.0.11 53 54 Check that symfony is installed by using the command line to check the version (note capital -V): 49 55 50 56 $ symfony -V … … 67 73 Wow, that was fast. 68 74 69 >**Note**: Windows users are advised to run symfony and to setup their new project in a path which contains no spaces - this includes the `Documents and Settings` directory.75 >**Note**: Windows users are advised to run symfony and to setup their new project in a path which contains no spaces. Avoid using the `Documents and Settings` directory, including anywhere under `My Documents` (or `Documents` on Vista). 70 76 71 77 Web service setup … … 78 84 Open the `httpd.conf` file of your `Apache/conf/` directory and add at the end: 79 85 80 <VirtualHost *:80> 86 NameVirtualHost 127.0.0.1:80 87 88 <VirtualHost 127.0.0.1:80> 81 89 ServerName askeet 82 90 DocumentRoot "/home/sfprojects/askeet/web" … … 89 97 </VirtualHost> 90 98 91 >**Note**: the `/sf` alias has to point to the symfony folder in your PEAR data directory. To determine it, just type `pear config-show`. Symfony applications need to have access to this folder to get some image and javascript files, to properly run the web debug toolbar and the AJAX helpers.92 93 In Windows, you need to replace the `Alias` line bysomething like:99 >**Note**: The `/sf` alias has to point to the symfony folder in your PEAR data directory. To determine it, just type `pear config-show`. Symfony applications need to have access to this folder to get some image and javascript files, to properly run the web debug toolbar and the AJAX helpers. 100 101 In Windows, you need to replace the `Alias` line with something like: 94 102 95 103 Alias /sf "C:\php\pear\data\symfony\web\sf" 104 105 If the above doesn't work, it may be necessary to specify permissions for the aliased `/sf` directory. The following is from a working Windows [WAMP](http://www.wampserver.com/en/) installation: 106 107 NameVirtualHost 127.0.0.1:80 108 109 <VirtualHost 127.0.0.1:80> 110 ServerName askeet 111 DocumentRoot "C:/sfprojects/askeet/web" 112 DirectoryIndex index.php 113 Alias /sf "C:/wamp/php/PEAR/data/symfony/web/sf" 114 <Directory "C:/sfprojects/askeet/web"> 115 AllowOverride All 116 Allow from All 117 </Directory> 118 <Directory "C:/wamp/php/PEAR/data/symfony/web/sf"> 119 AllowOverride All 120 Allow from All 121 </Directory> 122 </VirtualHost> 96 123 97 124 ### Declare the domain name … … 117 144  118 145 119 >**Note**: symfony can use the `mod_rewrite` module to remove the /index.php/ part of the URLs.146 >**Note**: Symfony can use the `mod_rewrite` module to remove the /index.php/ part of the URLs. 120 147 >If you don't want to use it or if your web server does not provide an equivalent facility, you can remove the `.htaccess` file located in the `web/` directory. 121 148 >If your version of Apache is not compiled with `mod_rewrite`, check that you have the mod_rewrite DSO installed and the following lines in your `httpd.conf`: … … 134 161  135 162 136 Once again, the setup is a little different if you want to run a IIS server in a Windows environment. Find how to configure it in the [related tutorial](http://www.symfony-project.com/cookbook/1_0/web_server_iis). 163 >**Note**: If the application works in the development environment (`http://askeet/frontend_dev.php/`), but not the production environment (`http://askeet/`) then check that `mod_rewrite` is configured in `http.conf` as described above, and restart Apache. It may also be necessary to run `symfony cc` at the command line to clear the symfony cache. 164 165 IIS 166 --- 167 168 The setup is a little different if you want to run Symfony on an IIS server in a Windows environment. Find how to configure it in the [related tutorial](http://www.symfony-project.com/cookbook/1_0/web_server_iis). 137 169 138 170 Subversion 139 171 ---------- 140 172 141 One of the good principles of lazy folks is not to worry about breaking existing code. As we want to work fast, we want to revert to a previous version if a modification is inefficient, we want to allow more than one person to work on the project, and we also want you to have access to all the daily versions of the application, we are going to adopt source version control. We will use [Subversion][3] for this purpose. Assuming you have already installed a subversion server or have access to a subversion server. 142 143 Fist, create a new repository for the `askeet` project: 173 One of the good principles of lazy folks is not to worry about breaking existing code. Source version control allows us to: 174 175 * work fast 176 * revert to a previous version if a modification is inefficient 177 * allow more than one person to work on the project 178 * have access to all the daily versions of the application 179 180 We will use [Subversion][3] for this purpose. We assume you have already installed a subversion server or have access to a subversion server. 181 182 First, create a new repository for the `askeet` project: 144 183 145 184 $ svnadmin create $SVNREP_DIR/askeet 146 185 $ svn mkdir -m "layout creation" file:///$SVNREP_DIR/askeet/trunk file:///$SVNREP_DIR/askeet/tags file:///$SVNREP_DIR/askeet/branches 186 187 >**Note**: For those new to subversion. These two lines create your subversion repository. The second line creates the directory structure of the repository. All the main development code will be versioned in the `trunk` directory. `tags` holds copies of major code releases such as version 1, version 2, etc. `branches` is for development code that differs substantially from the main development code. The usual intention is that `branches` will eventually be merged back into the `trunk`. For example the main `trunk` development can continue while an unproven new feature is exhaustively tested and fixed in a `branch`. Once completed the `branch` code is merged back into the `trunk` along with any new changes made since the code branched. SVN provides powerful tools to assist this process. 147 188 148 189 Next, you have to do the first import, omitting the `cache/` and `log/` temporary files: … … 152 193 $ rm -rf log/* 153 194 $ svn import -m "initial import" . file:///$SVNREP_DIR/askeet/trunk 154 155 Now get rid of the original application directory and use a checkout of the SVN version: 195 196 >**Note**: For those new to subversion. The fourth line here imports the askeet files and directories into the SVN `trunk` repository. The code is now under version control. 197 198 Our code is under version control but the code must be checked out to allow SVN to track changes. Backup the original application directory and use a checkout of the SVN version for our working copy: 156 199 157 200 $ cd /home/sfprojects … … 160 203 $ ls askeet 161 204 205 Once all is OK, delete the original directory we used for import, as its no longer required: 206 162 207 $ rm -rf askeet.origin 208 209 >**Note**: For those new to subversion. The `trunk` code is now in our working directory `askeet/`. This is the code that we will modify and develop. From an SVN perspective it is called our "working copy". SVN tracks changes to this code when it is committed to the repository. 163 210 164 211 There is one remaining thing to setup. If you commit your working directory to the repository, you may copy some unwanted files, like the ones located in the `cache` and `log` directories of your project. So you need to specify an ignore list to SVN for this project. … … 186 233 $ chmod 777 log 187 234 188 >**Note**: Windows users can use the great [TortoiseSVN][4] client to manage their subversion repository. 235 >**Note**: Windows users can use the great [TortoiseSVN][4] client to manage their subversion repository. Just remember to never delete directories using the normal Windows Explorer commands. Instead use Alt-Click Tortoise-Delete (or Rename) so that SVN knows what you intended. Otherwise you will be unable to commit and will need to instead revert to the last versioned copy of your code using Tortoise-Update. 189 236 190 237 If you want to know more about source version control, check the [project creation chapter](http://www.symfony-project.com/book/1_0/03-Running-Symfony) in the symfony book. … … 213 260 Make sure you come back tomorrow! 214 261 262 ---- 263 264 This document last updated: $LastChangedDate: 2008-03-31 23:32:27 +1100 (Mon, 31 Mar 2008) $ 265 215 266 [1]: http://pear.php.net "Pear" 216 267 [3]: http://subversion.tigris.org/ "Subversion"