UNIX艺术

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2013年2月17日

摘要: 软件行业是服务业,面临四面楚歌,内忧外患,既充满矛盾,又是解决矛盾的统一体。软件公司及其工程师身处行业之中,必然面临主动客观问题,必然需要通过调整主观思想,发挥主观能动性,解决好个人发展和企业发展的内部矛盾,在有机的体制下,占领行业的主导地位。 阅读全文
posted @ 2013-02-17 20:02 jinhuawang76 阅读(175) 评论(0) 推荐(0) 编辑

摘要: "^\d+$" //非负整数(正整数 + 0) "^[0-9]*[1-9][0-9]*$" //正整数 "^((-\d+)|(0+))$" //非正整数(负整数 + 0) "^-[0-9]*[1-9][0-9]*$" //负整数 "^-?\d+$" //整数 "^\d+(\.\d+)?$" //非负浮点数(正浮点数 + 0) "^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9] 阅读全文
posted @ 2013-02-17 11:09 jinhuawang76 阅读(132) 评论(0) 推荐(0) 编辑

摘要: 转换网页为PDF文件需要借助第三方提供的免费类包:html2pdf_chinese.rar下载上述类包,并导入需要转换网页的工程中,然后编写网页转换为PDF文件的脚本。脚本示例如下:<?phprequire('html2fpdf.php'); date_default_timezone_set('Etc/GMT-8'); //这里设置了时区$date=date('YmdHis',time());//获取当前时间作为文件名一部分$pdf=new HTML2FPDF();$pdf->AddGBFont('GB',' 阅读全文
posted @ 2013-02-17 11:07 jinhuawang76 阅读(823) 评论(0) 推荐(0) 编辑

摘要: 下面类借助单例模式在Yii中实现访问多个数据库:View Code 1 <?php 2 3 /* 4 * 访问多个MySQL数据库 5 * @Author: jinhuawang76 6 * @Date: 2013/1/12 7 */ 8 9 /**10 * Description of MySQLInstance11 *12 * @author Administrator13 */14 class MySQLInstance {15 16 private static $_instance;17 private $con; // mysql数据库连接18... 阅读全文
posted @ 2013-02-17 11:06 jinhuawang76 阅读(216) 评论(0) 推荐(0) 编辑

摘要: 公司使用的质量管理系统(评审活动、缺陷跟踪和文档库)中,需要与CodeStriker互动,开发如下类实现基本功能。View Code 1 <?php 2 3 /* 4 * 与codestriker的交互类,主要方法如下: 5 * GetTopic(id):根据id查询CI的话题 6 * 2013.1.27: 7 * 目前hardcode了参数:codestriker链接、数据库服务器、端口、 8 * 数据库用户名、密码,需要改为可配置参数。 9 */ 10 11 /** 12 * Description of CodeStriker 13 * 14 *... 阅读全文
posted @ 2013-02-17 11:02 jinhuawang76 阅读(486) 评论(0) 推荐(0) 编辑

摘要: 使用YiiMailMessage发送邮件:安装yii-mail到protected/extension下 配置protected/config/main.php,如下'import' => array(......'application.extensions.yii-mail.*',),......'components' => array('mail' => array( 'class' => 'application.extensions.yii-mail.YiiMail 阅读全文
posted @ 2013-02-17 10:55 jinhuawang76 阅读(268) 评论(0) 推荐(0) 编辑

摘要: 应用执行流程:index.php |require_once($yii) | |------------->yii.php | require(YiiBase.php) | |---------------->YiiBase.php | Define YII_XXX global ... 阅读全文
posted @ 2013-02-17 10:53 jinhuawang76 阅读(247) 评论(0) 推荐(0) 编辑

摘要: 获取控制器和方法的ID转载:http://code.dimilow.com/how-to-get-current-controller-name-and-action-name-in-yii/How to get current controller name and action name in YiiBy Dimi Low on July 7th, 2010 (6 responses)To get current controller name/id inside your controller, or view$controllerId = Yii::app()->controll 阅读全文
posted @ 2013-02-17 10:53 jinhuawang76 阅读(181) 评论(0) 推荐(0) 编辑

摘要: 加载控制器及其方法:根据route信息,获得当前控制器 |初始化当前控制器,CController::init(),默认为空 |执行当前控制器,CController::run() | |----> 创建action,为空则默认为index | 得到CInlineAction的实例 | 用父对象执行beforeControllerAction:默认是CWebApplication,直接返回TRUE ... 阅读全文
posted @ 2013-02-17 10:49 jinhuawang76 阅读(194) 评论(0) 推荐(0) 编辑

摘要: 视图渲染流程:render($view, $data, $return) |beforeRender() |渲染View文件,调用renderPartial(),要求处理输出结果 | |----> 根据$view得到viewFile文件名 | renderFile(),要求返回渲染结果,做下一步处理 | |-----------> 获取widget的数目 | ... 阅读全文
posted @ 2013-02-17 10:47 jinhuawang76 阅读(210) 评论(0) 推荐(0) 编辑

摘要: 应用执行流程:浏览器向服务器发送 Http Request | 控制器(protected/controllers) | |---> Action | 创建模型 (Model) | 检查$_POST输入 | 渲染视图 | render()第二个参数作为控制器与视图接口参数 | |----> View (protected/views) | ... 阅读全文
posted @ 2013-02-17 10:46 jinhuawang76 阅读(233) 评论(0) 推荐(0) 编辑