Dotclear 2.24
Loading...
Searching...
No Matches
dcImportWP Class Reference
Inheritance diagram for dcImportWP:
dcIeModule

Public Member Functions

 init ()
 
 resetVars ()
 
 process (string $do)
 
 gui ()
 
- Public Member Functions inherited from dcIeModule
 __construct ()
 
 init ()
 
 getURL (bool $escape=false)
 
 process (string $do)
 
 gui ()
 

Protected Member Functions

 setInfo ()
 
 guiprocess (string $do)
 
 imForm (int $step, string $legend, ?string $submit_value=null)
 
 error (Exception $e)
 
 db ()
 
 cleanStr (string $str)
 
 importUsers ()
 
 importCategories ()
 
 importLinks ()
 
 importPosts (&$percent)
 
 importPost ($rs, $db)
 
 importComments (string $post_id, int $new_post_id, $db)
 
 importPings (string $post_id, int $new_post_id, $db)
 
 importTags (string $post_id, int $new_post_id, $db)
 
- Protected Member Functions inherited from dcIeModule
 setInfo ()
 
 progressBar (float $percent)
 
 autoSubmit ()
 
 congratMessage ()
 

Protected Attributes

 $con
 
 $prefix
 
 $blog_id
 
 $action = null
 
 $step = 1
 
 $post_offset = 0
 
 $post_limit = 20
 
 $post_count = 0
 
 $has_table = []
 
 $vars
 
 $base_vars
 
 $formaters
 
- Protected Attributes inherited from dcIeModule
 $import_url
 
 $export_url
 
 $url
 

Additional Inherited Members

- Data Fields inherited from dcIeModule
 $type
 
 $id
 
 $name
 
 $description
 

Member Function Documentation

◆ setInfo()

setInfo ( )
protected

Sets the module information.

Reimplemented from dcIeModule.

◆ init()

init ( )

Initializes the module.

Reimplemented from dcIeModule.

References $base_vars, dcCore\app(), and dcAdminCombos\getFormatersCombo().

◆ resetVars()

resetVars ( )

References $base_vars.

Referenced by guiprocess().

◆ process()

process ( string  $do)

Processes the import/export.

Parameters
string$doaction

Reimplemented from dcIeModule.

◆ guiprocess()

guiprocess ( string  $do)
protected

Processes the import/export with GUI feedback.

We handle process in another way to always display something to user

Parameters
string$doaction

References dcCore\app(), db(), dcIeModule\getURL(), importCategories(), importLinks(), importPosts(), importUsers(), dcIeModule\progressBar(), http\redirect(), and resetVars().

Referenced by gui().

◆ gui()

◆ imForm()

imForm ( int  $step,
string  $legend,
?string  $submit_value = null 
)
protected

Return a simple form for step by step process

Parameters
int$stepThe step
string$legendThe legend
string$submit_valueThe submit value
Returns
string

References $step, dcCore\app(), dcIeModule\getURL(), and form\hidden().

Referenced by gui().

◆ error()

error ( Exception  $e)
protected

Error display

Parameters
Exception$eThe error

Referenced by gui().

◆ db()

db ( )
protected

DB init

Exceptions
Exception
Returns
mixed

References dbLayer\init().

Referenced by guiprocess(), importCategories(), importLinks(), importPosts(), and importUsers().

◆ cleanStr()

cleanStr ( string  $str)
protected

Clean a string

Parameters
string$strThe string
Returns
string

References text\cleanUTF8(), and text\toUTF8().

Referenced by importCategories(), importComments(), importLinks(), importPings(), importPost(), importTags(), and importUsers().

◆ importUsers()

importUsers ( )
protected

Users import

References dcCore\app(), cleanStr(), crypt\createPassword(), db(), and dcAuth\USER_TABLE_NAME.

Referenced by guiprocess().

◆ importCategories()

importCategories ( )
protected

Categories import

References $blog_id, dcCategories\CATEGORY_TABLE_NAME, cleanStr(), and db().

Referenced by guiprocess().

◆ importLinks()

importLinks ( )
protected

Blogroll import

References $blog_id, cleanStr(), db(), and dcBlogroll\LINK_TABLE_NAME.

Referenced by guiprocess().

◆ importPosts()

importPosts ( $percent)
protected

Entries import

Parameters
int$percentThe percent
Returns
mixed

References $post_count, $post_limit, db(), importPost(), and dcBlog\POST_TABLE_NAME.

Referenced by guiprocess().

◆ importPost()

importPost (   $rs,
  $db 
)
protected

◆ importComments()

importComments ( string  $post_id,
int  $new_post_id,
  $db 
)
protected

Comments import

Parameters
string$post_idThe post identifier
int$new_post_idThe new post identifier
mixed$dbThe database

References dcCore\app(), cleanStr(), dcBlog\COMMENT_JUNK, dcBlog\COMMENT_PUBLISHED, dcBlog\COMMENT_TABLE_NAME, dcBlog\POST_TABLE_NAME, and text\splitWords().

Referenced by importPost().

◆ importPings()

importPings ( string  $post_id,
int  $new_post_id,
  $db 
)
protected

Pings import

Parameters
string$post_idThe post identifier
int$new_post_idThe new post identifier
mixed$dbThe database

References dcIeModule\$url, cleanStr(), and dcTrackback\PING_TABLE_NAME.

Referenced by importPost().

◆ importTags()

importTags ( string  $post_id,
int  $new_post_id,
  $db 
)
protected

Meta import

Parameters
string$post_idThe post identifier
int$new_post_idThe new post identifier
mixed$dbThe database

References dcCore\app(), and cleanStr().

Referenced by importPost().

Field Documentation

◆ $con

$con
protected

◆ $prefix

$prefix
protected

◆ $blog_id

$blog_id
protected

◆ $action

$action = null
protected

◆ $step

$step = 1
protected

Referenced by imForm().

◆ $post_offset

$post_offset = 0
protected

◆ $post_limit

$post_limit = 20
protected

Referenced by importPosts().

◆ $post_count

$post_count = 0
protected

Referenced by importPosts().

◆ $has_table

$has_table = []
protected

◆ $vars

$vars
protected

◆ $base_vars

$base_vars
protected
Initial value:
= [
'db_host' => '',
'db_name' => '',
'db_user' => '',
'db_pwd' => '',
'db_prefix' => 'wp_',
'ignore_first_cat' => 1,
'cat_import' => 1,
'cat_as_tags' => '',
'cat_tags_prefix' => 'cat: ',
'post_limit' => 20,
'post_formater' => 'xhtml',
'comment_formater' => 'xhtml',
'user_ids' => [],
'cat_ids' => [],
'permalink_template' => 'p=%post_id%',
'permalink_tags' => [
'%year%',
'%monthnum%',
'%day%',
'%hour%',
'%minute%',
'%second%',
'%postname%',
'%post_id%',
'%category%',
'%author%',
],
]

Referenced by init(), and resetVars().

◆ $formaters

$formaters
protected

The documentation for this class was generated from the following file: