Development

HowToUpgradeToVersion1 (diff)

You must first sign up to be able to contribute.

Changes from Version 1 of HowToUpgradeToVersion1

Show
Ignore:
Author:
rbq (IP: 84.62.168.84)
Timestamp:
04/08/08 10:04:13 (10 years ago)
Comment:

moved from HowToUpgradeToLatestBeta

Legend:

Unmodified
Added
Removed
Modified
  • HowToUpgradeToVersion1

    v0 v1  
     1= How to upgrade to 1.0beta-1 from 0.7.1914 = 
     2 
     3'''Warning''': The following description is not the easiest way to upgrade. The best way is to call the `symfony.php` script, located in the symfony installation directory, from the root of the project directory. 
     4 
     5{{{ 
     6> cd myproject 
     7> php /path/to/pear_data_dir/bin/symfony upgrade 1.0 
     8}}} 
     9 
     10It will take care of all the steps described in this page. 
     11 
     12Also, This page should be updated to talk about 1.0 stable. 
     13---- 
     14 
     15 
     16This is a short HOW-TO to get your projects running on the latest release 1.0-beta1. I will assume you've installed the framework using !PEAR and work that way - this only applies to upgrading the framework itself, project specifics apply to any framework install method. 
     17 
     18Firstly, we upgrade the framework by issuing the {{{pear upgrade symfony/symfony-beta}}} command. If no errors were issued, then your framework has been successfully upgraded. If not, try using the following set of commands (worked for me in the past, why not): 
     19 
     20{{{ 
     21pear upgrade PEAR 
     22pear channel-update pear.symfony-project.com 
     23}}} 
     24 
     25Having the framework installed, we move on to each project using a framework prior to 1.0beta-1. The main differences here are in three key files that must be modified before the {{{symfony}}} command can work. These are: 
     26 
     27{{{ 
     28/SYMFONY 
     29/config/config.php 
     30/apps/[appname]/config/config.php 
     31}}} 
     32 
     33== /SYMFONY == 
     34 
     35First off, {{{SYMFONY}}} is no longer a zero-length file, and the filename is lowercase now. Rename the file to lowercase (irrelevant for Windows, since the shell ignores file cases, but migrating to Linux will not cause a problem in this case) and insert this code block: 
     36 
     37{{{ 
     38#!/usr/bin/env php 
     39<?php 
     40 
     41/* 
     42 * This file is part of the symfony package. 
     43 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
     44 *  
     45 * For the full copyright and license information, please view the LICENSE 
     46 * file that was distributed with this source code. 
     47 */ 
     48 
     49chdir(dirname(__FILE__)); 
     50include('config/config.php'); 
     51include($sf_symfony_data_dir.'/bin/symfony.php'); 
     52}}} 
     53 
     54== /config/config.php == 
     55 
     56Next is the global project {{{/config/config.php}}} file. Instead of the default blank file, you now need to have two additional lines if you've already set your own constants in the file (in this case, just insert these lines before any of your code): 
     57 
     58{{{ 
     59<?php 
     60 
     61// symfony directories 
     62$sf_symfony_lib_dir  = 'C:\PHP\pear/symfony'; 
     63$sf_symfony_data_dir = 'C:\PHP\pear\data/symfony'; 
     64}}} 
     65 
     66== /apps/[appname]/config/config.php == 
     67 
     68Lastly, you need to update each of your applications' config files in the {{{/apps/[appname]/config/config.php}}} file. That file, in addition to any code you may have inserted yourself, must contain the following: 
     69 
     70{{{ 
     71<?php 
     72 
     73// include project configuration 
     74include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); 
     75 
     76// symfony bootstraping 
     77require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); 
     78sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir); 
     79}}} 
     80 
     81Again, it is advisable to insert all these lines at the top of the file, to avoid path problems and such. 
     82 
     83== Updating the project == 
     84 
     85Now that we've managed to make the symfony command work in the root project folder, we're ready to upgrade all the other files using the automatic upgrade script: 
     86 
     87{{{ 
     88symfony upgrade 1.0 
     89}}} 
     90 
     91The command also gives instructions on what to do next, but for your convenience I'll list the commands for you: 
     92 
     93{{{ 
     94symfony propel-build-model 
     95symfony cc 
     96}}} 
     97 
     98The first one regenerates your Propel classes to use the latest version of the OM included in 1.0-beta1, the second clears the cache to make symfony regenerate and use the new classes. 
     99 
     100Navigate your browser to wherever you have your project installed, and you should see your project in its entirety working as it should, unless you've used any deprecated methods or classes, in which case the framework will notify you of any changes to your model. 
     101 
     102In either case, it should be trivial for you to debug your apps with the new and shiny version. 
     103 
     104Have fun!