把Symfony升级到了1.0.14,有个地方需要注意一下,原来用sfMySQLSessionStorage存储session到数据库的,原来是使用timestamps来保存数据的,现在改为用sql date函数了。具体可以看这个改动:http://trac.symfony-project.com/changeset/8664

  1. $connection = Propel::getConnection();
  2.  
  3. $query = 'CALL Proc(%s, %s, %s)';   
  4. $query = sprintf($query, $var1, $var2, $var3);
  5.  
  6. $mysqli = $connection->getResource();
  7. if($mysqli->multi_query($query)){
  8.   do{
  9.     if($result = $mysqli->use_result()){
  10.       while($row = $result->fetch_assoc()){
  11.         //
  12.       }
  13.       $result->free();
  14.     }
  15.   } while(($mysqli->next_result()));
  16. }

这里使用了mysqli

看看有什么新的改动和增强.

  • 新的命令行工具
  • New form subframework
  • 新的插件管理
  • 改善ORM整合
  • 改善Routing
  • 改善国际化(I18N)
  • 改善cache
    • 新的cache factories,可以使用Memcached 或 APC (喜欢)
    • 可以从另外一个应用application清除cache (喜欢,可以从后台应用清除前台应用的cache了)
    • Partials 和 component可以在cache中使用Javascript和样式表了
  • 改善配置文件
  • 改善Unit Test
  • 还有若干个小改动

改动了这么多,原来的老项目能不能顺利升级移植过来是我比较关心的: Continue reading »

在每个虚拟主机的配置文件里添加重写规则:


alias.url = (
"/sf" => "/usr/share/php/data/symfony/web/sf"
)

url.rewrite-once = (
"^/(.*\..+(?!html))$" => "$0",
"^/(.*)\.(.*)" => "$0",
"^/([^.]+)$" => "/index.php/$1",
"^/$" => "/index.php"
)

参考文章:Install Symfony Framework over lighttpd

安装一个插件

symfony plugin-install http://plugins.symfony-project.com/sfPropelActAsNestedSetBehaviorPlugin

相关文档:
http://trac.symfony-project.com/wiki/sfPropelActAsNestedSetBehaviorPlugin

打开symfony官方网站的图片

symfony

© 2011 刘敏的Blog Suffusion theme by Sayontan Sinha