示例#1
0
文件: util.php 项目: hgwr/stechat
function sc_wipeout_content($room, $idstr)
{
    $fp = fopen(sc_dat_filename($room), "w");
    if (flock($fp, LOCK_EX)) {
        fwrite($fp, sc_dat_encode($room) . "\n");
        $output = serialize(array('', $idstr, time(), sc_dat_encode("wiped out"))) . "\n";
        fwrite($fp, $output);
        flock($fp, LOCK_UN);
    }
    fclose($fp);
}
示例#2
0
文件: UtilTest.php 项目: hgwr/stechat
 public function testScDatEncode()
 {
     $a = "hello <b>world</b>";
     $this->assertEquals('hello &lt;b&gt;world&lt;/b&gt;', sc_dat_encode($a));
 }