====== GhostExporter ======
**Layer:** ''Utility'' · **Source:** ''lib/utility/export-ghost.php:16'' (lines 16–379)
----
class GhostExporter
Ghost Exporter Utility
Exports Blogware content to Ghost JSON format
======= 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 (2) =======
^ Visibility ^ Type ^ Name ^ Default ^ Line ^
| ''private'' | ''(untyped)'' | ''$siteUrl'' | | 18 |
| ''private'' | ''(untyped)'' | ''$siteTitle'' | | 19 |
======= Methods (11) =======
^ Visibility ^ Method ^ Summary ^ Line ^
| public | ''__construct()'' | (undocumented) | 21 |
| public | ''export()'' | Export content to Ghost JSON format | 38 |
| private | ''getUsers()'' | Get users for export | 173 |
| private | ''getTags()'' | Get tags for export | 200 |
| private | ''getPosts()'' | Get posts for export | 218 |
| private | ''getPages()'' | Get pages for export | 261 |
| private | ''getPostComments()'' | Get comments for a post | 296 |
| private | ''mapUserRole()'' | Map Blogware user level to Ghost role | 315 |
| private | ''mapPostStatus()'' | Map Blogware post status to Ghost status | 335 |
| private | ''convertHtmlToMarkdown()'' | Convert HTML to Markdown (simplified) | 353 |
| private | ''generateUuid()'' | Generate a UUID-like string | 365 |
======== __construct() ========
public function __construct()
//lines 21–28 (8)//
//Takes no parameters.//
======== export() ========
public function export(&$exportStats, $authorId = null)
//lines 38–165 (128)//
Export content to Ghost JSON format
^ Parameter ^ Type ^ Default ^ Description ^
| ''$exportStats (by reference)'' | ''(untyped)'' | //required// | Reference to stats array to update |
| ''$authorId'' | ''(untyped)'' | ''null'' | Filter by author ID (null for all) |
**Returns:** ''(none declared)'' — string Ghost JSON content
**Throws:** ''ExportException''
======== getUsers() ========
private function getUsers($authorId = null)
//lines 173–193 (21)//
Get users for export
^ Parameter ^ Type ^ Default ^ Description ^
| ''$authorId'' | ''(untyped)'' | ''null'' | //none// |
**Returns:** ''(none declared)'' — array
======== getTags() ========
private function getTags()
//lines 200–210 (11)//
Get tags for export
//Takes no parameters.//
**Returns:** ''(none declared)'' — array
======== getPosts() ========
private function getPosts($authorId = null)
//lines 218–253 (36)//
Get posts for export
^ Parameter ^ Type ^ Default ^ Description ^
| ''$authorId'' | ''(untyped)'' | ''null'' | //none// |
**Returns:** ''(none declared)'' — array
======== getPages() ========
private function getPages($authorId = null)
//lines 261–288 (28)//
Get pages for export
^ Parameter ^ Type ^ Default ^ Description ^
| ''$authorId'' | ''(untyped)'' | ''null'' | //none// |
**Returns:** ''(none declared)'' — array
======== getPostComments() ========
private function getPostComments($postId)
//lines 296–307 (12)//
Get comments for a post
^ Parameter ^ Type ^ Default ^ Description ^
| ''$postId'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — array
======== mapUserRole() ========
private function mapUserRole($userLevel)
//lines 315–327 (13)//
Map Blogware user level to Ghost role
^ Parameter ^ Type ^ Default ^ Description ^
| ''$userLevel'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — string
======== mapPostStatus() ========
private function mapPostStatus($postStatus)
//lines 335–345 (11)//
Map Blogware post status to Ghost status
^ Parameter ^ Type ^ Default ^ Description ^
| ''$postStatus'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — string
======== convertHtmlToMarkdown() ========
private function convertHtmlToMarkdown($html)
//lines 353–358 (6)//
Convert HTML to Markdown (simplified)
^ Parameter ^ Type ^ Default ^ Description ^
| ''$html'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — string
======== generateUuid() ========
private function generateUuid()
//lines 365–378 (14)//
Generate a UUID-like string
//Takes no parameters.//
**Returns:** ''(none declared)'' — string
----
//This page is generated from source by 'tools/gendoc'. Edits will be overwritten.//