class Modsetup

Module Setup Class Helper for module installation

Traits

Properties

$module
static array $sql_fieldtypes
bool $silent
array $messages
array $errors
bool $execute_sql
array $sql_queue
bool $testrun

Methods

bool
add_module_to_registry(string $module_name, int|false $version, bool|string $package_name = false, bool|string $package_version = false, string $vendor = 'auto')

No description

check_config_page($module, $instance = false, $execute_sql = false)

No description

check_config_variables($module, $instance = false, $execute_sql = false)

No description

check_cron($module, $instance = false)

No description

check_daemon(mixed $module, mixed $instance = false)

Check and Install Daemons

check_policies($module, $instance, $instance_details = false)

No description

check_shellplugin_availability($type = false, $name = false)

Checks all registered integrations for their availability and updates the integration database

check_systemconfig_variables($module)

No description

bool
create_datasources($instance_name, $module_name)

No description

bool
create_dependencies($instance_id, $module, $dependencies_settings = false)

No description

array
create_structure_array(array $structure, string $table_name)

No description

void
create_table_by_structure($name, $structure, $instance_id = false)

No description

create_tables($instance_id, $module, string $table_prefix = "xm_test_", bool $i18n_check = true)

No description

drop_all_tables($really)

No description

drop_tables($module, $table_prefix, $truncate = false)

No description

end_install_transaction($transaction)

closes given transaction and returns

execute_sql_queue()

No description

static array
getSystemMaintenanceInfo()

Get Maintenance Info

array
get_config_group_details(string $instance_id, bool|string $module_name = false)

No description

get_config_values($instance_id, $module_id = false)

No description

array
get_config_yml(mixed $module, $vendor = false, $keep_language_markers = false)

Get config.yml values for a module

array
get_database_yml(mixed $module, $i18n = 'auto')

Get config.yml values for a module

array
get_dependencies_check_array($module, $details = true)

No description

get_dependency_values($instance_id, $module_name = false)

No description

array|bool
get_schema($module, $config_file, bool $vendor = false, bool $keep_language_markers = false)

No description

get_shellplugin_usage_list()

Returns an array with information about each shellplugin's usage by the installed modules

static ?string
get_system_maintenance_message()

If system is in maintenance mode, the maintenance message is returned. Otherwise false

get_table_prefix($instance_id)

No description

init()

No description

bool
insert_default_config($instance_id, $module)

No description

bool
insert_document_registry($instance_id, $module)

No description

array
insert_initial_values($module, $instance = false, $execute = false, $sources = array('sql', 'yml'))

No description

bool
insert_notification_registry(string $instance_id, string $module, bool $overwrite = true)

No description

bool
insert_pages_to_navigation($instance_name, $module_name, $normal_node = false, $admin_node = false, $instance_title = false, $insert_only_missing = false)

No description

bool
insert_provided_hooks($instance_id, $module)

No description

int
install_new_instance($module, $instance_id, $instance_title = false, $instance_details = array(), $root_nodes = array(), $custom_values = array(), $add_navigation = true)

No description

bool
isRequiredDependency(string $module)

No description

static 
is_system_maintenance()

Return true if system is in maintenance mode

loadSeed(string $instance_id, string[] $seeds = ["base"], int $group_id = 0, string|null $templateModule = null)

Starts the seeding of the passed instance with the passed seed (if existing)

from  Seeding
log($message)

No description

prepareInstallation()

No description

from  Seeding
bool
register_all_pages($instance_name, $module_name, $instance_details = false)

No description

int
register_instance(string $instance_name, string $module, array $instance_details = array())

No description

bool
remove_document_registration($instance_id)

No description

bool
remove_instance_cron($instance_id, $module = false)

No description

bool
remove_instance_daemon($instance_id, $module = false)

No description

bool
remove_instance_datasource($instance_id)

No description

bool
remove_instance_filesource($instance_id)

No description

bool
remove_instance_from_config($instance_id)

No description

bool
remove_instance_from_navigation($instance_id)

No description

bool
remove_instance_from_pages($instance_id)

No description

bool
remove_instance_from_policy($instance_id, $module = false)

No description

bool
remove_instance_from_registry($instance_id)

No description

bool
remove_instance_hook($instance_id)

No description

remove_language_marker(mixed $item, mixed $key)

Callback to remove language markers from passed text (e.g. +++....+++)

bool
remove_notification_registration($instance_id)

