Development

Changeset 8167

You must first sign up to be able to contribute.

Changeset 8167

Show
Ignore:
Timestamp:
03/31/08 13:31:53 (3 months ago)
Author:
markchicobaby
Message:

Some minor spelling mistakes, extended the Apache http.conf file, added some explanations about SVN for newbies. Also added information on Windows command line tools.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doc/branches/1.0/askeet/en/1.txt

    r8131 r8167  
    2929We'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. 
    3030 
     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 
    3133Symfony installation 
    3234-------------------- 
     
    4547 
    4648    $ pear install symfony/symfony 
    47  
    48 Check that symfony is installed by using the command line to check the version: 
     49     
     50If 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 
     54Check that symfony is installed by using the command line to check the version (note capital -V): 
    4955 
    5056    $ symfony -V 
     
    6773Wow, that was fast. 
    6874 
    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)
    7076 
    7177Web service setup 
     
    7682Now it is time to change your Apache configuration to make the new application accessible. In a professional context, it is better to setup a new application as a virtual host, and that's what will be described here. However, if you prefer to add it as an alias, find how in the [web server configuration](http://www.symfony-project.com/cookbook/1_0/web_server) cookbook chapter. 
    7783 
    78 Open the `httpd.conf` file of your `Apache/conf/` directory and add at the end
     84Open the `httpd.conf` file of your `Apache/conf/` directory and add at the end (note this is a _very_ insecure configuration; don't use it in a production environment!)
    7985 
    8086    NameVirtualHost 127.0.0.1:80 
     
    9197    </VirtualHost> 
    9298 
    93 >**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. 
    94  
    95 In Windows, you need to replace the `Alias` line by something 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 
     101In Windows, you need to replace the `Alias` line with something like: 
    96102 
    97103      Alias /sf "C:\php\pear\data\symfony\web\sf" 
     104 
     105If 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 askeet: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> 
    98123        
    99124### Declare the domain name 
     
    119144![Congratulations](/images/askeet/congratulations.gif) 
    120145 
    121 >**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. 
    122147>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. 
    123148>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`: 
     
    136161![web debug toolbar](/images/askeet/web_debug1.gif) 
    137162 
    138 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 
     165IIS 
     166--- 
     167 
     168The 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). 
    139169 
    140170Subversion 
    141171---------- 
    142172 
    143 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. 
    144  
    145 Fist, create a new repository for the `askeet` project: 
     173One 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 
     180We will use [Subversion][3] for this purpose. We assume you have already installed a subversion server or have access to a subversion server. 
     181 
     182First, create a new repository for the `askeet` project: 
    146183 
    147184    $ svnadmin create $SVNREP_DIR/askeet 
    148185    $ 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. 
    149188 
    150189Next, you have to do the first import, omitting the `cache/` and `log/` temporary files: 
     
    154193    $ rm -rf log/* 
    155194    $ svn import -m "initial import" . file:///$SVNREP_DIR/askeet/trunk 
    156  
    157 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 
     198Our 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: 
    158199 
    159200    $ cd /home/sfprojects 
     
    162203    $ ls askeet 
    163204 
     205Once all is OK, delete the original directory we used for import, as its no longer required: 
     206 
    164207    $ 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. 
    165210 
    166211There 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. 
     
    188233    $ chmod 777 log 
    189234 
    190 >**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. 
    191236 
    192237If 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.