Documentation

upgrade.php

Simple Machines Forum (SMF)

Tags
author

Simple Machines https://www.simplemachines.org

copyright

2025 Simple Machines and individual contributors

license

https://www.simplemachines.org/about/smf/license.php BSD

version
3.0

Alpha 2

Table of Contents

Constants

JQUERY_VERSION  = '3.6.3'
MYSQL_TITLE  = 'MySQL'
POSTGRE_TITLE  = 'PostgreSQL'
SMF  = 1
SMF_FULL_VERSION  = 'SMF ' . \SMF_VERSION
SMF_INSTALLING  = 1
SMF_LANG_VERSION  = '3.0 Alpha 2'
SMF_SETTINGS_BACKUP_FILE  = dirname(SMF_SETTINGS_FILE) . '/' . pathinfo(SMF_SETTINGS_FILE, PATHINFO_FILENAME) . '_bak.php'
SMF_SETTINGS_FILE  = $settingsFile
SMF_SOFTWARE_YEAR  = '2025'
SMF_USER_AGENT  = 'Mozilla/5.0 (' . \php_uname('s') . ' ' . \php_uname('m') . ') AppleWebKit/605.1.15 (KHTML, like Gecko) SMF/' . \strtr(\SMF_VERSION, ' ', '.')
SMF_VERSION  = '3.0 Alpha 2'
TIME_START  = \microtime(\true)

Functions

upgradeExit()  : mixed
findSettingsFile()  : mixed
load_lang_file()  : mixed
redirectLocation()  : mixed
loadEssentialData()  : mixed
initialize_inputs()  : mixed
WelcomeLogin()  : mixed
checkFolders()  : mixed
checkLogin()  : mixed
UpgradeOptions()  : mixed
BackupDatabase()  : mixed
backupTable()  : mixed
DatabaseChanges()  : mixed
setSqlMode()  : mixed
DeleteUpgrade()  : mixed
addBackgroundTasks()  : mixed
cli_scheduled_fetchSMfiles()  : mixed
convertSettingsToTheme()  : mixed
convertSettingstoOptions()  : mixed
php_version_check()  : mixed
db_version_check()  : mixed
fixRelativePath()  : mixed
parse_sql()  : mixed
upgrade_query()  : mixed
protected_alter()  : mixed
textfield_alter()  : mixed
Alter a text column definition preserving its character set.
nextSubstep()  : mixed
cmdStep0()  : mixed
ConvertUtf8()  : mixed
Handles converting your database to UTF-8
upgrade_unserialize()  : string|bool
Wrapper for unserialize that attempts to repair corrupted serialized data strings
serialize_to_json()  : mixed
Cleanup()  : mixed
CleanupLanguages()  : mixed
CleanupAgreements()  : mixed
template_chmod()  : mixed
template_upgrade_above()  : mixed
template_upgrade_below()  : mixed
template_xml_above()  : mixed
template_xml_below()  : mixed
template_error_message()  : mixed
template_welcome_message()  : mixed
template_upgrade_options()  : mixed
template_backup_database()  : mixed
template_backup_xml()  : mixed
template_database_changes()  : mixed
template_database_xml()  : mixed
template_convert_utf8()  : mixed
template_convert_xml()  : mixed
template_serialize_json()  : mixed
template_serialize_json_xml()  : mixed
template_cleanup()  : mixed
template_cleanup_xml()  : mixed
template_upgrade_complete()  : mixed
MySQLConvertOldIp()  : void
Convert MySQL (var)char ip col to binary
upgradeGetColumnInfo()  : array<string|int, mixed>
Get the column info. This is basically the same as smf_db_list_columns but we get 1 column, force detail and other checks.

Constants

JQUERY_VERSION

public mixed JQUERY_VERSION = '3.6.3'

MYSQL_TITLE

public mixed MYSQL_TITLE = 'MySQL'

POSTGRE_TITLE

public mixed POSTGRE_TITLE = 'PostgreSQL'

SMF_FULL_VERSION

public mixed SMF_FULL_VERSION = 'SMF ' . \SMF_VERSION

SMF_INSTALLING

public mixed SMF_INSTALLING = 1

SMF_LANG_VERSION

public mixed SMF_LANG_VERSION = '3.0 Alpha 2'

SMF_SETTINGS_BACKUP_FILE

public mixed SMF_SETTINGS_BACKUP_FILE = dirname(SMF_SETTINGS_FILE) . '/' . pathinfo(SMF_SETTINGS_FILE, PATHINFO_FILENAME) . '_bak.php'

SMF_SETTINGS_FILE

public mixed SMF_SETTINGS_FILE = $settingsFile

SMF_SOFTWARE_YEAR

public mixed SMF_SOFTWARE_YEAR = '2025'

SMF_USER_AGENT

public mixed SMF_USER_AGENT = 'Mozilla/5.0 (' . \php_uname('s') . ' ' . \php_uname('m') . ') AppleWebKit/605.1.15 (KHTML, like Gecko) SMF/' . \strtr(\SMF_VERSION, ' ', '.')

