PHP 클래스 ImportModel, vanilla

상속: extends Gdn_Model
파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$CurrentStep Track what step of this process we're on.
$Data array
$ErrorType Error to return.
$ImportPath File location.
$MaxStepTime Max seconds to run a single step.
$Timer Used for timing various long running methods to break them up into pieces.

보호된 프로퍼티들

프로퍼티 타입 설명
$_MergeSteps Method names in order they are called during a merge.
$_OverwriteSteps Method names in order they are called during a clean slate import from file.
$_OverwriteStepsDb Steps for importing from database.

공개 메소드들

메소드 설명
__construct ( $ImportPath = '' ) Set the import path.
addActivity ( ) : boolean
assignOtherIDs ( ) : boolean
assignUserIDs ( ) : boolean
authenticateAdminUser ( ) : boolean
customFinalization ( ) : boolean
data ( $Key, null $Value = null ) : mixed
defineIndexes ( ) : boolean
defineTables ( ) : boolean
deleteFiles ( )
deleteOverwriteTables ( ) Remove the data from the appropriate tables when we are overwriting the forum.
deleteState ( )
fGetCSV2 ( $fp, string $Delim = ',', string $Quote = '"', string $Escape = "\" ) : array
fromPost ( $Post )
generateSQL ( null $Value = null ) : mixed
getCountSQL ( string $Aggregate, string $ParentTable, string $ChildTable, string $ParentColumnName = '', string $ChildColumnName = '', string $ParentJoinColumn = '', string $ChildJoinColumn = '' ) : Gdn_DataSet Return SQL for updating a count.
getCustomImportModel ( ) Get a custom import model based on the import's source.
getImportHeader ( null $fpin = null ) : array | mixed | string
getPasswordHashMethod ( ) : mixed | string
importExists ( string $Table, string $Column = '' ) : boolean Checks to see of a table and/or column exists in the import data.
initialize ( ) : boolean
insertPermissionTable ( ) : boolean
insertTables ( ) : boolean
insertUserTable ( ) : boolean
isDbSource ( ) : boolean | string
loadState ( )
loadTable ( $Tablename, $Path ) : boolean
loadTableInsert ( string $Tablename, string $Path, boolean $skipHeader = true, integer $chunk = 100 ) : boolean Import a table from a CSV using SQL insert statements.
loadTableType ( boolean $Save = true ) : boolean | mixed | string
loadTables ( ) : boolean
loadUserTable ( ) : boolean
localInfileSupported ( ) : boolean
overwrite ( string $Overwrite = '', string $Email = '', string $Password = '' ) : mixed
parseInfoLine ( $Line ) : array
processImportDb ( ) Process the import tables from the database.
processImportFile ( ) : boolean
query ( string $Sql, array $Parameters = null ) : Gdn_DataSet Run a query, replacing database prefixes.
runStep ( integer $Step = 1 ) : mixed Run the step in the import.
saveSQL ( $CurrentStep )
saveState ( )
setCategoryPermissionIDs ( ) Set the category permissions based on the permission table.
setRoleDefaults ( )
stat ( $Key, null $Value = null, string $Op = 'set' ) : mixed
steps ( ) : array
tables ( string $TableName = '' ) : mixed
toPost ( &$Post )
updateCounts ( ) : boolean
verifyImport ( ) Verify imported data.

보호된 메소드들

메소드 설명
_InsertTable ( $TableName, array $Sets = [] ) : boolean | integer | void
_LoadTableLocalInfile ( $Tablename, $Path )
_LoadTableOnSameServer ( $Tablename, $Path )
_LoadTableWithInsert ( $Tablename, $Path ) : boolean
_assignIDs ( $TableName, null $PrimaryKey = null, null $SecondaryKey = null ) : boolean | void
_setCategoryPermissionIDs ( $Category, $PermissionID, $IDs )
backTick ( $Str ) : string

메소드 상세

_InsertTable() 보호된 메소드

protected _InsertTable ( $TableName, array $Sets = [] ) : boolean | integer | void
$TableName
$Sets array
리턴 boolean | integer | void

_LoadTableLocalInfile() 보호된 메소드

protected _LoadTableLocalInfile ( $Tablename, $Path )
$Tablename
$Path

_LoadTableOnSameServer() 보호된 메소드

protected _LoadTableOnSameServer ( $Tablename, $Path )
$Tablename
$Path

_LoadTableWithInsert() 보호된 메소드

protected _LoadTableWithInsert ( $Tablename, $Path ) : boolean
$Tablename
$Path
리턴 boolean

__construct() 공개 메소드

Set the import path.
public __construct ( $ImportPath = '' )

_assignIDs() 보호된 메소드

protected _assignIDs ( $TableName, null $PrimaryKey = null, null $SecondaryKey = null ) : boolean | void
$TableName
$PrimaryKey null
$SecondaryKey null
리턴 boolean | void

_setCategoryPermissionIDs() 보호된 메소드

protected _setCategoryPermissionIDs ( $Category, $PermissionID, $IDs )
$Category
$PermissionID
$IDs

addActivity() 공개 메소드

public addActivity ( ) : boolean
리턴 boolean

assignOtherIDs() 공개 메소드

public assignOtherIDs ( ) : boolean
리턴 boolean

assignUserIDs() 공개 메소드

public assignUserIDs ( ) : boolean
리턴 boolean

authenticateAdminUser() 공개 메소드

public authenticateAdminUser ( ) : boolean
리턴 boolean

backTick() 보호된 정적인 메소드

protected static backTick ( $Str ) : string
$Str
리턴 string

customFinalization() 공개 메소드

public customFinalization ( ) : boolean
리턴 boolean

data() 공개 메소드

public data ( $Key, null $Value = null ) : mixed
$Key
$Value null
리턴 mixed

defineIndexes() 공개 메소드

public defineIndexes ( ) : boolean
리턴 boolean

defineTables() 공개 메소드

public defineTables ( ) : boolean
리턴 boolean

deleteFiles() 공개 메소드

public deleteFiles ( )

deleteOverwriteTables() 공개 메소드

Remove the data from the appropriate tables when we are overwriting the forum.

deleteState() 공개 메소드

public deleteState ( )

fGetCSV2() 공개 정적인 메소드

public static fGetCSV2 ( $fp, string $Delim = ',', string $Quote = '"', string $Escape = "\" ) : array
$fp
$Delim string
$Quote string
$Escape string
리턴 array

fromPost() 공개 메소드

public fromPost ( $Post )
$Post

generateSQL() 공개 메소드

public generateSQL ( null $Value = null ) : mixed
$Value null
리턴 mixed

getCountSQL() 공개 메소드

Return SQL for updating a count.
public getCountSQL ( string $Aggregate, string $ParentTable, string $ChildTable, string $ParentColumnName = '', string $ChildColumnName = '', string $ParentJoinColumn = '', string $ChildJoinColumn = '' ) : Gdn_DataSet
$Aggregate string count, max, min, etc.
$ParentTable string The name of the parent table.
$ChildTable string The name of the child table
$ParentColumnName string
$ChildColumnName string
$ParentJoinColumn string
$ChildJoinColumn string
리턴 Gdn_DataSet

getCustomImportModel() 공개 메소드

Get a custom import model based on the import's source.

getImportHeader() 공개 메소드

public getImportHeader ( null $fpin = null ) : array | mixed | string
$fpin null
리턴 array | mixed | string

getPasswordHashMethod() 공개 메소드

public getPasswordHashMethod ( ) : mixed | string
리턴 mixed | string

importExists() 공개 메소드

Checks to see of a table and/or column exists in the import data.
public importExists ( string $Table, string $Column = '' ) : boolean
$Table string The name of the table to check for.
$Column string
리턴 boolean

initialize() 공개 메소드

public initialize ( ) : boolean
리턴 boolean

insertPermissionTable() 공개 메소드

public insertPermissionTable ( ) : boolean
리턴 boolean

insertTables() 공개 메소드

public insertTables ( ) : boolean
리턴 boolean

insertUserTable() 공개 메소드

public insertUserTable ( ) : boolean
리턴 boolean

isDbSource() 공개 메소드

public isDbSource ( ) : boolean | string
리턴 boolean | string

loadState() 공개 메소드

public loadState ( )

loadTable() 공개 메소드

public loadTable ( $Tablename, $Path ) : boolean
$Tablename
$Path
리턴 boolean

loadTableInsert() 공개 메소드

Import a table from a CSV using SQL insert statements.
public loadTableInsert ( string $Tablename, string $Path, boolean $skipHeader = true, integer $chunk = 100 ) : boolean
$Tablename string The name of the table to import to.
$Path string The path to the CSV.
$skipHeader boolean Whether the CSV contains a header row.
$chunk integer The number of records to chunk the imports to.
리턴 boolean Whether any records were found.

loadTableType() 공개 메소드

public loadTableType ( boolean $Save = true ) : boolean | mixed | string
$Save boolean
리턴 boolean | mixed | string

loadTables() 공개 메소드

public loadTables ( ) : boolean
리턴 boolean

loadUserTable() 공개 메소드

public loadUserTable ( ) : boolean
리턴 boolean

localInfileSupported() 공개 메소드

public localInfileSupported ( ) : boolean
리턴 boolean

overwrite() 공개 메소드

public overwrite ( string $Overwrite = '', string $Email = '', string $Password = '' ) : mixed
$Overwrite string
$Email string
$Password string
리턴 mixed

parseInfoLine() 공개 메소드

public parseInfoLine ( $Line ) : array
$Line
리턴 array

processImportDb() 공개 메소드

Process the import tables from the database.
public processImportDb ( )

processImportFile() 공개 메소드

public processImportFile ( ) : boolean
리턴 boolean

query() 공개 메소드

Run a query, replacing database prefixes.
public query ( string $Sql, array $Parameters = null ) : Gdn_DataSet
$Sql string The sql to execute. - :_z will be replaced by the import prefix. - :_ will be replaced by the database prefix.
$Parameters array PDO parameters to pass to the query.
리턴 Gdn_DataSet

runStep() 공개 메소드

Run the step in the import.
public runStep ( integer $Step = 1 ) : mixed
$Step integer the step to run.
리턴 mixed Whether the step succeeded or an array of information.

saveSQL() 공개 메소드

public saveSQL ( $CurrentStep )
$CurrentStep

saveState() 공개 메소드

public saveState ( )

setCategoryPermissionIDs() 공개 메소드

Set the category permissions based on the permission table.

setRoleDefaults() 공개 메소드

public setRoleDefaults ( )

stat() 공개 메소드

public stat ( $Key, null $Value = null, string $Op = 'set' ) : mixed
$Key
$Value null
$Op string
리턴 mixed

steps() 공개 메소드

public steps ( ) : array
리턴 array

tables() 공개 메소드

public tables ( string $TableName = '' ) : mixed
$TableName string
리턴 mixed

toPost() 공개 메소드

public toPost ( &$Post )
$Post

updateCounts() 공개 메소드

public updateCounts ( ) : boolean
리턴 boolean

verifyImport() 공개 메소드

Verify imported data.
public verifyImport ( )

프로퍼티 상세

$CurrentStep 공개적으로 프로퍼티

Track what step of this process we're on.
public $CurrentStep

$Data 공개적으로 프로퍼티

public array $Data
리턴 array

$ErrorType 공개적으로 프로퍼티

Error to return.
public $ErrorType

$ImportPath 공개적으로 프로퍼티

File location.
public $ImportPath

$MaxStepTime 공개적으로 프로퍼티

Max seconds to run a single step.
public $MaxStepTime

$Timer 공개적으로 프로퍼티

Used for timing various long running methods to break them up into pieces.
public $Timer

$_MergeSteps 보호되어 있는 프로퍼티

Method names in order they are called during a merge.
protected $_MergeSteps

$_OverwriteSteps 보호되어 있는 프로퍼티

Method names in order they are called during a clean slate import from file.
protected $_OverwriteSteps

$_OverwriteStepsDb 보호되어 있는 프로퍼티

Steps for importing from database.
protected $_OverwriteStepsDb