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
| Tag | Value |
|---|---|
@category | Utility |
@author | M.Noermoehammad |
@license | MIT |
@version | 1.0 |
@since | Since Release 1.0 |
No parent, interface or trait. This is a root type.
None.
| Visibility | Type | Name | Default | Line |
|---|---|---|---|---|
private | (untyped) | $xml | 18 | |
private | (untyped) | $wxrVersion | 19 | |
private | (untyped) | $siteUrl | 20 | |
private | (untyped) | $title | 21 |
| 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 |
public function __construct()
lines 23–28 (6)
Takes no parameters.
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
public function getSiteInfo()
lines 73–80 (8)
Get site information
Takes no parameters.
Returns: (none declared) — array
public function getCategories()
lines 87–117 (31)
Extract all categories from WXR
Takes no parameters.
Returns: (none declared) — array
public function getTags()
lines 124–150 (27)
Extract all tags from WXR
Takes no parameters.
Returns: (none declared) — array
public function getPosts()
lines 157–274 (118)
Extract all posts/pages from WXR
Takes no parameters.
Returns: (none declared) — array
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
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
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
private function formatDate($date)
lines 357–365 (9)
Format date string
| Parameter | Type | Default | Description |
|---|---|---|---|
$date | (untyped) | required | none |
Returns: (none declared) — string
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.