2013年1月17日

Symfony2 多数据库连接

摘要: 一、在app/config/parameters.ini里配置; These parameters can be imported into other config files; by enclosing the key with % (like %database_user%); Comments start with ';', as in php.ini[parameters] database_driver = pdo_mysql database_host = 192.168.0.1 database_port = database_nam... 阅读全文

posted @ 2013-01-17 12:55 d&lufd 阅读(948) 评论(0) 推荐(0) 编辑

Symfony2 Console Component开发

摘要: 在Symfony2中可以用命令行调用并运行你的程序,这在需要设置定时任务时十分方便。我们只需把要执行的逻辑操作按照框架命令行接口的格式写好,然后通过终端进入项目根目录,运行命令即可。 一、在Bundle下新建一个文件夹Command用来存放我们要编写的命令 runCommand.php<?php/** * Description of runCommand * * @author dluf */namespace Acme\DemoBundle\Command;use Symfony\Bundle\FrameworkBundle\Controller\Controller;use Sy. 阅读全文

posted @ 2013-01-17 10:43 d&lufd 阅读(567) 评论(0) 推荐(0) 编辑

导航