|
| autoload (string $path) |
|
| loadModules (Preferences $preferences, string $path, string $lang=null) |
|
| register (string $name, string $desc, string $author, string $version, string $compver=null, string $route=null, string $date=null, array $acls=null, ?int $priority=1000) |
|
| resetModulesList () |
|
| deactivateModule (string $id) |
|
| activateModule (string $id) |
|
| loadModuleL10N (string $id, string $language) |
|
| loadEventProviders (string $id) |
|
| getModules (string $id=null) |
|
| moduleExists (string $id) |
|
| getDisabledModules () |
|
| moduleRoot (string $id) |
|
| moduleInfo (string $id, string $info) |
|
| getTemplatesPath (string $id) |
|
| getTemplatesPathFromName (string $name) |
|
| getTplHeaders () |
|
| needsDatabase (string $id) |
|
| overridePrefs (string $id) |
|
| getAcls () |
|
| getFile (string $id, string $path) |
|
| getNamespace (string $id) |
|
| getClassName (string $id, bool $full=false) |
|
| setCsrfExclusions (array $exclusions) |
|
| getCsrfExclusions () |
|
|
const | DISABLED_COMPAT = 0 |
|
const | DISABLED_MISS = 1 |
|
const | DISABLED_EXPLICIT = 2 |
|
|
array | $path |
|
array | $modules = array() |
|
array | $disabled = array() |
|
array | $csrf_exclusions = array() |
|
string | $id |
|
string | $mroot |
|
Preferences | $preferences |
|
bool | $autoload = false |
|
Plugins class for galette
- Author
- Johan Cwiklinski johan.nosp@m.@x-t.nosp@m.nd.be
◆ activateModule()
Galette\Core\Plugins::activateModule |
( |
string |
$id | ) |
|
Activate specified module
- Parameters
-
- Returns
- void
- Exceptions
-
◆ autoload()
Galette\Core\Plugins::autoload |
( |
string |
$path | ) |
|
Register autoloaders for all plugins
- Parameters
-
string | $path | could be a separated list of paths (path separator depends on your OS). |
- Returns
- void
◆ deactivateModule()
Galette\Core\Plugins::deactivateModule |
( |
string |
$id | ) |
|
Deactivate specified module
- Parameters
-
- Returns
- void
- Exceptions
-
◆ getAcls()
Galette\Core\Plugins::getAcls |
( |
| ) |
|
Get plugins routes ACLs
- Returns
- array<string>
◆ getClassName()
Galette\Core\Plugins::getClassName |
( |
string |
$id, |
|
|
bool |
$full = false |
|
) |
| |
Get module class name
- Parameters
-
string | $id | Module ID |
boolean | $full | Include namespace, defaults to false |
- Returns
- string
◆ getCsrfExclusions()
Galette\Core\Plugins::getCsrfExclusions |
( |
| ) |
|
Get CSRF excluded routes patterns
- Returns
- array<string>
◆ getDisabledModules()
Galette\Core\Plugins::getDisabledModules |
( |
| ) |
|
Returns all disabled modules in an array
- Returns
- array<string, array<string, mixed>>
◆ getFile()
Galette\Core\Plugins::getFile |
( |
string |
$id, |
|
|
string |
$path |
|
) |
| |
Retrieve a file that should be publicly exposed
- Parameters
-
string | $id | Module id |
string | $path | File path |
- Returns
- string
◆ getModules()
Galette\Core\Plugins::getModules |
( |
string |
$id = null | ) |
|
Returns all modules associative array or only one module if $id is present.
- Parameters
-
?string | $id Optional module ID |
- Returns
- array<string, mixed>
◆ getNamespace()
Galette\Core\Plugins::getNamespace |
( |
string |
$id | ) |
|
Get module namespace
- Parameters
-
- Returns
- string
◆ getTemplatesPath()
Galette\Core\Plugins::getTemplatesPath |
( |
string |
$id | ) |
|
Get the templates path for a specified module
- Parameters
-
- Returns
- string Concatenated templates path for requested module
◆ getTemplatesPathFromName()
Galette\Core\Plugins::getTemplatesPathFromName |
( |
string |
$name | ) |
|
Get the templates path for a specified module name
- Parameters
-
- Returns
- string Concatenated templates path for requested module
◆ getTplHeaders()
Galette\Core\Plugins::getTplHeaders |
( |
| ) |
|
For each module, returns the headers template file namespaced path, if present.
- Returns
- array<string> of headers to include for all modules
◆ loadEventProviders()
Galette\Core\Plugins::loadEventProviders |
( |
string |
$id | ) |
|
Loads event provider
- Parameters
-
- Returns
- void
◆ loadModuleL10N()
Galette\Core\Plugins::loadModuleL10N |
( |
string |
$id, |
|
|
string |
$language |
|
) |
| |
This method will search for file $file in language $lang for module $id. $file should not have any extension.
- Parameters
-
string | $id | Module ID |
string | $language | Language code |
- Returns
- void
◆ loadModules()
Galette\Core\Plugins::loadModules |
( |
Preferences |
$preferences, |
|
|
string |
$path, |
|
|
string |
$lang = null |
|
) |
| |
Loads modules.
- Parameters
-
Preferences | $preferences | Galette's Preferences |
string | $path | could be a separated list of paths (path separator depends on your OS). |
| ?string | $lang Indicates if we need to load a lang file on plugin loading. |
- Returns
- void
◆ moduleExists()
Galette\Core\Plugins::moduleExists |
( |
string |
$id | ) |
|
Returns true if the module with ID $id exists.
- Parameters
-
- Returns
- boolean
◆ moduleInfo()
Galette\Core\Plugins::moduleInfo |
( |
string |
$id, |
|
|
string |
$info |
|
) |
| |
Returns a module information that could be:
- root
- name
- desc
- author
- version
- date
- permissions
- priority
- Parameters
-
string | $id | Module ID |
string | $info | Information to retrieve |
- Returns
- mixed module's information
◆ moduleRoot()
Galette\Core\Plugins::moduleRoot |
( |
string |
$id | ) |
|
Returns root path for module with ID $id.
- Parameters
-
- Returns
- ?string
◆ needsDatabase()
Galette\Core\Plugins::needsDatabase |
( |
string |
$id | ) |
|
Does module need a database?
- Parameters
-
- Returns
- boolean
◆ overridePrefs()
Galette\Core\Plugins::overridePrefs |
( |
string |
$id | ) |
|
Override preferences from plugin
- Parameters
-
- Returns
- void
◆ parseModules()
Galette\Core\Plugins::parseModules |
( |
| ) |
|
|
protected |
Parse modules in current path
- Returns
- void
◆ register()
Galette\Core\Plugins::register |
( |
string |
$name, |
|
|
string |
$desc, |
|
|
string |
$author, |
|
|
string |
$version, |
|
|
string |
$compver = null , |
|
|
string |
$route = null , |
|
|
string |
$date = null , |
|
|
array |
$acls = null , |
|
|
?int |
$priority = 1000 |
|
) |
| |
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 | Module name |
string | $desc | Module description |
string | $author | Module author name |
string | $version | Module version |
| ?string | $compver Galette version compatibility |
| ?string | $route Module route name |
| ?string | $date Module release date |
| ?array<string,string> | $acls Module routes ACLs |
integer | $priority | Module priority |
- Returns
- void
◆ resetModulesList()
Galette\Core\Plugins::resetModulesList |
( |
| ) |
|
Reset modules list
- Returns
- void
◆ setCsrfExclusions()
Galette\Core\Plugins::setCsrfExclusions |
( |
array |
$exclusions | ) |
|
Set CRSF excluded routes for one plugin
- Parameters
-
array<string> | $exclusions Array of regular expressions patterns to be excluded |
- Returns
- self
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/galette-apidoc/checkouts/develop/galette/lib/Galette/Core/Plugins.php