69 'create_since' =>
'now',
70 'create_until' =>
'now',
71 'interactive' =>
true,
72 'cli_command' => null,
84 $cli_command =
$options[
'cli_command'];
92 foreach ($seeds as $seed) {
96 if (!empty($seed_options[
'type']) && $seed_options[
'type'] !== $seed::getType()) {
101 $seed_options[
'limit'] = $seed_options[
'limit'] ?? $seed::getDefaultLimit();
102 if ($interactive && $cli_command instanceof
Command) {
103 $seed_options[
'limit'] = (int) $cli_command->ask($this->translator->translate(
'cli:database:seed:ask:limit', [$seed::getType()]), $seed_options[
'limit'],
false,
false);
106 if ($seed_options[
'limit'] < 1) {
112 $seeder =
new $seed($seed_options);
114 $progress_bar = $this->progress->start($seed, $seed_options[
'limit']);
116 $seeder->setProgressBar($progress_bar);
120 $this->progress->finish($progress_bar);
142 foreach ($seeds as $seed) {
149 $seeder =
new $seed();
151 $progress_bar = $this->progress->start($seed, $seeder->getCount());
153 $seeder->setProgressBar($progress_bar);
157 $this->progress->finish($progress_bar);
170 $seeds = $this->events->triggerResults(
'seeds',
'database', [], []);
171 foreach ($seeds as $seed) {
172 if (!class_exists($seed)) {
173 elgg_log(
"Seeding class {$seed} not found",
'ERROR');
177 if (!is_subclass_of($seed, Seed::class)) {
178 elgg_log(
"Seeding class {$seed} does not extend " . Seed::class,
'ERROR');
const ELGG_DISABLE_SYSTEM_LOG
__construct(EventsService $events, Progress $progress, Invoker $invoker, Translator $translator)
Seeder constructor.
getSeederClasses()
Get the class names of all registered seeders (verified to work for seeding)
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
seed(array $options=[])
Load seed scripts.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options
elgg_set_config(string $name, $value)
Set an Elgg configuration value.
const ELGG_IGNORE_ACCESS
elgg_call() flags
const ELGG_SHOW_DISABLED_ENTITIES
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
unseed(array $options=[])
Remove all seeded entities.
const ELGG_SHOW_DELETED_ENTITIES
Abstract command with some utility methods.