|
| checkDependencies () |
|
| disableDepModules (string $redirect_url) |
|
| safeMode () |
|
| loadModules (string $path, ?string $ns=null, ?string $lang=null) |
|
| requireDefine (string $dir, string $id) |
|
| registerModule (string $name, string $desc, string $author, string $version, $properties=[]) |
|
| resetModulesList () |
|
| installModules () |
|
| installModule (string $id, string &$msg) |
|
| deleteModule (string $id, bool $disabled=false) |
|
| deactivateModule (string $id) |
|
| activateModule (string $id) |
|
| cloneModule (string $id) |
|
| loadModuleL10N (string $id, ?string $lang, string $file) |
|
| loadModuleL10Nresources (string $id, ?string $lang) |
|
| getModules (?string $id=null) |
|
| getAnyModules (?string $id=null) |
|
| moduleExists (string $id) |
|
| getDisabledModules () |
|
| getHardDisabledModules () |
|
| getSoftDisabledModules () |
|
| moduleRoot (string $id) |
|
| moduleInfo (string $id, string $info) |
|
| loadNsFiles (?string $ns=null) |
|
| loadNsFile (string $id, ?string $ns=null) |
|
| getErrors () |
|
◆ checkDependencies()
Checks all modules dependencies
Fills in the following information in module :
- cannot_enable : list reasons why module cannot be enabled. Not set if module can be enabled
- cannot_disable : list reasons why module cannot be disabled. Not set if module can be disabled
- implies : reverse dependencies
References DC_VERSION.
Referenced by loadModules().
◆ disableDepModules()
disableDepModules |
( |
string |
$redirect_url | ) |
|
◆ safeMode()
◆ parsePathModules()
parsePathModules |
( |
string |
$root | ) |
|
|
protected |
Get list of modules in a directory
- Parameters
-
string | $root | The root modules directory to parse |
- Returns
- array List of modules, may be an empty array
Referenced by loadModules().
◆ loadModules()
loadModules |
( |
string |
$path, |
|
|
?string |
$ns = null , |
|
|
?string |
$lang = null |
|
) |
| |
Loads modules. $path could be a separated list of paths (path separator depends on your OS).
$ns indicates if an additionnal file needs to be loaded on plugin load, value could be:
- admin (loads module's _admin.php)
- public (loads module's _public.php)
- xmlrpc (loads module's _xmlrpc.php)
$lang indicates if we need to load a lang file on plugin loading.
- Parameters
-
string | $path | The path |
string | $ns | The namespace (context as 'public', 'admin', ...) |
string | $lang | The language |
References $disabled_meta, $id, $ns, $path, $safe_mode, dcCore\app(), checkDependencies(), loadModuleFile(), loadModuleL10N(), loadModuleL10Nresources(), loadNsFile(), MODULE_FILE_DEFINE, MODULE_FILE_INIT, and parsePathModules().
◆ requireDefine()
requireDefine |
( |
string |
$dir, |
|
|
string |
$id |
|
) |
| |
◆ registerModule()
registerModule |
( |
string |
$name, |
|
|
string |
$desc, |
|
|
string |
$author, |
|
|
string |
$version, |
|
|
|
$properties = [] |
|
) |
| |
This method registers a module in modules list. You should use this to register a new module.
$permissions is a comma separated list of permissions for your module. If $permissions is null, only super admin has access to this module.
$priority is an integer. Modules are sorted by priority and name. Lowest priority comes first.
- Parameters
-
string | $name | The module name |
string | $desc | The module description |
string | $author | The module author |
string | $version | The module version |
mixed | $properties | The properties |
Reimplemented in dcPlugins, and dcThemes.
References $id, $version, dcCore\app(), DEFAULT_PRIORITY, html\escapeHTML(), moduleInfo(), and path\real().
◆ resetModulesList()
◆ installPackage()
static installPackage |
( |
string |
$zip_file, |
|
|
dcModules & |
$modules |
|
) |
| |
|
static |
◆ installModules()
◆ installModule()
installModule |
( |
string |
$id, |
|
|
string & |
$msg |
|
) |
| |
This method installs module with ID $id and having a _install file. This file should throw exception on failure or true if it installs successfully.
$msg is an out parameter that handle installer message.
- Parameters
-
string | $id | The identifier |
string | $msg | The message |
- Returns
- mixed
References $id, and loadModuleFile().
Referenced by installModules().
◆ deleteModule()
deleteModule |
( |
string |
$id, |
|
|
bool |
$disabled = false |
|
) |
| |
◆ deactivateModule()
deactivateModule |
( |
string |
$id | ) |
|
◆ activateModule()
activateModule |
( |
string |
$id | ) |
|
Activate a module
- Parameters
-
- Exceptions
-
References $id.
◆ cloneModule()
cloneModule |
( |
string |
$id | ) |
|
Clone a module
- Parameters
-
string | $id | The module identifier |
Reimplemented in dcThemes.
◆ loadModuleL10N()
loadModuleL10N |
( |
string |
$id, |
|
|
?string |
$lang, |
|
|
string |
$file |
|
) |
| |
This method will search for file $file in language $lang for module $id.
$file should not have any extension.
- Parameters
-
string | $id | The module identifier |
string | $lang | The language code |
string | $file | The filename (without extension) |
References $id, and l10n\set().
Referenced by loadModules().
◆ loadModuleL10Nresources()
loadModuleL10Nresources |
( |
string |
$id, |
|
|
?string |
$lang |
|
) |
| |
◆ getModules()
getModules |
( |
?string |
$id = null | ) |
|
Returns all modules associative array or only one module if $id is present.
- Parameters
-
string | $id | The optionnal module identifier |
- Returns
- array The module(s).
References $id, $modules, and $soft_disabled.
◆ getAnyModules()
getAnyModules |
( |
?string |
$id = null | ) |
|
Gets all modules (whatever are their statuses) or only one module if $id is present.
- Parameters
-
string | $id | The optionnal module identifier |
- Returns
- array The module(s).
References $all_modules, and $id.
◆ moduleExists()
moduleExists |
( |
string |
$id | ) |
|
Determines if module exists.
- Parameters
-
string | $id | The module identifier |
- Returns
- bool True if module exists, False otherwise.
References $id.
◆ getDisabledModules()
Gets the disabled modules.
- Returns
- array The disabled modules.
References $disabled.
◆ getHardDisabledModules()
getHardDisabledModules |
( |
| ) |
|
Gets the hard disabled modules.
- Returns
- array The hard disabled modules.
References $hard_disabled.
◆ getSoftDisabledModules()
getSoftDisabledModules |
( |
| ) |
|
Gets the soft disabled modules (safe mode and not hard disabled).
- Returns
- array The soft disabled modules.
References $soft_disabled.
◆ moduleRoot()
Returns root path for module with ID $id.
- Parameters
-
string | $id | The module identifier |
- Returns
- mixed
References moduleInfo().
◆ moduleInfo()
moduleInfo |
( |
string |
$id, |
|
|
string |
$info |
|
) |
| |
Returns a module information that could be:
- root
- name
- desc
- author
- version
- permissions
- priority
- …
- Parameters
-
string | $id | The module identifier |
string | $info | The information |
- Returns
- mixed
References $id.
Referenced by moduleRoot(), and registerModule().
◆ loadNsFiles()
loadNsFiles |
( |
?string |
$ns = null | ) |
|
Loads namespace $ns specific files for all modules.
- Parameters
-
References $ns, and loadNsFile().
◆ loadNsFile()
loadNsFile |
( |
string |
$id, |
|
|
?string |
$ns = null |
|
) |
| |
◆ getErrors()
Gets the errors.
- Returns
- array The errors.
References $errors.
◆ loadModuleFile()
loadModuleFile |
( |
string |
$________, |
|
|
bool |
$catch = true |
|
) |
| |
|
protected |
◆ PACKAGE_INSTALLED
const PACKAGE_INSTALLED = 1 |
◆ PACKAGE_UPDATED
const PACKAGE_UPDATED = 2 |
◆ DEFAULT_PRIORITY
const DEFAULT_PRIORITY = 1000 |
◆ MODULE_FILE_INSTALL
const MODULE_FILE_INSTALL = '_install.php' |
◆ MODULE_FILE_INIT
const MODULE_FILE_INIT = '_init.php' |
◆ MODULE_FILE_DEFINE
const MODULE_FILE_DEFINE = '_define.php' |
◆ MODULE_FILE_PREPEND
const MODULE_FILE_PREPEND = '_prepend.php' |
◆ MODULE_FILE_ADMIN
const MODULE_FILE_ADMIN = '_admin.php' |
◆ MODULE_FILE_PUBLIC
const MODULE_FILE_PUBLIC = '_public.php' |
◆ MODULE_FILE_XMLRPC
const MODULE_FILE_XMLRPC = '_xmlrpc.php' |
◆ MODULE_FILE_DISABLED
const MODULE_FILE_DISABLED = '_disabled' |
◆ $safe_mode
◆ $path
◆ $ns
◆ $modules
◆ $disabled
◆ $hard_disabled
◆ $soft_disabled
◆ $errors
◆ $modules_names
◆ $all_modules
◆ $disabled_mode
◆ $disabled_meta
◆ $to_disable
◆ $id
Referenced by activateModule(), dcThemes\cloneModule(), deactivateModule(), deleteModule(), getAnyModules(), getModules(), installModule(), installModules(), installPackage(), loadModuleL10N(), loadModuleL10Nresources(), loadModules(), loadNsFile(), dcThemes\loadNsFile(), moduleExists(), moduleInfo(), registerModule(), and requireDefine().
◆ $mroot
◆ $superglobals
Initial value:= [
'GLOBALS',
'_SERVER',
'_GET',
'_POST',
'_COOKIE',
'_FILES',
'_ENV',
'_REQUEST',
'_SESSION',
]
◆ $_k
◆ $_n
◆ $type
The documentation for this class was generated from the following file: