PHP Class Services\ModuleInstaller

Mostra file Open project: doptor/doptor Class Usage Examples

Public Methods

Method Description
Unzip ( $file, $path ) : boolean Unzip the module file
__construct ( )
addToBuiltForms ( ) Get the information about the forms used in the module and save/update their entries in the database, so that they can be edited later(if required).
addToBuiltModules ( $module, $form_ids ) Get the information about the module and save/update their entries in the database, so that they can be edited later(if required).
alterTables ( $form ) Alter existing table(s) in DB
copyModule ( $temp_module_dir ) Copy the module from temporary folder to modules
createTables ( $form ) Create new table(s) in DB
dbMigrate ( )
fixInput ( ) : array Fix the input to store in DB
installModule ( $file ) : array Install the module
runMigrations ( )
storeMigrationData ( )
uploadModule ( $file ) : array Upload the module to server

Private Methods

Method Description
checkIfRequiredModulesExist ( ) Check if the modules required for this module exist or not
manageTables ( ) Mange table(s) in DB (CREATE/ALTER)
seedDatabase ( )

Method Details

Unzip() public method

Unzip the module file
public Unzip ( $file, $path ) : boolean
$file
$path
return boolean

__construct() public method

public __construct ( )

addToBuiltForms() public method

Get the information about the forms used in the module and save/update their entries in the database, so that they can be edited later(if required).
public addToBuiltForms ( )

addToBuiltModules() public method

Get the information about the module and save/update their entries in the database, so that they can be edited later(if required).
public addToBuiltModules ( $module, $form_ids )

alterTables() public method

Alter existing table(s) in DB
public alterTables ( $form )
$form

copyModule() public method

Copy the module from temporary folder to modules
public copyModule ( $temp_module_dir )
$temp_module_dir

createTables() public method

Create new table(s) in DB
public createTables ( $form )
$form

dbMigrate() public method

public dbMigrate ( )

fixInput() public method

Fix the input to store in DB
public fixInput ( ) : array
return array

installModule() public method

Install the module
public installModule ( $file ) : array
$file
return array $input

runMigrations() public method

public runMigrations ( )

storeMigrationData() public method

public storeMigrationData ( )

uploadModule() public method

Upload the module to server
public uploadModule ( $file ) : array
$file
return array