This is an old revision of the document!
Table of Contents
install/include/setup.php
Source: install/include/setup.php · 1958 lines, ~9801 statements · namespace: (global) · `declare(strict_types=1)`: no
File setup.php
These collections of functions to setup installation and write config.php file
Includes
^ Mode ^ Target ^ Line ^ | ''require'' | ''require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'check-engine.php';'' | 15 | | ''require'' | ''require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'dbtable.php';'' | 16 |
Functions (25)
^ Function ^ Line ^ Params ^ Returns ^ Summary ^ | ''current_url'' | 18 | 0 | | File setup.php | | ''friendly_mysql_error'' | 47 | 5 | | friendly_mysql_error() | | ''make_connection'' | 71 | 5 | | make_connection() | | ''make_secure_connection'' | 103 | 6 | | make_secure_connection() | | ''generate_license'' | 131 | 1 | | generate_license() | | ''is_table_exists'' | 180 | 3 | | is_table_exists | | ''check_dbtable'' | 199 | 2 | | function check_dbtable | | ''install_database_table'' | 220 | 11 | | install_database_table() | | ''install_i18n_data'' | 596 | 3 | | install_i18n_data() | | ''install_privacy_policy_data'' | 888 | 2 | | install_privacy_policy_data() | | ''grab_app_key'' | 1088 | 3 | | grab_app_key() | | ''update_app_key'' | 1111 | 4 | | update_app_key() | | ''write_config_file'' | 1137 | 12 | | write_config_file | | ''env_escape'' | 1256 | 1 | | Escape value for .env file format | | ''write_env_file'' | 1278 | 12 | | Write .env file with environment variables | | ''remove_bad_characters'' | 1326 | 8 | | remove_bad_characters() | | ''escapeHTML'' | 1360 | 1 | | Escape HTML Function | | ''installation_key'' | 1371 | 1 | | installation_key | | ''convert_memory_used'' | 1393 | 1 | | convert_memory_used() | | ''setup_base_url'' | 1409 | 2 | | setup_base_url() | | ''purge_installation'' | 1426 | 0 | | purge_installation() | | ''generate_random_key_filename'' | 1464 | 0 | ''string'' | Generate a random filename for encryption key | | ''generate_defuse_key'' | 1483 | 0 | | Generate and save Defuse encryption key outside document root | | ''generate_table_prefix'' | 1536 | 1 | | genereate_table_prefix() | | ''generate_server_config'' | 1569 | 0 | | Generate server config file during installation |
current_url()
public function current_url()
File setup.php
friendly_mysql_error()
public function friendly_mysql_error($errno, $error, $host, $username, $dbname)
friendly_mysql_error()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$errno'' | ''(untyped)'' | //required// | | | ''$error'' | ''(untyped)'' | //required// | | | ''$host'' | ''(untyped)'' | //required// | | | ''$username'' | ''(untyped)'' | //required// | | | ''$dbname'' | ''(untyped)'' | //required// | |
make_connection()
public function make_connection($host, $username, $passwd, $dbname, $dbport)
make_connection()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$host'' | ''(untyped)'' | //required// | | | ''$username'' | ''(untyped)'' | //required// | | | ''$passwd'' | ''(untyped)'' | //required// | | | ''$dbname'' | ''(untyped)'' | //required// | | | ''$dbport'' | ''(untyped)'' | //required// | |
make_secure_connection()
public function make_secure_connection($host, $username, $passwd, $dbname, $dbport, $ca)
make_secure_connection()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$host'' | ''(untyped)'' | //required// | | | ''$username'' | ''(untyped)'' | //required// | | | ''$passwd'' | ''(untyped)'' | //required// | | | ''$dbname'' | ''(untyped)'' | //required// | | | ''$dbport'' | ''(untyped)'' | //required// | | | ''$ca'' | ''(untyped)'' | //required// | |
generate_license()
public function generate_license($suffix = null)
generate_license()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$suffix'' | ''(untyped)'' | ''null'' | |
is_table_exists()
public function is_table_exists($link, $table, $counter = 0)
is_table_exists
^ Parameter ^ Type ^ Default ^ Description ^ | ''$link'' | ''(untyped)'' | //required// | | | ''$table'' | ''(untyped)'' | //required// | | | ''$counter'' | ''(untyped)'' | ''0'' | |
check_dbtable()
public function check_dbtable($link, $table)
function check_dbtable
^ Parameter ^ Type ^ Default ^ Description ^ | ''$link'' | ''(untyped)'' | //required// | | | ''$table'' | ''(untyped)'' | //required// | |
install_database_table()
public function install_database_table($link, $protocol, $server_host, $user_login, $user_pass, $user_email, $key, $prefix = '', $site_language = 'en', $defuse_key_path = '', $dbhost = '')
install_database_table()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$link'' | ''(untyped)'' | //required// | | | ''$protocol'' | ''(untyped)'' | //required// | | | ''$server_host'' | ''(untyped)'' | //required// | | | ''$user_login'' | ''(untyped)'' | //required// | | | ''$user_pass'' | ''(untyped)'' | //required// | | | ''$user_email'' | ''(untyped)'' | //required// | | | ''$key'' | ''(untyped)'' | //required// | | | ''$prefix'' | ''(untyped)'' | '''''' | | | ''$site_language'' | ''(untyped)'' | '''en''' | | | ''$defuse_key_path'' | ''(untyped)'' | '''''' | | | ''$dbhost'' | ''(untyped)'' | '''''' | |
install_i18n_data()
public function install_i18n_data($link, $prefix = '', $default_lang = 'en')
install_i18n_data()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$link'' | ''(untyped)'' | //required// | | | ''$prefix'' | ''(untyped)'' | '''''' | | | ''$default_lang'' | ''(untyped)'' | '''en''' | (language code to set as default) |
install_privacy_policy_data()
public function install_privacy_policy_data($link, $prefix = '')
install_privacy_policy_data()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$link'' | ''(untyped)'' | //required// | | | ''$prefix'' | ''(untyped)'' | '''''' | |
grab_app_key()
public function grab_app_key($mysqli, $key, $prefix = '')
grab_app_key()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$mysqli'' | ''(untyped)'' | //required// | | | ''$key'' | ''(untyped)'' | //required// | | | ''$prefix'' | ''(untyped)'' | '''''' | |
update_app_key()
public function update_app_key($mysqli, $app_key, $id, $prefix = '')
update_app_key()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$mysqli'' | ''(untyped)'' | //required// | | | ''$app_key'' | ''(untyped)'' | //required// | | | ''$id'' | ''(untyped)'' | //required// | | | ''$prefix'' | ''(untyped)'' | '''''' | |
write_config_file()
public function write_config_file($protocol, $server_name, $dbhost, $dbpassword, $dbuser, $dbname, $dbport, $email, $key, $ca, $prefix = '', $defuse_key_path_from_install = '')
write_config_file
^ Parameter ^ Type ^ Default ^ Description ^ | ''$protocol'' | ''(untyped)'' | //required// | | | ''$server_name'' | ''(untyped)'' | //required// | | | ''$dbhost'' | ''(untyped)'' | //required// | | | ''$dbpassword'' | ''(untyped)'' | //required// | | | ''$dbuser'' | ''(untyped)'' | //required// | | | ''$dbname'' | ''(untyped)'' | //required// | | | ''$dbport'' | ''(untyped)'' | //required// | | | ''$email'' | ''(untyped)'' | //required// | | | ''$key'' | ''(untyped)'' | //required// | | | ''$ca'' | ''(untyped)'' | //required// | | | ''$prefix'' | ''(untyped)'' | '''''' | | | ''$defuse_key_path_from_install'' | ''(untyped)'' | '''''' | |
env_escape()
public function env_escape($value)
Escape value for .env file format
^ Parameter ^ Type ^ Default ^ Description ^ | ''$value'' | ''(untyped)'' | //required// | |
write_env_file()
public function write_env_file($protocol, $server_name, $dbhost, $dbuser, $dbpass, $dbname, $dbport, $prefix, $email, $app_key, $distro, $defuse_key_path = '')
Write .env file with environment variables
^ Parameter ^ Type ^ Default ^ Description ^ | ''$protocol'' | ''(untyped)'' | //required// | | | ''$server_name'' | ''(untyped)'' | //required// | | | ''$dbhost'' | ''(untyped)'' | //required// | | | ''$dbuser'' | ''(untyped)'' | //required// | | | ''$dbpass'' | ''(untyped)'' | //required// | | | ''$dbname'' | ''(untyped)'' | //required// | | | ''$dbport'' | ''(untyped)'' | //required// | | | ''$prefix'' | ''(untyped)'' | //required// | | | ''$email'' | ''(untyped)'' | //required// | | | ''$app_key'' | ''(untyped)'' | //required// | | | ''$distro'' | ''(untyped)'' | //required// | | | ''$defuse_key_path'' | ''(untyped)'' | '''''' | |
remove_bad_characters()
public function remove_bad_characters($str_words, $host, $user, $password, $database, $port, $escape = false, $level = 'high')
remove_bad_characters()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$str_words'' | ''(untyped)'' | //required// | | | ''$host'' | ''(untyped)'' | //required// | | | ''$user'' | ''(untyped)'' | //required// | | | ''$password'' | ''(untyped)'' | //required// | | | ''$database'' | ''(untyped)'' | //required// | | | ''$port'' | ''(untyped)'' | //required// | | | ''$escape'' | ''(untyped)'' | ''false'' | | | ''$level'' | ''(untyped)'' | '''high''' | |
escapeHTML()
public function escapeHTML($html)
Escape HTML Function
^ Parameter ^ Type ^ Default ^ Description ^ | ''$html'' | ''(untyped)'' | //required// | |
installation_key()
public function installation_key($length)
installation_key
^ Parameter ^ Type ^ Default ^ Description ^ | ''$length'' | ''(untyped)'' | //required// | |
convert_memory_used()
public function convert_memory_used($size)
convert_memory_used()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$size'' | ''(untyped)'' | //required// | |
setup_base_url()
public function setup_base_url($protocol, $server_host)
setup_base_url()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$protocol'' | ''(untyped)'' | //required// | | | ''$server_host'' | ''(untyped)'' | //required// | |
purge_installation()
public function purge_installation()
purge_installation()
generate_random_key_filename()
public function generate_random_key_filename(): string
Generate a random filename for encryption key
generate_defuse_key()
public function generate_defuse_key()
Generate and save Defuse encryption key outside document root
generate_table_prefix()
public function generate_table_prefix($length = 6)
genereate_table_prefix()
^ Parameter ^ Type ^ Default ^ Description ^ | ''$length'' | ''(untyped)'' | ''6'' | |
generate_server_config()
public function generate_server_config()
Generate server config file during installation
Generated by 'tools/gendoc'.
