\MatthiasWeb\RealMediaLibraryActivator

The activator class handles the plugin relevant activation hooks: Uninstall, activation, deactivation and installation. The "installation" means installing needed database tables.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
dbDelta()
getMaxIndexLength()
install()
isMigrationLocked()
getDatabaseVersion()
getPreviousDatabaseVersions()
persistPreviousVersion()
removePreviousPersistedVersions()
activate()
deactivate()
createChildQueryFunction()
supportsChildQuery()
checkChildQuery()
checkDirtyFunction()
No public properties found
DB_CHILD_QUERY_SUPPORTED
CHILD_UDF_NAME
No protected methods found
No protected properties found
N/A
No private methods found
$childSupportCurrentType
N/A

Constants

DB_CHILD_QUERY_SUPPORTED

DB_CHILD_QUERY_SUPPORTED ='_cqs'

CHILD_UDF_NAME

CHILD_UDF_NAME ='fn_realmedialibrary_childs'

Properties

$childSupportCurrentType

$childSupportCurrentType :

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

Returns

string

dbDelta()

dbDelta(boolean  $errorlevel)

Install tables, stored procedures or whatever in the database.

This method is always called when the version bumps up or for the first initial activation.

Parameters

boolean $errorlevel

If true throw errors

getMaxIndexLength()

getMaxIndexLength()

Indexes have a maximum size of 767 bytes. Historically, we haven't need to be concerned about that.

As of 4.2, however, we moved to utf8mb4, which uses 4 bytes per character. This means that an index which used to have room for floor(767/3) = 255 characters, now only has room for floor(767/4) = 191 characters.

install()

install(boolean  $errorlevel = false,callable  $installThisCallable = null)

Run an installation or dbDelta within a callable.

Parameters

boolean $errorlevel

Set true to throw errors.

callable $installThisCallable

Set a callable to install this one instead of the default.

isMigrationLocked()

isMigrationLocked()

Check if the migration is locked. It uses a time span of 10 minutes (like Yoast SEO plugin).

getDatabaseVersion()

getDatabaseVersion()

Get the current persisted database version.

getPreviousDatabaseVersions()

getPreviousDatabaseVersions(): array<mixed,string>

Get a list of previous installed database versions.

Returns

array<mixed,string>

persistPreviousVersion()

persistPreviousVersion()

Persist the previous installed versions of this plugin so we can e.g. start migrations.

removePreviousPersistedVersions()

removePreviousPersistedVersions(callback  $filter)

Remove the previous persisted versions from the saved option. This is useful if you have successfully finished your migration.

Parameters

callback $filter

activate()

activate()

Method gets fired when the user activates the plugin.

deactivate()

deactivate()

Method gets fired when the user deactivates the plugin.

createChildQueryFunction()

createChildQueryFunction()

Create a MySQL function wp_realmedialibrary_childs to read recursively children of a folder.

supportsChildQuery()

supportsChildQuery(boolean  $force = false,string  $type = 'legacy'): boolean

Checks if the current database supports functions or recursive drill-down query.

Parameters

boolean $force
string $type

Can be 'legacy' or 'function'.

Returns

boolean

checkChildQuery()

checkChildQuery()

Check if the current instance type works as expected.

checkDirtyFunction()

checkDirtyFunction(string  $function_name): boolean

Checks if the Database supports functions but the function is not yet created (due to exports for example).

Parameters

string $function_name

Returns

boolean