Loading code/test1.php +17 −26 Original line number Diff line number Diff line Loading @@ -7,22 +7,7 @@ * @var $sl \Zend\ServiceManager\ServiceLocatorInterface */ spl_autoload_register(function ($class) { if (0 === strpos($class, 'BddAdmin')) { $dir = dirname(__DIR__) . '/admin/src/'; $class = $dir . str_replace('\\', '/', $class) . '.php'; require_once $class; } }); $bdd = new \BddAdmin\Bdd([ 'host' => AppConfig::get('bdd', 'host'), 'port' => AppConfig::get('bdd', 'port'), 'dbname' => AppConfig::get('bdd', 'dbname'), 'username' => AppConfig::get('bdd', 'username'), 'password' => AppConfig::get('bdd', 'password'), ]); $bdd = adminBdd(); $schema = new \BddAdmin\Schema($bdd); /*$tables = [ Loading @@ -49,7 +34,7 @@ $schema = new \BddAdmin\Schema($bdd); $list = [ 'ANNEE', 'INTERVENANT', 'CORPS', 'GRADE', 'GROUPE_TYPE_FORMATION', 'TYPE_FORMATION', 'ETAPE', 'ELEMENT_PEDAGOGIQUE', 'CHEMIN_PEDAGOGIQUE', 'VOLUME_HORAIRE_ENS', 'TYPE_INTERVENTION' 'CHEMIN_PEDAGOGIQUE', 'VOLUME_HORAIRE_ENS', 'TYPE_INTERVENTION', ]; $tables = []; Loading Loading @@ -144,7 +129,13 @@ foreach ($cls as $cl) { }, new go.Binding("text", "name")), $(go.TextBlock, {margin: new go.Margin(0, 5), column: 2,stroke: "#ef9b0b",font: "normal 9px sans-serif", alignment: go.Spot.Left}, { margin: new go.Margin(0, 5), column: 2, stroke: "#ef9b0b", font: "normal 9px sans-serif", alignment: go.Spot.Left }, new go.Binding("text", "type")) ); Loading config/application.config.php +16 −5 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ include_once dirname(__DIR__) . '/module/Application/Application.php'; class AppConfig { const LOCAL_APPLICATION_CONFIG_FILE = __DIR__ . '/../config.local.php'; Loading Loading @@ -52,6 +55,12 @@ class AppConfig } } if (self::$config && $section) { if (isset(self::$config[$section])) { return self::$config[$section]; } } return self::$config; } Loading Loading @@ -143,6 +152,7 @@ class AppConfig if (!self::$global) { self::$global = self::makeGlobal(); } return self::$global; } } Loading @@ -152,4 +162,5 @@ class AppConfig AppConfig::init(); return AppConfig::getGlobal(); No newline at end of file module/Application/src/Application/functions.php +19 −0 Original line number Diff line number Diff line Loading @@ -108,3 +108,22 @@ function vhlDump(\Application\Entity\VolumeHoraireListe $volumeHoraireListe): \O return $dumper; } function adminBdd(): \BddAdmin\Bdd { if (!class_exists('BddAdmin\Bdd')) { spl_autoload_register(function ($class) { if (0 === strpos($class, 'BddAdmin')) { $dir = getcwd() . '/admin/src/'; $class = $dir . str_replace('\\', '/', $class) . '.php'; require_once $class; } }); } $bdd = new BddAdmin\Bdd(AppConfig::get('bdd')); return $bdd; } No newline at end of file Loading
code/test1.php +17 −26 Original line number Diff line number Diff line Loading @@ -7,22 +7,7 @@ * @var $sl \Zend\ServiceManager\ServiceLocatorInterface */ spl_autoload_register(function ($class) { if (0 === strpos($class, 'BddAdmin')) { $dir = dirname(__DIR__) . '/admin/src/'; $class = $dir . str_replace('\\', '/', $class) . '.php'; require_once $class; } }); $bdd = new \BddAdmin\Bdd([ 'host' => AppConfig::get('bdd', 'host'), 'port' => AppConfig::get('bdd', 'port'), 'dbname' => AppConfig::get('bdd', 'dbname'), 'username' => AppConfig::get('bdd', 'username'), 'password' => AppConfig::get('bdd', 'password'), ]); $bdd = adminBdd(); $schema = new \BddAdmin\Schema($bdd); /*$tables = [ Loading @@ -49,7 +34,7 @@ $schema = new \BddAdmin\Schema($bdd); $list = [ 'ANNEE', 'INTERVENANT', 'CORPS', 'GRADE', 'GROUPE_TYPE_FORMATION', 'TYPE_FORMATION', 'ETAPE', 'ELEMENT_PEDAGOGIQUE', 'CHEMIN_PEDAGOGIQUE', 'VOLUME_HORAIRE_ENS', 'TYPE_INTERVENTION' 'CHEMIN_PEDAGOGIQUE', 'VOLUME_HORAIRE_ENS', 'TYPE_INTERVENTION', ]; $tables = []; Loading Loading @@ -144,7 +129,13 @@ foreach ($cls as $cl) { }, new go.Binding("text", "name")), $(go.TextBlock, {margin: new go.Margin(0, 5), column: 2,stroke: "#ef9b0b",font: "normal 9px sans-serif", alignment: go.Spot.Left}, { margin: new go.Margin(0, 5), column: 2, stroke: "#ef9b0b", font: "normal 9px sans-serif", alignment: go.Spot.Left }, new go.Binding("text", "type")) ); Loading
config/application.config.php +16 −5 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ include_once dirname(__DIR__) . '/module/Application/Application.php'; class AppConfig { const LOCAL_APPLICATION_CONFIG_FILE = __DIR__ . '/../config.local.php'; Loading Loading @@ -52,6 +55,12 @@ class AppConfig } } if (self::$config && $section) { if (isset(self::$config[$section])) { return self::$config[$section]; } } return self::$config; } Loading Loading @@ -143,6 +152,7 @@ class AppConfig if (!self::$global) { self::$global = self::makeGlobal(); } return self::$global; } } Loading @@ -152,4 +162,5 @@ class AppConfig AppConfig::init(); return AppConfig::getGlobal(); No newline at end of file
module/Application/src/Application/functions.php +19 −0 Original line number Diff line number Diff line Loading @@ -108,3 +108,22 @@ function vhlDump(\Application\Entity\VolumeHoraireListe $volumeHoraireListe): \O return $dumper; } function adminBdd(): \BddAdmin\Bdd { if (!class_exists('BddAdmin\Bdd')) { spl_autoload_register(function ($class) { if (0 === strpos($class, 'BddAdmin')) { $dir = getcwd() . '/admin/src/'; $class = $dir . str_replace('\\', '/', $class) . '.php'; require_once $class; } }); } $bdd = new BddAdmin\Bdd(AppConfig::get('bdd')); return $bdd; } No newline at end of file