Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:service:migrationservice

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:service:migrationservice [2026/09/26 09:09] – admin adminscriptlog:lib:service:migrationservice [2026/09/26 09:34] (current) – admin admin
Line 14: Line 14:
 ======= 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 =======
Line 27: Line 27:
 ======= 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 |
  
  
Line 85: Line 90:
 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 |
  
  
Line 100: Line 105:
 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)''
Line 163: Line 168:
 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
Line 179: Line 184:
 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
Line 195: Line 200:
 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
Line 211: Line 216:
 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
Line 227: Line 232:
 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)''
Line 243: Line 248:
 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)''
Line 259: Line 264:
 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)''
Line 275: Line 280:
 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)''
Line 291: Line 296:
 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)''
Line 307: Line 312:
 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)''
Line 323: Line 328:
 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
Line 340: Line 345:
 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)''
Line 356: Line 361:
 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)''
Line 372: Line 377:
 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)''
Line 388: Line 393:
 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)''
Line 405: Line 410:
 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)''
Line 422: Line 427:
 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
Line 438: Line 443:
 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
Line 454: Line 459:
 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
Line 471: Line 476:
 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
Line 487: Line 492:
 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
Line 503: Line 508:
 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
Line 519: Line 524:
 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
Line 535: Line 540:
 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
Line 551: Line 556:
 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
Line 567: Line 572:
 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
Line 574: Line 579:
 ======= 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'']] |
  
  
scriptlog/lib/service/migrationservice.1790413760.txt.gz · Last modified: by admin