PHP Class Markdown, gitblog

Author: Sam de Freyssinet
Exibir arquivo Open project: jockchou/gitblog Class Usage Examples

Public Methods

Method Description
__construct ( )
changeFileExt ( $fileName, $ext = "html" ) 修改后缀名
getAllBlogs ( ) 获取所有博客
getAllCategorys ( ) 获取所有分类
getAllTags ( ) 获取所有标签
getAllYearMonths ( ) 获取所有月份
getBlogByCategory ( $categoryId ) 按分类查找博客
getBlogById ( $blogId ) 根据Id获取博客
getBlogByKeyword ( $keyword, $max = 50 ) 按全文关键字查找博客
getBlogByTag ( $tagId ) 按标签查找博客
getBlogByTitle ( $title, $max = 50 ) 按标题关键字查找博客
getBlogByYearMonthId ( $yearMonthId ) 按月份查找博客
getBlogsByPage ( $pageNo, $pageSize ) 博客分页列表
getBlogsPageByCategory ( $categoryId, $pageNo, $pageSize ) 按分类获取分页列表
getBlogsPageByTag ( $tagId, $pageNo, $pageSize ) 按标签获取分页列表
getBlogsPageByYearMonth ( $yearMonthId, $pageNo, $pageSize ) 按月份获取分页列表
getBlogsRecent ( $pageSize ) 最新的博客
getCategoryById ( $categoryId ) 根据Id获取分类
getCategoryTotalPages ( $categoryId, $pageSize ) 获取某个分类的总页数
getTagById ( $tagId ) 根据Id获取标签
getTagTotalPages ( $tagId, $pageSize ) 获取某个标签的总页数
getTotalPages ( $pageSize ) 获取总页数
getYearMonthById ( $yearMonthId ) 根据Id获取月份
getYearMonthTotalPages ( $yearMonthId, $pageSize ) 获取某个月的总页数
initAllBlogData ( $postPath, $enableCache = false ) 加载所有的博客

Private Methods

Method Description
autoCheckBlogProps ( $blogProp ) 自动获取未填写的属性
checkFileExt ( $fileName ) 检查文件名是否是markdown文件
checkObjInArr ( $tagObj, $type )
cleanKeywords2Arr ( $keywordsStr ) 获取标签,分类数组
converStrArr ( $tags, $type ) 将tags, category字符串转成数组
gbReadCache ( $key ) 读缓存
gbWriteCache ( $key, $objdata ) 写缓存
globalDataCacheRead ( ) 从文件缓存中读取数据
globalDataCacheWrite ( ) 缓存全局数据
parseMarkdown ( $text ) 解析markdown文件内容为html文本
readAllPostInfo ( $mdfiles, $postPath ) 读取所有博客的信息
readPostBaseInfo ( $serverPath ) 读取博客的基本信息
sortBlogs ( $blogArray, $sortKey ) 对所有博客排序
sortYearMonths ( ) 对归档日期进行排序
urlencodeFileName ( $fileName ) 对URL中的中文编码

Method Details

__construct() public method

public __construct ( )

changeFileExt() public method

修改后缀名
public changeFileExt ( $fileName, $ext = "html" )

getAllBlogs() public method

获取所有博客
public getAllBlogs ( )

getAllCategorys() public method

获取所有分类
public getAllCategorys ( )

getAllTags() public method

获取所有标签
public getAllTags ( )

getAllYearMonths() public method

获取所有月份
public getAllYearMonths ( )

getBlogByCategory() public method

按分类查找博客
public getBlogByCategory ( $categoryId )

getBlogById() public method

根据Id获取博客
public getBlogById ( $blogId )

getBlogByKeyword() public method

按全文关键字查找博客
public getBlogByKeyword ( $keyword, $max = 50 )

getBlogByTag() public method

按标签查找博客
public getBlogByTag ( $tagId )

getBlogByTitle() public method

按标题关键字查找博客
public getBlogByTitle ( $title, $max = 50 )

getBlogByYearMonthId() public method

按月份查找博客
public getBlogByYearMonthId ( $yearMonthId )

getBlogsByPage() public method

博客分页列表
public getBlogsByPage ( $pageNo, $pageSize )

getBlogsPageByCategory() public method

按分类获取分页列表
public getBlogsPageByCategory ( $categoryId, $pageNo, $pageSize )

getBlogsPageByTag() public method

按标签获取分页列表
public getBlogsPageByTag ( $tagId, $pageNo, $pageSize )

getBlogsPageByYearMonth() public method

按月份获取分页列表
public getBlogsPageByYearMonth ( $yearMonthId, $pageNo, $pageSize )

getBlogsRecent() public method

最新的博客
public getBlogsRecent ( $pageSize )

getCategoryById() public method

根据Id获取分类
public getCategoryById ( $categoryId )

getCategoryTotalPages() public method

获取某个分类的总页数
public getCategoryTotalPages ( $categoryId, $pageSize )

getTagById() public method

根据Id获取标签
public getTagById ( $tagId )

getTagTotalPages() public method

获取某个标签的总页数
public getTagTotalPages ( $tagId, $pageSize )

getTotalPages() public method

获取总页数
public getTotalPages ( $pageSize )

getYearMonthById() public method

根据Id获取月份
public getYearMonthById ( $yearMonthId )

getYearMonthTotalPages() public method

获取某个月的总页数
public getYearMonthTotalPages ( $yearMonthId, $pageSize )

initAllBlogData() public method

加载所有的博客
public initAllBlogData ( $postPath, $enableCache = false )