How to upgrade to 1.0beta-1 from 0.7.1914
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.
> cd myproject > php /path/to/pear_data_dir/bin/symfony upgrade 1.0
It will take care of all the steps described in this page.
Also, This page should be updated to talk about 1.0 stable.
This 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.
Firstly, 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):
pear upgrade PEAR pear channel-update pear.symfony-project.com
Having 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:
/SYMFONY /config/config.php /apps/[appname]/config/config.php
First 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:
#!/usr/bin/env php <?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <firstname.lastname@example.org> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ chdir(dirname(__FILE__)); include('config/config.php'); include($sf_symfony_data_dir.'/bin/symfony.php');
Next 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):
<?php // symfony directories $sf_symfony_lib_dir = 'C:\PHP\pear/symfony'; $sf_symfony_data_dir = 'C:\PHP\pear\data/symfony';
Lastly, 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:
<?php // include project configuration include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php'); // symfony bootstraping require_once($sf_symfony_lib_dir.'/util/sfCore.class.php'); sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir);
Again, it is advisable to insert all these lines at the top of the file, to avoid path problems and such.
Updating the project
Now 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:
symfony upgrade 1.0
The command also gives instructions on what to do next, but for your convenience I'll list the commands for you:
symfony propel-build-model symfony cc
The 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.
Navigate 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.
In either case, it should be trivial for you to debug your apps with the new and shiny version.