No description

resetInstallation($delete_xelos_installation = false)

No description

from  Seeding
string
revisionToVersion(int $revision)

Return XELOS version for the supplied build number in PHP style notation e.g. 7.1.5 for use with version_compare()

bool
runSeedScript(string $seed_script, bool $additional_default_seeds = false, bool $ignoreCache = false, string|null $templateModule = null)

Runs a Seed Script YML which contains a seeding plan The scripts must be available in the system's setup/seeds/ folder

from  Seeding
bool
save_configuration($instance, $module, $values)

No description

set_initial_version_check($framework = true)

No description

set_module(mixed $module, mixed $vendor = false)

Set currently active module

set_path_rights(bool $include_files = false)

Set path rights in XELOS

static 
set_system_maintenance(string|null $message = null, string|null $byPassToken = null)

Set the system to maintenance mode -> Maintenance Page is being shown, Daemons stopping automaticaly and Crons are no longer executed

bool
start_install_transaction($transaction)

check if there is still a transaction open - if so return false if no transaction is open, open one and return true

trigger_event(string $event, bool|string $module = false, bool $instance_id = false, bool $install_event_revision = false)

No description

bool
uninstall_instance($instance_id)

No description

static 
unset_system_maintenance()

Return to normal execution. Pages are deleiverd normaly, Crons are executed, Daemons have to be started manually or by cron!

bool|null
update_composer_dependencies()

Run Composer Shell Command to update dependencies

update_datasource($module, $table_prefix, $db_schema)

No description

bool
update_module(mixed $module_name, mixed $silent = true, mixed $instance_id = false, bool $update_dependencies = true)

Update module

update_shellplugin_dependencies(string $module, bool|string $instance = false)

Updates the ShellPlugin registry with the information provided by the module and adds missing integration data

bool
update_tokens(string $module_name)

Updates all tokens of the specified module in the database

Details

at line 4631
bool add_module_to_registry(string $module_name, int|false $version, bool|string $package_name = false, bool|string $package_version = false, string $vendor = 'auto')

No description

Parameters

string $module_name

module name

int|false $version

version (build)

bool|string $package_name

package name

bool|string $package_version

package varsion

string $vendor

vendor id

Return Value

bool

at line 1081
check_config_page($module, $instance = false, $execute_sql = false)

No description

Parameters

$module
$instance
$execute_sql

at line 900
check_config_variables($module, $instance = false, $execute_sql = false)

No description

Parameters

$module
$instance
$execute_sql

at line 2227
check_cron($module, $instance = false)

No description

Parameters

$module
$instance

at line 2353
check_daemon(mixed $module, mixed $instance = false)

Check and Install Daemons

Parameters

mixed $module
mixed $instance

at line 2476
check_policies($module, $instance, $instance_details = false)

No description

Parameters

$module
$instance
$instance_details

at line 3490
check_shellplugin_availability($type = false, $name = false)

Checks all registered integrations for their availability and updates the integration database

Parameters

$type
$name

at line 1397
check_systemconfig_variables($module)

No description

Parameters

$module

at line 4350
bool compare_pages_and_instance_registry()

No description

Return Value

bool

false if there are pages not registered in registry

at line 2802
create_datasources($instance_name, $module_name)

No description

Parameters

$instance_name
$module_name

at line 3098
bool create_dependencies($instance_id, $module, $dependencies_settings = false)

No description

avoid dependency loop -> forum needs news needs forum needs news etc.

Parameters

$instance_id
$module
$dependencies_settings

Return Value

bool success

at line 366
array create_structure_array(array $structure, string $table_name)

No description

Parameters

array $structure

YAML structure parameters

string $table_name

Return Value

array

$table_name Table structure array

at line 695
void create_table_by_structure($name, $structure, $instance_id = false)

No description

Parameters

$name
$structure
$instance_id

Return Value

void

at line 296
create_tables($instance_id, $module, string $table_prefix = "xm_test_", bool $i18n_check = true)

internal  param string $ instance name
internal  param string $ module name
internal  param string $ table prefix
 

No description

Parameters

$instance_id
$module
string $table_prefix
bool $i18n_check

at line 272
drop_all_tables($really)

No description

Parameters

$really

at line 252
drop_tables($module, $table_prefix, $truncate = false)

No description

Parameters

$module
$table_prefix
$truncate

at line 4523
end_install_transaction($transaction)

