Skip to content

Commit

Permalink
fix dump from git
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 9, 2024
1 parent ba44a89 commit 39e13ef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
27 changes: 17 additions & 10 deletions app/Console/Commands/DumpFromGit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Console\Commands;

use App\Facades\EntityFacade;
use App\Models\Entity;
use App\Models\Membership;
use App\Models\User;
use App\Traits\DumpFromGit\CreateCategoriesAndGroupsTrait;
Expand All @@ -16,6 +17,7 @@
use App\Traits\ValidatorTrait;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Model;

class DumpFromGit extends Command
{
Expand Down Expand Up @@ -59,16 +61,21 @@ public function handle()
throw new Exception('firstAdminId is null');
}

$this->initializeGit();
$this->createFederations();
$this->createEntities($firstAdminId);
$this->createCategoriesAndGroups();
$this->updateGroupsAndCategories();
$this->updateEntitiesXml();
$this->updateFederationFolders();
$this->fixEntities();
$this->createMetadataFiles();
$this->makeEdu2Edugain();
Entity::withoutEvents( function () use ($firstAdminId) {
$this->initializeGit();
$this->createFederations();
$this->createEntities($firstAdminId);
$this->createCategoriesAndGroups();
$this->updateGroupsAndCategories();
$this->updateEntitiesXml();
$this->updateFederationFolders();
$this->fixEntities();
$this->createMetadataFiles();
$this->makeEdu2Edugain();

});



}
}
2 changes: 1 addition & 1 deletion app/Traits/FederationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function createFederationFolder(string $name): void

public function updateFederationFolders(): void
{
$federations = Federation::select('name')->get();
$federations = Federation::all();

foreach ($federations as $fed) {
if (! Storage::disk(config('storageCfg.name'))->exists($fed['xml_id'])) {
Expand Down

0 comments on commit 39e13ef

Please sign in to comment.