摘要: 在看php-openid的源码的时候,发现它实现的创建多级目录的方法的思想很巧妙,特将起代码记录下来:/***Createdir_nameasadirectoryifitdoesnotexist.Ifit*exists,makesurethatitis,infact,adirectory.Returns*trueiftheoperationsucceeded;falseifnot.**@accessprivate*/staticfunctionensureDir($dir_name){if(is_dir($dir_name)||@mkdir($dir_name)){returntrue;}el 阅读全文
posted @ 2013-02-25 18:06 尹少爷 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Ubuntu上安装sudoapt-getinstallphpunit验证PHPUnit安装成功,命令行输入phpunit$ phpunit安装成功打印:PHPUnit 3.6.11 by Sebastian Bergmann.Usage: phpunit [switches] UnitTest [UnitTest.php]phpunit [switches] <directory>如果出现如下的错误。PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file 阅读全文
posted @ 2013-02-25 16:43 尹少爷 阅读(1936) 评论(2) 推荐(0) 编辑
摘要: 在项目中我们时常会用到session,可是在phreeze里面session是怎样实现的呢, 1 protected function SetCurrentUser(IAuthenticatable $user) 2 { 3 $this->_cu = $user; 4 Authenticator::SetCurrentUser($user,$this->GUID); 5 6 // assign some global variables to the view 7 $this->Assign("CURRENT_USER"... 阅读全文
posted @ 2013-02-25 11:55 尹少爷 阅读(254) 评论(0) 推荐(0) 编辑