test.php 848 Bytes
Newer Older
1
<?php
2

Laurent Lécluse's avatar
Laurent Lécluse committed
3
4
$bdd = new \BddAdmin\Bdd( Config::get()['bdds']['deploy-local'] );
$bdd->debug = true;
5
$schema = new \BddAdmin\Schema($bdd);
6

7
8
/* Récupération du schéma de référence */
$ref = $schema->loadFromFile($oa->getOseDir() . 'bdd/ddl.php');
9

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

/* Construction de la config de DDL pour filtrer */
$ddlConfig = require $oa->getOseDir().'/data/ddl_config.php';
$classes = [ // Tous les objets de ces classes seront int&égralement pris en compte dans la MAJ
             \BddAdmin\Ddl\DdlView::class,
             \BddAdmin\Ddl\DdlPackage::class,
             \BddAdmin\Ddl\DdlTrigger::class,
];

foreach ($classes as $ddlClass) {
    if (isset($ref[$ddlClass])){
        $objects = array_keys($ref[$ddlClass]);
        foreach($objects as $object){
            $ddlConfig[$ddlClass]['includes'][] = $object;
        }
    }
}

var_dump($ddlConfig);