Skip to content

Commit

Permalink
Module- und Template-Synchronisation mit T-Racks
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr-w committed Dec 28, 2024
1 parent 99fdac1 commit 9eb46a1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
9 changes: 9 additions & 0 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use rex;
use rex_addon;
use rex_config;
use rex_cronjob_manager;
use rex_csrf_token;
use rex_extension;
Expand All @@ -25,6 +26,14 @@
}
*/

/* Nutzt du T-Racks? <https://github.com/alexplusde/tracks> Module und Addons bei der Entwicklung synchroinsieren */
/*
if (rex::isBackend() && rex::isDebugMode() && rex_config::get('blaupause', 'dev')) {
\Tracks\🦖::writeModule('blaupause', 'blaupause.%');
\Tracks\🦖::writeTemplate('blaupause', 'blaupause.%');
}
*/

// Prüfen, ob ein anderes Addon installiert ist, bspw. Cronjob-Addon
/*
if (rex_addon::get('cronjob')->isAvailable() && !rex::isSafeMode()) {
Expand Down
34 changes: 15 additions & 19 deletions install.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

use rex_addon;
use rex_sql;
use rex_yform_manager_table;
use rex_yform_manager_table_api;
use rex_file;
use rex_article;
use rex_config;

/* Tablesets aktualisieren */
$addon = rex_addon::get('blaupause');

Expand Down Expand Up @@ -28,24 +36,12 @@

/* Todo: Wildcard aktualisieren */

/*
$modules = scandir(rex_path::addon("blaupause")."module");
/* Nutzt du T-Racks? <https://github.com/alexplusde/tracks> Module und Addons mit installieren */

foreach ($modules as $module) {
if ($module == "." || $module == "..") {
continue;
}
$module_array = json_decode(rex_file::get(rex_path::addon("blaupause")."module/".$module), 1);
rex_sql::factory()->setDebug(0)->setTable("rex_module")
->setValue("name", $module_array['name'])
->setValue("key", $module_array['key'])
->setValue("input", $module_array['input'])
->setValue("output", $module_array['output'])
->setValue("createuser", "")
->setValue("updateuser", "blaupause")
->setValue("createdate", date("Y-m-d H:i:s"))
->setValue("updatedate", date("Y-m-d H:i:s"))
->insertOrUpdate();
if(rex_addon::exists('tracks')) {
\Tracks\🦖::forceBackup('school'); // Sichert standardmäßig Module und Templates
\Tracks\🦖::updateModule('school'); // Synchronisiert Module
\Tracks\🦖::updateTemplate('school'); // Synchronisiert Templates
}
*/

\rex_delete_cache();

0 comments on commit 9eb46a1

Please sign in to comment.