FeedModel::_getFeedXml PHP Method

_getFeedXml() public method

获取分享模板的XML文件路径
public _getFeedXml ( boolean $set = false ) : string
$set boolean 是否重新生成分享模板XML文件
return string 分享模板的XML文件路径
    public function _getFeedXml($set = false)
    {
        if ($set || !file_exists(SITE_PATH . '/config/feeds.xml')) {
            $data = D('feed_node')->findAll();
            $xml = "<?xml version='1.0' encoding='UTF-8'?>\n\t\t\t\t\t<root>\n\t\t\t\t\t<feedlist>";
            foreach ($data as $v) {
                $xml .= "\n\t\t\t\t<feed app='{$v['appname']}' type='{$v['nodetype']}' info='{$v['nodeinfo']}'>\n\t\t\t\t" . htmlspecialchars_decode($v['xml']) . '
				</feed>';
            }
            $xml .= '</feedlist>
					</root>';
            file_put_contents(SITE_PATH . '/config/feeds.xml', $xml);
            chmod(SITE_PATH . '/config/feeds.xml', 0666);
        }
        return SITE_PATH . '/config/feeds.xml';
    }