SMF_VERSION

public mixed SMF_VERSION = '3.0 Alpha 2'

TIME_START

public mixed TIME_START = \microtime(\true)

Functions

upgradeExit()

upgradeExit([mixed $fallThrough = false ]) : mixed
Parameters
$fallThrough : mixed = false

findSettingsFile()

findSettingsFile() : mixed

load_lang_file()

load_lang_file() : mixed

redirectLocation()

redirectLocation(mixed $location[, mixed $addForm = true ]) : mixed
Parameters
$location : mixed
$addForm : mixed = true

loadEssentialData()

loadEssentialData() : mixed

initialize_inputs()

initialize_inputs() : mixed

WelcomeLogin()

WelcomeLogin() : mixed

checkFolders()

checkFolders() : mixed

UpgradeOptions()

UpgradeOptions() : mixed

BackupDatabase()

BackupDatabase() : mixed

backupTable()

backupTable(mixed $table) : mixed
Parameters
$table : mixed

DatabaseChanges()

DatabaseChanges() : mixed

setSqlMode()

setSqlMode([mixed $strict = true ]) : mixed
Parameters
$strict : mixed = true

DeleteUpgrade()

DeleteUpgrade() : mixed

addBackgroundTasks()

addBackgroundTasks() : mixed

cli_scheduled_fetchSMfiles()

cli_scheduled_fetchSMfiles() : mixed

convertSettingsToTheme()

convertSettingsToTheme() : mixed

convertSettingstoOptions()

convertSettingstoOptions() : mixed

php_version_check()

php_version_check() : mixed

db_version_check()

db_version_check() : mixed

fixRelativePath()

fixRelativePath(mixed $path) : mixed
Parameters
$path : mixed

parse_sql()

parse_sql(mixed $filename) : mixed
Parameters
$filename : mixed

upgrade_query()

upgrade_query(mixed $string[, mixed $unbuffered = false ]) : mixed
Parameters
$string : mixed
$unbuffered : mixed = false

protected_alter()

protected_alter(mixed $change, mixed $substep[, mixed $is_test = false ]) : mixed
Parameters
$change : mixed
$substep : mixed
$is_test : mixed = false

textfield_alter()

Alter a text column definition preserving its character set.

textfield_alter(array<string|int, mixed> $change, int $substep) : mixed
Parameters
$change : array<string|int, mixed>
$substep : int

nextSubstep()

nextSubstep(mixed $substep) : mixed
Parameters
$substep : mixed

ConvertUtf8()

Handles converting your database to UTF-8

ConvertUtf8() : mixed

upgrade_unserialize()

Wrapper for unserialize that attempts to repair corrupted serialized data strings

upgrade_unserialize(string $string) : string|bool
Parameters
$string : string

Serialized data that may or may not have been corrupted

Return values
string|bool

The unserialized data, or false if the repair failed

serialize_to_json()

serialize_to_json() : mixed

CleanupLanguages()

CleanupLanguages() : mixed

CleanupAgreements()

CleanupAgreements() : mixed

template_chmod()

template_chmod() : mixed

template_upgrade_above()

template_upgrade_above() : mixed

template_upgrade_below()

template_upgrade_below() : mixed

template_xml_above()

template_xml_above() : mixed

template_xml_below()

template_xml_below() : mixed

template_error_message()

template_error_message() : mixed

template_welcome_message()

template_welcome_message() : mixed

template_upgrade_options()

template_upgrade_options() : mixed

template_backup_database()

template_backup_database() : mixed

template_backup_xml()

template_backup_xml() : mixed

template_database_changes()

template_database_changes() : mixed

template_database_xml()

template_database_xml() : mixed

template_convert_utf8()

template_convert_utf8() : mixed

template_convert_xml()

template_convert_xml() : mixed

template_serialize_json()

template_serialize_json() : mixed

template_serialize_json_xml()

template_serialize_json_xml() : mixed

template_cleanup()

template_cleanup() : mixed

template_cleanup_xml()

template_cleanup_xml() : mixed

template_upgrade_complete()

template_upgrade_complete() : mixed

MySQLConvertOldIp()

Convert MySQL (var)char ip col to binary

MySQLConvertOldIp(string $targetTable, string $oldCol, string $newCol[, int $limit = 50000 ][, int $setSize = 100 ]) : void

newCol needs to be a varbinary(16) null able field

Parameters
$targetTable : string

The table to perform the operation on

$oldCol : string

The old column to gather data from

$newCol : string

The new column to put data in

$limit : int = 50000

The amount of entries to handle at once.

$setSize : int = 100

The amount of entries after which to update the database.

upgradeGetColumnInfo()

Get the column info. This is basically the same as smf_db_list_columns but we get 1 column, force detail and other checks.

upgradeGetColumnInfo(string $targetTable, string $column) : array<string|int, mixed>
Parameters
$targetTable : string

The table to perform the operation on

$column : string

The column we are looking for.

Return values
array<string|int, mixed>

Info on the table.


        
On this page

Search results