This is an old revision of the document!
Table of Contents
GhostImporter
Layer: Utility · Source: lib/utility/import-ghost.php:16 (lines 16–383)
class GhostImporter
Ghost JSON Importer Utility
Parses Ghost export JSON 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 (12)
^ Visibility ^ Method ^ Summary ^ Line ^ | public | ''__construct()'' | (undocumented) | 21 | | public | ''parse()'' | Parse JSON file from string | 34 | | private | ''detectSchema()'' | Detect Ghost schema version | 56 | | public | ''getSchema()'' | Get detected schema version | 78 | | public | ''getSiteInfo()'' | Get site information | 88 | | public | ''getPosts()'' | Extract all posts/pages from Ghost export | 113 | | private | ''extractComments()'' | Extract comments from post | 238 | | public | ''getTags()'' | Extract tags from Ghost export | 269 | | public | ''getCategories()'' | Extract categories from Ghost export | 302 | | private | ''mapPostStatus()'' | Map Ghost post status to Blogware status | 339 | | private | ''mapCommentStatus()'' | Map Ghost comment status to Blogware status | 357 | | private | ''formatDate()'' | Format date string | 374 |
__construct()
public function __construct()
lines 21–25 (5)
Takes no parameters.
parse()
public function parse($content)
lines 34–49 (16)
Parse JSON file from string
^ Parameter ^ Type ^ Default ^ Description ^ | ''$content'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — bool
Throws: ImportException
detectSchema()
private function detectSchema()
lines 56–71 (16)
Detect Ghost schema version
Takes no parameters.
Returns: (none declared) — void
getSchema()
public function getSchema()
lines 78–81 (4)
Get detected schema version
Takes no parameters.
Returns: (none declared) — string
getSiteInfo()
public function getSiteInfo()
lines 88–106 (19)
Get site information
Takes no parameters.
Returns: (none declared) — array
getPosts()
public function getPosts()
lines 113–230 (118)
Extract all posts/pages from Ghost export
Takes no parameters.
Returns: (none declared) — array
extractComments()
private function extractComments($post)
lines 238–262 (25)
Extract comments from post
^ Parameter ^ Type ^ Default ^ Description ^ | ''$post'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — array
getTags()
public function getTags()
lines 269–295 (27)
Extract tags from Ghost export
Takes no parameters.
Returns: (none declared) — array
getCategories()
public function getCategories()
lines 302–331 (30)
Extract categories from Ghost export
Takes no parameters.
Returns: (none declared) — array
mapPostStatus()
private function mapPostStatus($status)
lines 339–349 (11)
Map Ghost post status to Blogware status
^ Parameter ^ Type ^ Default ^ Description ^ | ''$status'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — string
mapCommentStatus()
private function mapCommentStatus($status)
lines 357–366 (10)
Map Ghost comment status to Blogware status
^ Parameter ^ Type ^ Default ^ Description ^ | ''$status'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — string
formatDate()
private function formatDate($date)
lines 374–382 (9)
Format date string
^ Parameter ^ Type ^ Default ^ Description ^ | ''$date'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — string
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.
