repoModule
extends module
in package
Module base model
Tags
Table of Contents
- STATUS_DISABLED = 1005
- STATUS_ENABLED = 1004
- STATUS_INSTALLED = 1001
- STATUS_NOT_DISABLED = -1005
- STATUS_NOT_ENABLED = -1004
- STATUS_NOT_INSTALLED = -1001
- STATUS_NOT_UNINSTALLED = -1002
- STATUS_UNINSTALLED = 1002
- $active : bool
- Module active status
- $basePath : string
- Module base path
- $cache : cache
- Cache object
- $config : config
- Module configuration
- $db : database
- Databse object
- $id : int
- Dataset id
- $initDb : bool
- Initialize object from database
- $installed : bool
- Module installed status
- $mkey : string
- Module key
- $paths : paths
- Module data paths handler
- $prefix : string
- Module prefix VENDOR_KEY
- $systemConfig : config
- System config object
- __construct() : bool
- Konstruktor
- addModule() : bool
- Add module entry to database
- createDataFolder() : bool
- Create module data path
- createFromDbObject() : bool
- Initialize object with database data
- createFromRepoArray() : bool
- Initialize object with database data
- disable() : bool
- Disable module
- enable() : bool
- Enable module
- fromPath() : paths
- getConfig() : config
- Fetch module config
- getConfigByKey() : string
- Get config file path
- getConfigureFields() : array<string|int, mixed>
- Fetch module configuration config from configure.yml
- getConfigViewVars() : array<string|int, mixed>
- Return additional vars for configure view
- getControllerNamespace() : string
- Get module controller class name
- getCronNamespace() : string
- Return Namespace of module cronjobs
- getDataPath() : string
- Get module data path
- getEventNamespace() : string
- Get module event class name
- getFullPrefix() : string
- Fetch complete module prefix
- getId() : int
- Fetch dataset ID
- getJsDirByKey() : string
- Get JS file path
- getKey() : string
- Return module key
- getKeyFromClass() : string
- fetch module key from class name
- getKeyFromFilename() : string
- fetch module key from filename
- getKeyFromPath() : string
- fetch module key from filepath
- getLanguageFileByKey() : string
- Get language file path
- getLanguageVarPrefixed() : string
- Assign module language variable prefix
- getMigrationNamespace() : string
- Return Namespace of module migrations
- getMigrations() : array<string|int, mixed>
- Returns list of migrations
- getModuleBasePathFromKey() : string
- Get base path from module
- getModuleUrlFromKey() : string
- Returns root URL for module path
- getOption() : mixed
- Fetch system config options
- getOptions() : array<string|int, mixed>
- Fetch system config options
- getStyleDirByKey() : string
- Get CSS file path
- getTemplateDirByKey() : string
- Get template file path
- hasConfigure() : bool
- Check if configure action should be displayed
- hasFilesListFile() : bool
- Check if config/files.txt file exists
- hasLocalUpdates() : bool
- Checks if file system version number matches module.yml data
- hasMigrations() : bool
- Check if config/migrations/v*.php exists
- hasUpdates() : bool
- Check if module has updates
- init() : bool
- Initialize repo module
- install() : bool
- Install module
- isActive() : bool
- Return active status
- isInstallable() : bool
- Check if module is installed
- isInstalled() : bool
- Return installed status
- isWritable() : bool
- Check if module base folder and module.yml file are writable
- prepareSaveOptions() : bool
- Prepares module config options before saving
- removeDataFolder() : bool
- Delete module data path
- setActive() : $this
- Set active status
- setInstalled() : $this
- Set installed status
- setOptions() : bool
- Updates module options
- uninstall() : bool
- Uninstall module
- update() : bool
- Update module
- validateKey() : bool
- Validate module key
- initObjects() : bool
- Initialize objects
- createTable() : bool
- Create module config
- getAllConfigOptions() : array<string|int, mixed>
- Fetch module system config options
- getConfigPathFromCurrent() : string
- Return path for "config/" folder in current module base path
- getTableFiles() : array<string|int, mixed>
- Return list of table files from module
- getVersionStrings() : void
- Get PHP- and System Version string
- getYaTdlObject() : bool|yatdl
- Fetch \fpcm\model\system\yatdl object
- installConfig() : bool
- Create module config options
- installTables() : bool
- Create module tables
- installUpdateCronjobs() : bool
- Create module config options
- removeConfig() : bool
- Remove module config
- removeCronjobs() : bool
- Create module config options
- removeFiles() : bool
- Remove module files
- removeFullPrefix() : string
- Remove module prefix
- removeModule() : bool
- Remove module database entry
- removeTables() : bool
- Remove module tables
- runMigrations() : bool
- Executes module-defined migrations on update
- updateConfig() : bool
- Update module config
- updateModule() : bool|int
- Update module databse entry
- updateTables() : bool
- Update module tables
Constants
STATUS_DISABLED
public
mixed
STATUS_DISABLED
= 1005
STATUS_ENABLED
public
mixed
STATUS_ENABLED
= 1004
STATUS_INSTALLED
public
mixed
STATUS_INSTALLED
= 1001
STATUS_NOT_DISABLED
public
mixed
STATUS_NOT_DISABLED
= -1005
STATUS_NOT_ENABLED
public
mixed
STATUS_NOT_ENABLED
= -1004
STATUS_NOT_INSTALLED
public
mixed
STATUS_NOT_INSTALLED
= -1001
STATUS_NOT_UNINSTALLED
public
mixed
STATUS_NOT_UNINSTALLED
= -1002
STATUS_UNINSTALLED
public
mixed
STATUS_UNINSTALLED
= 1002
Properties
$active
Module active status
protected
bool
$active
= 0
$basePath
Module base path
protected
string
$basePath
= ''
Tags
$cache
Cache object
protected
cache
$cache
$config
Module configuration
protected
config
$config
$db
Databse object
protected
database
$db
$id
Dataset id
protected
int
$id
= 0
$initDb
Initialize object from database
protected
bool
$initDb
$installed
Module installed status
protected
bool
$installed
= 0
$mkey
Module key
protected
string
$mkey
= ''
$paths
Module data paths handler
protected
paths
$paths
$prefix
Module prefix VENDOR_KEY
protected
string
$prefix
= ''
$systemConfig
System config object
protected
config
$systemConfig
Methods
__construct()
Konstruktor
public
final __construct(string $key[, bool $initDb = true ]) : bool
Parameters
- $key : string
- $initDb : bool = true
Return values
bool —addModule()
Add module entry to database
public
addModule([bool $fromDir = false ]) : bool
Parameters
- $fromDir : bool = false
Return values
bool —createDataFolder()
Create module data path
public
final createDataFolder() : bool
Tags
Return values
bool —createFromDbObject()
Initialize object with database data
public
createFromDbObject(object $result) : bool
Parameters
- $result : object
Return values
bool —createFromRepoArray()
Initialize object with database data
public
createFromRepoArray(object $result) : bool
Parameters
- $result : object
Return values
bool —disable()
Disable module
public
disable() : bool
Return values
bool —enable()
Enable module
public
enable() : bool
Return values
bool —fromPath()
public
final fromPath() : paths
Tags
Return values
paths —getConfig()
Fetch module config
public
getConfig() : config
Return values
config —getConfigByKey()
Get config file path
public
static getConfigByKey(string $key, string $config) : string
Parameters
- $key : string
- $config : string
Return values
string —getConfigureFields()
Fetch module configuration config from configure.yml
public
getConfigureFields() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getConfigViewVars()
Return additional vars for configure view
public
getConfigViewVars() : array<string|int, mixed>
Return values
array<string|int, mixed> —getControllerNamespace()
Get module controller class name
public
static getControllerNamespace(string $key, string $event) : string
Parameters
- $key : string
- $event : string
Return values
string —getCronNamespace()
Return Namespace of module cronjobs
public
static getCronNamespace(string $key, string $cron) : string
Parameters
- $key : string
- $cron : string
Tags
Return values
string —getDataPath()
Get module data path
public
final getDataPath() : string
Tags
Return values
string —getEventNamespace()
Get module event class name
public
static getEventNamespace(string $key, string $event) : string
Parameters
- $key : string
- $event : string
Return values
string —getFullPrefix()
Fetch complete module prefix
public
getFullPrefix([string $key = '' ]) : string
Parameters
- $key : string = ''
Return values
string —getId()
Fetch dataset ID
public
final getId() : int
Return values
int —getJsDirByKey()
Get JS file path
public
static getJsDirByKey(string $key, string $filePath) : string
Parameters
- $key : string
- $filePath : string
Tags
Return values
string —getKey()
Return module key
public
getKey() : string
Return values
string —getKeyFromClass()
fetch module key from class name
public
static getKeyFromClass(string $class) : string
Parameters
- $class : string
Return values
string —getKeyFromFilename()
fetch module key from filename
public
static getKeyFromFilename(string $filename) : string
Parameters
- $filename : string
Return values
string —getKeyFromPath()
fetch module key from filepath
public
static getKeyFromPath(string $path) : string
Parameters
- $path : string
Return values
string —getLanguageFileByKey()
Get language file path
public
static getLanguageFileByKey(string $key, string $langKey) : string
Parameters
- $key : string
- $langKey : string
Return values
string —getLanguageVarPrefixed()
Assign module language variable prefix
public
static getLanguageVarPrefixed(string $key) : string
Parameters
- $key : string
Return values
string —getMigrationNamespace()
Return Namespace of module migrations
public
static getMigrationNamespace(string $key, string $migration) : string
Parameters
- $key : string
- $migration : string
Tags
Return values
string —getMigrations()
Returns list of migrations
public
final getMigrations() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getModuleBasePathFromKey()
Get base path from module
public
static getModuleBasePathFromKey(string $key) : string
Parameters
- $key : string
Tags
Return values
string —getModuleUrlFromKey()
Returns root URL for module path
public
static getModuleUrlFromKey(string $key) : string
Parameters
- $key : string
Tags
Return values
string —getOption()
Fetch system config options
public
final getOption(string $key) : mixed
Parameters
- $key : string
Return values
mixed —getOptions()
Fetch system config options
public
final getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getStyleDirByKey()
Get CSS file path
public
static getStyleDirByKey(string $key, string $filePath) : string
Parameters
- $key : string
- $filePath : string
Tags
Return values
string —getTemplateDirByKey()
Get template file path
public
static getTemplateDirByKey(string $key, string $viewName) : string
Parameters
- $key : string
- $viewName : string
Return values
string —hasConfigure()
Check if configure action should be displayed
public
hasConfigure() : bool
Return values
bool —hasFilesListFile()
Check if config/files.txt file exists
public
final hasFilesListFile() : bool
Tags
Return values
bool —hasLocalUpdates()
Checks if file system version number matches module.yml data
public
hasLocalUpdates() : bool
Tags
Return values
bool —hasMigrations()
Check if config/migrations/v*.php exists
public
final hasMigrations() : bool
Tags
Return values
bool —hasUpdates()
Check if module has updates
public
hasUpdates() : bool
Return values
bool —init()
Initialize repo module
public
init() : bool
Return values
bool —install()
Install module
public
final install([bool $fromDir = false ]) : bool
Parameters
- $fromDir : bool = false
Return values
bool —isActive()
Return active status
public
final isActive() : bool
Return values
bool —isInstallable()
Check if module is installed
public
isInstallable() : bool
Return values
bool —isInstalled()
Return installed status
public
final isInstalled() : bool
Return values
bool —isWritable()
Check if module base folder and module.yml file are writable
public
isWritable() : bool
Tags
Return values
bool —prepareSaveOptions()
Prepares module config options before saving
public
prepareSaveOptions(array<string|int, mixed> &$options) : bool
Parameters
- $options : array<string|int, mixed>
Return values
bool —removeDataFolder()
Delete module data path
public
final removeDataFolder() : bool
Tags
Return values
bool —setActive()
Set active status
public
final setActive(bool $active) : $this
Parameters
- $active : bool
Return values
$this —setInstalled()
Set installed status
public
final setInstalled(bool $installed) : $this
Parameters
- $installed : bool
Return values
$this —setOptions()
Updates module options
public
final setOptions(array<string|int, mixed> $options) : bool
Parameters
- $options : array<string|int, mixed>
Return values
bool —uninstall()
Uninstall module
public
final uninstall([bool $delete = false ][, bool $keepFiles = false ]) : bool
Parameters
- $delete : bool = false
- $keepFiles : bool = false
Return values
bool —update()
Update module
public
final update() : bool
Return values
bool —validateKey()
Validate module key
public
static validateKey(string $key) : bool
Parameters
- $key : string
Tags
Return values
bool —initObjects()
Initialize objects
protected
initObjects() : bool
Return values
bool —createTable()
Create module config
private
createTable(yatdl $tab) : bool
Parameters
- $tab : yatdl
Return values
bool —getAllConfigOptions()
Fetch module system config options
private
getAllConfigOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getConfigPathFromCurrent()
Return path for "config/" folder in current module base path
private
getConfigPathFromCurrent(string $dest) : string
Parameters
- $dest : string
Tags
Return values
string —getTableFiles()
Return list of table files from module
private
getTableFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —getVersionStrings()
Get PHP- and System Version string
private
getVersionStrings(string &$phpVersion, string &$sysVersion[, array<string|int, mixed> $data = [] ]) : void
Parameters
- $phpVersion : string
- $sysVersion : string
- $data : array<string|int, mixed> = []
Tags
Return values
void —getYaTdlObject()
Fetch \fpcm\model\system\yatdl object
private
getYaTdlObject(string $tableFile) : bool|yatdl
Parameters
- $tableFile : string
Return values
bool|yatdl —installConfig()
Create module config options
private
installConfig() : bool
Return values
bool —installTables()
Create module tables
private
installTables() : bool
Return values
bool —installUpdateCronjobs()
Create module config options
private
installUpdateCronjobs() : bool
Return values
bool —removeConfig()
Remove module config
private
removeConfig() : bool
Return values
bool —removeCronjobs()
Create module config options
private
removeCronjobs() : bool
Return values
bool —removeFiles()
Remove module files
private
removeFiles() : bool
Return values
bool —removeFullPrefix()
Remove module prefix
private
removeFullPrefix([string $key = '' ]) : string
Parameters
- $key : string = ''
Return values
string —removeModule()
Remove module database entry
private
removeModule() : bool
Return values
bool —removeTables()
Remove module tables
private
removeTables() : bool
Return values
bool —runMigrations()
Executes module-defined migrations on update
private
runMigrations() : bool
Tags
Return values
bool —updateConfig()
Update module config
private
updateConfig() : bool
Return values
bool —updateModule()
Update module databse entry
private
updateModule() : bool|int
Return values
bool|int —updateTables()
Update module tables
private
updateTables() : bool