Dotclear 2.24
Loading...
Searching...
No Matches
dcImportDC1 Class Reference
Inheritance diagram for dcImportDC1:
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)
 
 importMeta (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
 
- 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, and dcCore\app().

◆ 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(), importMeta(), importPings(), and importPost().

◆ importUsers()

importUsers ( )
protected

◆ 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 progress (in %)
Returns
mixed

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

Referenced by guiprocess().

◆ importPost()

importPost (   $rs,
  $db 
)
protected

Entry import

Parameters
mixed$rsThe record
mixed$dbThe database

References $blog_id, cleanStr(), html\decodeEntities(), importComments(), importMeta(), importPings(), dcBlog\POST_TABLE_NAME, and text\splitWords().

Referenced by importPosts().

◆ 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 cleanStr(), dcBlog\COMMENT_JUNK, dcBlog\COMMENT_PUBLISHED, dcBlog\COMMENT_TABLE_NAME, dcBlog\COMMENT_UNPUBLISHED, 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().

◆ importMeta()

importMeta ( 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_driver' => 'mysqli',
'db_host' => '',
'db_name' => '',
'db_user' => '',
'db_pwd' => '',
'db_prefix' => 'dc_',
'post_limit' => 20,
'cat_ids' => [],
]

Referenced by init(), and resetVars().


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