diff options
author | Simon Rettberg | 2017-03-10 13:59:44 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-03-10 13:59:44 +0100 |
commit | 32a1e63a360f6354374324ec4a5c344d0b1bf2de (patch) | |
tree | 858d38e39a06bcd0e6459688b6a9614978314e17 /modules-available/sysconfig | |
parent | [sysconfig] configtgz.inc.php: Move static functions to bottom (diff) | |
download | slx-admin-32a1e63a360f6354374324ec4a5c344d0b1bf2de.tar.gz slx-admin-32a1e63a360f6354374324ec4a5c344d0b1bf2de.tar.xz slx-admin-32a1e63a360f6354374324ec4a5c344d0b1bf2de.zip |
[sysconfig] Add ConfigTgz::rebuildAllConfigs()
Diffstat (limited to 'modules-available/sysconfig')
-rw-r--r-- | modules-available/sysconfig/inc/configtgz.inc.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/modules-available/sysconfig/inc/configtgz.inc.php b/modules-available/sysconfig/inc/configtgz.inc.php index ba48c7ed..c03d1c5e 100644 --- a/modules-available/sysconfig/inc/configtgz.inc.php +++ b/modules-available/sysconfig/inc/configtgz.inc.php @@ -198,6 +198,25 @@ class ConfigTgz * Static part */ + /** + * Marks all modules as outdated and triggers generate() + * on each one. This mostly makes sense to call if a global module + * that is injected via a hook has changed. + */ + public static function rebuildAllConfigs() + { + Database::exec("UPDATE configtgz SET status = :status", array( + 'status' => 'OUTDATED' + )); + $res = Database::simpleQuery("SELECT configid FROM configtgz"); + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $module = self::get($row['configid']); + if ($module !== false) { + $module->generate(); + } + } + } + public static function insert($title, $moduleIds) { if (!is_array($moduleIds)) |