Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:utility:wordpressimporter

This is an old revision of the document!


WordPressImporter

Layer: Utility · Source: lib/utility/import-wordpress.php:16 (lines 16–387)


class WordPressImporter

WordPress WXR Importer Utility

Parses WordPress eXtended RSS (WXR) export files

Docblock Metadata

^ Tag ^ Value ^
| ''@category'' | Utility |
| ''@author'' | M.Noermoehammad |
| ''@license'' | MIT |
| ''@version'' | 1.0 |
| ''@since'' | Since Release 1.0 |

Inheritance

No parent, interface or trait. This is a root type.

Constants (0)

None.

Properties (0)

None declared.

Methods (11)

^ Visibility ^ Method ^ Summary ^ Line ^
| public | ''__construct()'' | (undocumented) | 23 |
| public | ''parse()'' | Parse WXR file from string | 37 |
| public | ''getSiteInfo()'' | Get site information | 73 |
| public | ''getCategories()'' | Extract all categories from WXR | 87 |
| public | ''getTags()'' | Extract all tags from WXR | 124 |
| public | ''getPosts()'' | Extract all posts/pages from WXR | 157 |
| private | ''getCommentsFromItem()'' | Extract comments from post item | 283 |
| private | ''mapPostStatus()'' | Map WordPress post status to Blogware status | 319 |
| private | ''mapCommentStatus()'' | Map WordPress comment status to Blogware status | 339 |
| private | ''formatDate()'' | Format date string | 357 |
| private | ''cleanXmlContent()'' | Clean XML content | 373 |

__construct()

public function __construct()

lines 23–28 (6)

Takes no parameters.

parse()

public function parse($content)

lines 37–66 (30)

Parse WXR file from string

^ Parameter ^ Type ^ Default ^ Description ^
| ''$content'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — bool

Throws: ImportException

getSiteInfo()

public function getSiteInfo()

lines 73–80 (8)

Get site information

Takes no parameters.

Returns: (none declared) — array

getCategories()

public function getCategories()

lines 87–117 (31)

Extract all categories from WXR

Takes no parameters.

Returns: (none declared) — array

getTags()

public function getTags()

lines 124–150 (27)

Extract all tags from WXR

Takes no parameters.

Returns: (none declared) — array

getPosts()

public function getPosts()

lines 157–274 (118)

Extract all posts/pages from WXR

Takes no parameters.

Returns: (none declared) — array

getCommentsFromItem()

private function getCommentsFromItem($item, $namespaces)

lines 283–311 (29)

Extract comments from post item

^ Parameter ^ Type ^ Default ^ Description ^
| ''$item'' | ''(untyped)'' | //required// | //none// |
| ''$namespaces'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — array

mapPostStatus()

private function mapPostStatus($status)

lines 319–331 (13)

Map WordPress post status to Blogware status

^ Parameter ^ Type ^ Default ^ Description ^
| ''$status'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — string

mapCommentStatus()

private function mapCommentStatus($status)

lines 339–349 (11)

Map WordPress comment status to Blogware status

^ Parameter ^ Type ^ Default ^ Description ^
| ''$status'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — string

formatDate()

private function formatDate($date)

lines 357–365 (9)

Format date string

^ Parameter ^ Type ^ Default ^ Description ^
| ''$date'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — string

cleanXmlContent()

private function cleanXmlContent($content)

lines 373–386 (14)

Clean XML content

^ Parameter ^ Type ^ Default ^ Description ^
| ''$content'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — string


This page is generated from source by 'tools/gendoc'. Edits will be overwritten.

scriptlog/lib/utility/wordpressimporter.1790413763.txt.gz · Last modified: by admin