原项目的是0.63的版本。昨天升级出现问题是由于pear里的参数路径不对。导致出现如下错误

ERROR: pear.symfony-project.com/symfony not installed

首先用pear config-show命令 ,查看一下相应的路径是否正确。

如果不正确,先修正一下。

用pear upgrade symfony/symfony升级到symfony 1.0

对于0.63的老项目升级,进入项目目录,更改项目目录下的symfony文件,添加内容如下:

  1. #!/usr/bin/env php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) 2004-2006 Fabien Potencier
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. chdir(dirname(__FILE__));
  10. include('config/config.php');
  11. include($sf_symfony_data_dir.'/bin/symfony.php');

修改项目目录下的config/config.php文件,添加如下:

  1. // symfony directories
  2. $sf_symfony_lib_dir = 'D:\php-5.1.6-Win32\pear/symfony';
  3. $sf_symfony_data_dir = 'D:\php-5.1.6-Win32\pear\data/symfony';

执行

symfony upgrade 1.0
symfony propel-build-model
symfony cc

如果老项目的模版页面使用过form_error函数,那么在模版页面上添加

  1. use_helper('Validation')

在action中如果使用过$this->addJavascript('css');这样的语句要修改成

  1. $response = $this->getResponse();
  2. $response->addJavascript('css');

至此,symfony及老项目就都升级到1.0版本了。

  3 Responses to “成功升级到symfony1.0”

  1. 这是啥玩意儿?

  2. 一个懒人用的framework

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 刘敏的Blog Suffusion theme by Sayontan Sinha