closes given transaction and returns

Parameters

$transaction

at line 847
execute_sql_queue()

No description

at line 5682
static array getSystemMaintenanceInfo()

Get Maintenance Info

Return Value

array

= ['message'=>'','token'=>'','is_maintenance' => true|false]

at line 2206
array get_config_group_details(string $instance_id, bool|string $module_name = false)

No description

Parameters

string $instance_id

instance id

bool|string $module_name

module name

Return Value

array

at line 1985
get_config_values($instance_id, $module_id = false)

No description

Parameters

$instance_id
$module_id

at line 3562
array get_config_yml(mixed $module, $vendor = false, $keep_language_markers = false)

Get config.yml values for a module

Parameters

mixed $module
$vendor
$keep_language_markers

Return Value

array

at line 3573
array get_database_yml(mixed $module, $i18n = 'auto')

Get config.yml values for a module

Parameters

mixed $module
$i18n

Return Value

array

at line 3237
array get_dependencies_check_array($module, $details = true)

No description

Parameters

$module
$details

Return Value

array

containing module as key and result of check as value

at line 2094
get_dependency_values($instance_id, $module_name = false)

No description

Parameters

$instance_id
$module_name

at line 3648
array|bool get_schema($module, $config_file, bool $vendor = false, bool $keep_language_markers = false)

No description

Parameters

$module
$config_file
bool $vendor
bool $keep_language_markers

Return Value

array|bool

at line 3465
get_shellplugin_usage_list()

Returns an array with information about each shellplugin's usage by the installed modules

at line 5673
static ?string get_system_maintenance_message()

If system is in maintenance mode, the maintenance message is returned. Otherwise false

Return Value

?string

at line 2774
get_table_prefix($instance_id)

No description

Parameters

$instance_id

at line 187
init()

No description

at line 2951
bool insert_default_config($instance_id, $module)

No description

Parameters

$instance_id
$module

Return Value

bool

at line 5094
bool insert_document_registry($instance_id, $module)

No description

Parameters

$instance_id
$module

Return Value

bool success

at line 1548
array insert_initial_values($module, $instance = false, $execute = false, $sources = array('sql', 'yml'))

No description

Parameters

$module
$instance
$execute
$sources

Return Value

array

of queries if execute is false, array of success if true

at line 5440
bool insert_notification_registry(string $instance_id, string $module, bool $overwrite = true)

No description

Parameters

string $instance_id

instance name

string $module

module name

bool $overwrite

Return Value

bool success

at line 1688
bool insert_pages_to_navigation($instance_name, $module_name, $normal_node = false, $admin_node = false, $instance_title = false, $insert_only_missing = false)

No description

Parameters

$instance_name
$module_name
$normal_node
$admin_node
$instance_title
$insert_only_missing

Return Value

bool success

at line 3004
bool insert_provided_hooks($instance_id, $module)

No description

Parameters

$instance_id
$module

Return Value

bool success

at line 3711
int install_new_instance($module, $instance_id, $instance_title = false, $instance_details = array(), $root_nodes = array(), $custom_values = array(), $add_navigation = true)

No description

Parameters

$module
$instance_id
$instance_title
$instance_details
$root_nodes
$custom_values
$add_navigation

Return Value

int

Registry ID

at line 5757
bool isRequiredDependency(string $module)

No description

Parameters

string $module

Return Value

bool

at line 5649
static is_system_maintenance()

Return true if system is in maintenance mode

in Seeding at line 262
loadSeed(string $instance_id, string[] $seeds = ["base"], int $group_id = 0, string|null $templateModule = null)

Starts the seeding of the passed instance with the passed seed (if existing)

Parameters

string $instance_id
string[] $seeds
int $group_id
string|null $templateModule

at line 5014
log($message)

No description

Parameters

$message

in Seeding at line 22
prepareInstallation()

No description

at line 2608
bool register_all_pages($instance_name, $module_name, $instance_details = false)

No description

Parameters

$instance_name
$module_name
$instance_details

Return Value

bool success

at line 2716
int register_instance(string $instance_name, string $module, array $instance_details = array())

No description

Parameters

string $instance_name

instance name

string $module

module name

array $instance_details

instance details -> array('title'=>'my title', 'desc'=>'my description')

Return Value

int

DB ID from instance registry

