Skip to content

Commit

Permalink
Merge branch 'pu/ps/demodata3' into '2024.11'
Browse files Browse the repository at this point in the history
tweak(Tinebase/Frontend/Cli): check if demo data class exists

See merge request tine20/tine20!6660
  • Loading branch information
pschuele committed Feb 27, 2025
2 parents f1c76d3 + 0e6ea60 commit cd37028
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tine20/Tinebase/Frontend/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -1884,14 +1884,17 @@ protected function _createDemoDataRecursive($app, $cfg, $opts)
}

$className = $app . '_Frontend_Cli';

$classNameDD = $app . '_Setup_DemoData';

if (class_exists($className)) {
if (! $classNameDD::hasBeenRun()) {
echo 'Creating DemoData in application "' . $app . '"...' . PHP_EOL;
if (! class_exists($classNameDD) || ! $classNameDD::hasBeenRun()) {
$class = new $className();
$class->createDemoData($opts, FALSE);
if (method_exists($class, 'createDemoData')) {
echo 'Creating DemoData in application "' . $app . '"...' . PHP_EOL;
$class->createDemoData($opts, false);
} else {
echo $className . ' has no method createDemoData() ...' . PHP_EOL;
}
} else {
echo 'DemoData for ' . $app . ' has been run already, skipping...' . PHP_EOL;
}
Expand Down

0 comments on commit cd37028

Please sign in to comment.