| Next revision | Previous revision |
| scriptlog:lib:service:migrationservice [2026/09/26 09:09] – admin admin | scriptlog:lib:service:migrationservice [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@category'' | Service Class | | | ''@category'' | Service Class | |
| | ''@author'' | M.Noermoehammad | | | ''@author'' | M.Noermoehammad | |
| | ''@license'' | MIT | | | ''@license'' | MIT | |
| | ''@version'' | 1.0 | | | ''@version'' | 1.0 | |
| | ''@since'' | Since Release 1.0 | | | ''@since'' | Since Release 1.0 | |
| |
| ======= Inheritance ======= | ======= Inheritance ======= |
| ======= Constants (4) ======= | ======= Constants (4) ======= |
| |
| ^ Visibility ^ Name ^ Value ^ Line ^ | ^ Visibility ^ Name ^ Value ^ Line ^ |
| | ''-'' | ''SOURCE_WORDPRESS'' | '''wordpress';'' | 47 | | | ''-'' | ''SOURCE_WORDPRESS'' | '''wordpress';'' | 47 | |
| | ''-'' | ''SOURCE_GHOST'' | '''ghost';'' | 48 | | | ''-'' | ''SOURCE_GHOST'' | '''ghost';'' | 48 | |
| | ''-'' | ''SOURCE_BLOGSPOT'' | '''blogspot';'' | 49 | | | ''-'' | ''SOURCE_BLOGSPOT'' | '''blogspot';'' | 49 | |
| | ''-'' | ''SOURCE_SCRIPTLOG'' | '''scriptlog';'' | 50 | | | ''-'' | ''SOURCE_SCRIPTLOG'' | '''scriptlog';'' | 50 | |
| |
| ======= Properties (2) ======= | ======= Properties (7) ======= |
| |
| ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | ''private'' | ''(untyped)'' | ''$categoryMap'' | ''[];'' | 44 | | | ''private'' | ''(untyped)'' | ''$dbc'' | | 31 | |
| | ''private'' | ''(untyped)'' | ''$postIdMap'' | ''[];'' | 45 | | | ''private'' | ''(untyped)'' | ''$sanitizer'' | | 32 | |
| | | ''private'' | ''(untyped)'' | ''$userDao'' | | 39 | |
| | | ''private'' | ''(untyped)'' | ''$authorId'' | | 41 | |
| | | ''private'' | ''(untyped)'' | ''$importStats'' | | 42 | |
| | | ''private'' | ''(untyped)'' | ''$categoryMap'' | ''[]'' | 44 | |
| | | ''private'' | ''(untyped)'' | ''$postIdMap'' | ''[]'' | 45 | |
| |
| ======= Methods (31) ======= | ======= Methods (31) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''__construct()'' | MigrationService constructor. | 58 | | | public | ''__construct()'' | MigrationService constructor. | 58 | |
| | public | ''setAuthorId()'' | Set author ID for imported content | 85 | | | public | ''setAuthorId()'' | Set author ID for imported content | 85 | |
| | public | ''getStats()'' | Get import statistics | 95 | | | public | ''getStats()'' | Get import statistics | 95 | |
| | public | ''getImportUsers()'' | Get users available as import authors for the import form. | 107 | | | public | ''getImportUsers()'' | Get users available as import authors for the import form. | 107 | |
| | public | ''resetStats()'' | Reset import statistics | 119 | | | public | ''resetStats()'' | Reset import statistics | 119 | |
| | public | ''importFromWordPress()'' | Import content from WordPress WXR file | 142 | | | public | ''importFromWordPress()'' | Import content from WordPress WXR file | 142 | |
| | public | ''importFromGhost()'' | Import content from Ghost JSON file | 177 | | | public | ''importFromGhost()'' | Import content from Ghost JSON file | 177 | |
| | public | ''importFromBlogspot()'' | Import content from Blogspot XML file | 212 | | | public | ''importFromBlogspot()'' | Import content from Blogspot XML file | 212 | |
| | public | ''importFromScriptlog()'' | Import content from Scriptlog native JSON file | 250 | | | public | ''importFromScriptlog()'' | Import content from Scriptlog native JSON file | 250 | |
| | private | ''importScriptlogTopics()'' | Import topics from Scriptlog export | 302 | | | private | ''importScriptlogTopics()'' | Import topics from Scriptlog export | 302 | |
| | private | ''importScriptlogPosts()'' | Import posts from Scriptlog export | 337 | | | private | ''importScriptlogPosts()'' | Import posts from Scriptlog export | 337 | |
| | private | ''importScriptlogPages()'' | Import pages from Scriptlog export | 393 | | | private | ''importScriptlogPages()'' | Import pages from Scriptlog export | 393 | |
| | private | ''importScriptlogComments()'' | Import comments from Scriptlog export | 447 | | | private | ''importScriptlogComments()'' | Import comments from Scriptlog export | 447 | |
| | private | ''importScriptlogMenus()'' | Import menus from Scriptlog export | 490 | | | private | ''importScriptlogMenus()'' | Import menus from Scriptlog export | 490 | |
| | private | ''importScriptlogSettings()'' | Import settings from Scriptlog export | 519 | | | private | ''importScriptlogSettings()'' | Import settings from Scriptlog export | 519 | |
| | public | ''previewImport()'' | Preview import data without importing | 559 | | | public | ''previewImport()'' | Preview import data without importing | 559 | |
| | private | ''importCategories()'' | Import categories/topics | 631 | | | private | ''importCategories()'' | Import categories/topics | 631 | |
| | private | ''importPosts()'' | Import posts | 666 | | | private | ''importPosts()'' | Import posts | 666 | |
| | private | ''importPages()'' | Import pages | 733 | | | private | ''importPages()'' | Import pages | 733 | |
| | private | ''importComments()'' | Import comments | 777 | | | private | ''importComments()'' | Import comments | 777 | |
| | private | ''assignCategories()'' | Assign categories to post | 821 | | | private | ''assignCategories()'' | Assign categories to post | 821 | |
| | private | ''findTopicBySlug()'' | Find topic by slug | 853 | | | private | ''findTopicBySlug()'' | Find topic by slug | 853 | |
| | private | ''findPostBySlug()'' | Find post by slug | 866 | | | private | ''findPostBySlug()'' | Find post by slug | 866 | |
| | private | ''createTopic()'' | Create topic | 880 | | | private | ''createTopic()'' | Create topic | 880 | |
| | private | ''createPost()'' | Create post | 900 | | | private | ''createPost()'' | Create post | 900 | |
| | private | ''createComment()'' | Create comment | 917 | | | private | ''createComment()'' | Create comment | 917 | |
| | private | ''ensureUniqueSlug()'' | Ensure unique slug | 934 | | | private | ''ensureUniqueSlug()'' | Ensure unique slug | 934 | |
| | private | ''sanitizeInput()'' | Sanitize input | 953 | | | private | ''sanitizeInput()'' | Sanitize input | 953 | |
| | private | ''mapStatus()'' | Map post status | 968 | | | private | ''mapStatus()'' | Map post status | 968 | |
| | private | ''mapCommentStatus()'' | Map comment status | 987 | | | private | ''mapCommentStatus()'' | Map comment status | 987 | |
| | private | ''formatDate()'' | Format date | 1007 | | | private | ''formatDate()'' | Format date | 1007 | |
| |
| |
| MigrationService constructor. | MigrationService constructor. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$sanitizer'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | Input sanitizer for import data | | | ''$sanitizer'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | Input sanitizer for import data | |
| | ''$userDao'' | [[scriptlog:lib:dao:userdao|''UserDao'']] | //required// | Data access for import author lookups | | | ''$userDao'' | [[scriptlog:lib:dao:userdao|''UserDao'']] | //required// | Data access for import author lookups | |
| |
| |
| Set author ID for imported content | Set author ID for imported content |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$authorId'' | ''(untyped)'' | //required// | //none// | | | ''$authorId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import content from WordPress WXR file | Import content from WordPress WXR file |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$wxrContent'' | ''(untyped)'' | //required// | //none// | | | ''$wxrContent'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Import content from Ghost JSON file | Import content from Ghost JSON file |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$jsonContent'' | ''(untyped)'' | //required// | //none// | | | ''$jsonContent'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Import content from Blogspot XML file | Import content from Blogspot XML file |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$xmlContent'' | ''(untyped)'' | //required// | //none// | | | ''$xmlContent'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Import content from Scriptlog native JSON file | Import content from Scriptlog native JSON file |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$jsonContent'' | ''(untyped)'' | //required// | //none// | | | ''$jsonContent'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Import topics from Scriptlog export | Import topics from Scriptlog export |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$topics'' | ''(untyped)'' | //required// | //none// | | | ''$topics'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import posts from Scriptlog export | Import posts from Scriptlog export |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$posts'' | ''(untyped)'' | //required// | //none// | | | ''$posts'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import pages from Scriptlog export | Import pages from Scriptlog export |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$pages'' | ''(untyped)'' | //required// | //none// | | | ''$pages'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import comments from Scriptlog export | Import comments from Scriptlog export |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$comments'' | ''(untyped)'' | //required// | //none// | | | ''$comments'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import menus from Scriptlog export | Import menus from Scriptlog export |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$menus'' | ''(untyped)'' | //required// | //none// | | | ''$menus'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import settings from Scriptlog export | Import settings from Scriptlog export |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$settings'' | ''(untyped)'' | //required// | //none// | | | ''$settings'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Preview import data without importing | Preview import data without importing |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$content'' | ''(untyped)'' | //required// | //none// | | | ''$content'' | ''(untyped)'' | //required// | //none// | |
| | ''$source'' | ''(untyped)'' | //required// | //none// | | | ''$source'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Import categories/topics | Import categories/topics |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$categories'' | ''(untyped)'' | //required// | //none// | | | ''$categories'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import posts | Import posts |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$posts'' | ''(untyped)'' | //required// | //none// | | | ''$posts'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import pages | Import pages |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$pages'' | ''(untyped)'' | //required// | //none// | | | ''$pages'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Import comments | Import comments |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$comments'' | ''(untyped)'' | //required// | //none// | | | ''$comments'' | ''(untyped)'' | //required// | //none// | |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Assign categories to post | Assign categories to post |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| | ''$categories'' | ''(untyped)'' | //required// | //none// | | | ''$categories'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Find topic by slug | Find topic by slug |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$slug'' | ''(untyped)'' | //required// | //none// | | | ''$slug'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array|null | **Returns:** ''(none declared)'' — array|null |
| Find post by slug | Find post by slug |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$slug'' | ''(untyped)'' | //required// | //none// | | | ''$slug'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array|null | **Returns:** ''(none declared)'' — array|null |
| Create topic | Create topic |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$name'' | ''(untyped)'' | //required// | //none// | | | ''$name'' | ''(untyped)'' | //required// | //none// | |
| | ''$slug'' | ''(untyped)'' | //required// | //none// | | | ''$slug'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int|false | **Returns:** ''(none declared)'' — int|false |
| Create post | Create post |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''(untyped)'' | //required// | //none// | | | ''$data'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int|false | **Returns:** ''(none declared)'' — int|false |
| Create comment | Create comment |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''(untyped)'' | //required// | //none// | | | ''$data'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int|false | **Returns:** ''(none declared)'' — int|false |
| Ensure unique slug | Ensure unique slug |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$slug'' | ''(untyped)'' | //required// | //none// | | | ''$slug'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Sanitize input | Sanitize input |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$input'' | ''(untyped)'' | //required// | //none// | | | ''$input'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Map post status | Map post status |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$status'' | ''(untyped)'' | //required// | //none// | | | ''$status'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Map comment status | Map comment status |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$status'' | ''(untyped)'' | //required// | //none// | | | ''$status'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| Format date | Format date |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$date'' | ''(untyped)'' | //required// | //none// | | | ''$date'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| ======= Imports ======= | ======= Imports ======= |
| |
| ^ Alias ^ Fully-qualified name ^ | ^ Alias ^ Fully-qualified name ^ |
| | ''ImportException'' | [[scriptlog:lib:core:importexception|''Scriptlog\Core\ImportException'']] | | | ''ImportException'' | [[scriptlog:lib:core:importexception|''Scriptlog\Core\ImportException'']] | |
| | ''Registry'' | [[scriptlog:lib:core:registry|''Scriptlog\Core\Registry'']] | | | ''Registry'' | [[scriptlog:lib:core:registry|''Scriptlog\Core\Registry'']] | |
| | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | | | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | |
| | ''UserDao'' | [[scriptlog:lib:dao:userdao|''Scriptlog\Dao\UserDao'']] | | | ''UserDao'' | [[scriptlog:lib:dao:userdao|''Scriptlog\Dao\UserDao'']] | |
| | ''BlogspotImporter'' | [[scriptlog:lib:utility:blogspotimporter|''BlogspotImporter'']] | | | ''BlogspotImporter'' | [[scriptlog:lib:utility:blogspotimporter|''BlogspotImporter'']] | |
| | ''GhostImporter'' | [[scriptlog:lib:utility:ghostimporter|''GhostImporter'']] | | | ''GhostImporter'' | [[scriptlog:lib:utility:ghostimporter|''GhostImporter'']] | |
| | ''ScriptlogImporter'' | [[scriptlog:lib:utility:scriptlogimporter|''ScriptlogImporter'']] | | | ''ScriptlogImporter'' | [[scriptlog:lib:utility:scriptlogimporter|''ScriptlogImporter'']] | |
| | ''WordPressImporter'' | [[scriptlog:lib:utility:wordpressimporter|''WordPressImporter'']] | | | ''WordPressImporter'' | [[scriptlog:lib:utility:wordpressimporter|''WordPressImporter'']] | |
| |
| |