Loading admin/actions/test.php +1 −1 Original line number Diff line number Diff line <?php $oa->majPrivileges(); No newline at end of file var_dump( $oa->bddIsOk() ); No newline at end of file admin/actions/update-bdd.php +6 −5 Original line number Diff line number Diff line Loading @@ -38,10 +38,11 @@ $schema->alter($ref, $ddlConfig, true); $c->println('Fin de mise à jour des définitions'); // On teste que la méthode existe, car au moment de la MAJ l'objet chargé est la version antérieure à celle de ce sccript if (method_exists($oa,'majPrivileges')) { $c->println('Mise à jour des privilèges', $c::COLOR_LIGHT_PURPLE); $oa->majPrivileges(); $c->println('Fin de la mise à jour des privilèges'); } $c->println(''); No newline at end of file admin/src/OseAdmin.php +14 −16 Original line number Diff line number Diff line Loading @@ -325,10 +325,13 @@ class OseAdmin /** * @return \BddAdmin\Bdd */ public function getBdd(): \BddAdmin\Bdd { if (!$this->bdd) { $this->bdd = $this->loadBdd(); $this->bdd = new \BddAdmin\Bdd(Config::getBdd()); } return $this->bdd; Loading @@ -338,24 +341,19 @@ class OseAdmin /** * @return bool * @throws \BddAdmin\Exception\BddCompileException * @throws \BddAdmin\Exception\BddException * @throws \BddAdmin\Exception\BddIndexExistsException */ public function bddIsOk(): bool { $bdd = $this->getBdd(); $r = $bdd->select('SELECT 1 FROM dual'); $bddConf = Config::getBdd(); return isset($r[0][1]) && $r[0][1] === '1'; $cs = $bddConf['host'] . ':' . $bddConf['port'] . '/' . $bddConf['dbname']; $characterSet = 'AL32UTF8'; $conn = oci_pconnect($bddConf['username'], $bddConf['password'], $cs, $characterSet); if (!$conn) { return false; }else{ oci_close($conn); return true; } private function loadBdd(): \BddAdmin\Bdd { $bdd = new \BddAdmin\Bdd(Config::getBdd()); return $bdd; } } No newline at end of file Loading
admin/actions/test.php +1 −1 Original line number Diff line number Diff line <?php $oa->majPrivileges(); No newline at end of file var_dump( $oa->bddIsOk() ); No newline at end of file
admin/actions/update-bdd.php +6 −5 Original line number Diff line number Diff line Loading @@ -38,10 +38,11 @@ $schema->alter($ref, $ddlConfig, true); $c->println('Fin de mise à jour des définitions'); // On teste que la méthode existe, car au moment de la MAJ l'objet chargé est la version antérieure à celle de ce sccript if (method_exists($oa,'majPrivileges')) { $c->println('Mise à jour des privilèges', $c::COLOR_LIGHT_PURPLE); $oa->majPrivileges(); $c->println('Fin de la mise à jour des privilèges'); } $c->println(''); No newline at end of file
admin/src/OseAdmin.php +14 −16 Original line number Diff line number Diff line Loading @@ -325,10 +325,13 @@ class OseAdmin /** * @return \BddAdmin\Bdd */ public function getBdd(): \BddAdmin\Bdd { if (!$this->bdd) { $this->bdd = $this->loadBdd(); $this->bdd = new \BddAdmin\Bdd(Config::getBdd()); } return $this->bdd; Loading @@ -338,24 +341,19 @@ class OseAdmin /** * @return bool * @throws \BddAdmin\Exception\BddCompileException * @throws \BddAdmin\Exception\BddException * @throws \BddAdmin\Exception\BddIndexExistsException */ public function bddIsOk(): bool { $bdd = $this->getBdd(); $r = $bdd->select('SELECT 1 FROM dual'); $bddConf = Config::getBdd(); return isset($r[0][1]) && $r[0][1] === '1'; $cs = $bddConf['host'] . ':' . $bddConf['port'] . '/' . $bddConf['dbname']; $characterSet = 'AL32UTF8'; $conn = oci_pconnect($bddConf['username'], $bddConf['password'], $cs, $characterSet); if (!$conn) { return false; }else{ oci_close($conn); return true; } private function loadBdd(): \BddAdmin\Bdd { $bdd = new \BddAdmin\Bdd(Config::getBdd()); return $bdd; } } No newline at end of file