at line 4098
bool remove_document_registration($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

at line 4271
bool remove_instance_cron($instance_id, $module = false)

No description

Parameters

$instance_id
$module

Return Value

bool

success -> message can get via $this->message

at line 4240
bool remove_instance_daemon($instance_id, $module = false)

No description

Parameters

$instance_id
$module

Return Value

bool

success -> message can get via $this->message

at line 4137
bool remove_instance_datasource($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

at line 4194
bool remove_instance_filesource($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

at line 4060
bool remove_instance_from_config($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

at line 3972
bool remove_instance_from_navigation($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

at line 4041
bool remove_instance_from_pages($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

at line 4303
bool remove_instance_from_policy($instance_id, $module = false)

No description

Parameters

$instance_id
$module

Return Value

bool

success -> message can get via $this->message

at line 3953
bool remove_instance_from_registry($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

at line 4079
bool remove_instance_hook($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

at line 3695
remove_language_marker(mixed $item, mixed $key)

Callback to remove language markers from passed text (e.g. +++....+++)

Parameters

mixed $item
mixed $key

at line 4117
bool remove_notification_registration($instance_id)

No description

Parameters

$instance_id

Return Value

bool

success -> message can get via $this->message

in Seeding at line 10
resetInstallation($delete_xelos_installation = false)

No description

Parameters

$delete_xelos_installation

at line 5697
string revisionToVersion(int $revision)

Return XELOS version for the supplied build number in PHP style notation e.g. 7.1.5 for use with version_compare()

Parameters

int $revision

Build Number

Return Value

string

XELOS version as in 7.1.0

in Seeding at line 40
bool runSeedScript(string $seed_script, bool $additional_default_seeds = false, bool $ignoreCache = false, string|null $templateModule = null)

Runs a Seed Script YML which contains a seeding plan The scripts must be available in the system's setup/seeds/ folder

Parameters

string $seed_script

Name of the seed script e.g. base or performance

bool $additional_default_seeds
bool $ignoreCache
string|null $templateModule

Return Value

bool

at line 1958
bool save_configuration($instance, $module, $values)

No description

Parameters

$instance
$module
$values

Return Value

bool success

at line 5568
set_initial_version_check($framework = true)

No description

Parameters

$framework

at line 222
set_module(mixed $module, mixed $vendor = false)

Set currently active module

Parameters

mixed $module
mixed $vendor

at line 5022
set_path_rights(bool $include_files = false)

Set path rights in XELOS

Parameters

bool $include_files

at line 5614
static set_system_maintenance(string|null $message = null, string|null $byPassToken = null)

Set the system to maintenance mode -> Maintenance Page is being shown, Daemons stopping automaticaly and Crons are no longer executed

Parameters

string|null $message

Maintenacen message, default is "Maintenance!'

string|null $byPassToken

Optionally supply a bypass token which enables admins or authorized persons to bypass the maintenance message

at line 4459
bool start_install_transaction($transaction)

check if there is still a transaction open - if so return false if no transaction is open, open one and return true

Parameters

$transaction

Return Value

bool success

at line 4377
trigger_event(string $event, bool|string $module = false, bool $instance_id = false, bool $install_event_revision = false)

No description

Parameters

string $event

event name

bool|string $module

module name; takes cuurent if false

bool $instance_id
bool $install_event_revision

at line 3857
bool uninstall_instance($instance_id)

No description

Parameters

$instance_id

Return Value

bool success

at line 5631
static unset_system_maintenance()

Return to normal execution. Pages are deleiverd normaly, Crons are executed, Daemons have to be started manually or by cron!

at line 4950
bool|null update_composer_dependencies()

Run Composer Shell Command to update dependencies

Return Value

bool|null

True for successful composer update, Null for skipped update

at line 2925
update_datasource($module, $table_prefix, $db_schema)

No description

Parameters

$module
$table_prefix
$db_schema

at line 4784
bool update_module(mixed $module_name, mixed $silent = true, mixed $instance_id = false, bool $update_dependencies = true)

Update module

Parameters

mixed $module_name
mixed $silent
mixed $instance_id
bool $update_dependencies

Return Value

bool

at line 3391
update_shellplugin_dependencies(string $module, bool|string $instance = false)

Updates the ShellPlugin registry with the information provided by the module and adds missing integration data

Parameters

string $module Module
bool|string $instance Instance

at line 3451
bool update_tokens(string $module_name)

Updates all tokens of the specified module in the database

Parameters

string $module_name

Return Value

bool