Example #1
0
function commentListGenerate()
{
    global $srkEnv;
    $res = array();
    $fileList = getDirCatalog($srkEnv->penPath);
    foreach ($fileList as $penId) {
        $penCom = commentLoadAll($penId);
        foreach ($penCom as $com) {
            array_push($res, $com);
        }
    }
    $cacheFile = new FileCache();
    $cacheFile->load('commentlist.json');
    $cacheFile->write(json_encode($res));
    return $res;
}
Example #2
0
function penListGenerate()
{
    global $srkEnv;
    $res = array();
    $list = getDirCatalog($srkEnv->penPath);
    foreach ($list as $penId) {
        if (is_file($srkEnv->penPath . '/' . $penId . '/config.json')) {
            $penConf = penConfigLoad($penId);
            array_push($res, $penConf);
        }
    }
    $listCache = new FileCache();
    $listCache->load('penlist.json');
    $listCache->write(json_encode($res));
    return $res;
}