Exemple #1
0
 public function getXML()
 {
     $xml = new DomDocument();
     $xml->encoding = "UTF-8";
     // cr?ation de la racine avec id du tu
     $root = $this->createNoeud($xml, $xml, "tu");
     $root->setAttribute("id", TBIDSITE);
     $root_key = $this->createNoeud($xml, $root, "key");
     $root_key->appendChild($xml->createTextNode(TBKEYSITE));
     // noeud id serveur veille
     $root_veille = $this->createNoeud($xml, $root, "idVeille");
     $root_veille->appendChild($xml->createTextNode($this->encode($a)));
     $root_date = $this->createNoeud($xml, $root, "date");
     $root_date->appendChild($xml->createTextNode(date("c")));
     // noeud version
     $root_version = $this->createNoeud($xml, $root, "version");
     $root_version->appendChild($xml->createTextNode($this->encode($this->getVersion())));
     // noeud nombre de patients
     $root_nb_patients = $this->createNoeud($xml, $root, "nbPatients");
     $root_nb_patients->appendChild($xml->createTextNode($this->encode($this->getNbPatients())));
     // noeud nombre de m?decins pr?sents
     $root_nb_medecins = $this->createNoeud($xml, $root, "nbMedecins");
     $root_nb_medecins->appendChild($xml->createTextNode($this->encode($this->getNbMedecins())));
     // ENQUETES
     $root_enq = $this->createNoeud($xml, $root, "enquetes");
     $tab_enq = $this->getEnquetes();
     foreach ($tab_enq as $enq) {
         $node_enq = $this->createNoeud($xml, $root_enq, "enquete");
         $node_enq->setAttribute("id", $this->encode($enq['id']));
         $enq_name = $this->createNoeud($xml, $node_enq, "name");
         $enq_name->appendChild($xml->createTextNode($this->encode($enq['nom'])));
         $enq_valeur = $this->createNoeud($xml, $node_enq, "value");
         $enq_valeur->appendChild($xml->createTextNode($this->encode($enq['is_active'])));
     }
     // OPTIONS
     $root_option = $this->createNoeud($xml, $root, "options");
     $opt_categs = $this->getOptCateg();
     foreach ($opt_categs as $categ) {
         $node_categ = $this->createNoeud($xml, $root_option, "categ");
         $node_categ->setAttribute("nom", $this->encode($categ['categorie']));
         $opts = $this->getTabOptions($categ['categorie']);
         // noeuds options
         foreach ($opts as $opt) {
             $node_opt = $this->createNoeud($xml, $node_categ, "option");
             $node_opt->setAttribute("id", $this->encode($opt['idoption']));
             $opt_name = $this->createNoeud($xml, $node_opt, "name");
             $opt_name->appendChild($xml->createTextNode($this->encode($opt['libelle'])));
             $opt_valeur = $this->createNoeud($xml, $node_opt, "value");
             $opt_valeur->appendChild($xml->createTextNode($this->encode($opt['valeur'])));
         }
     }
     // ajout des tests du index.test.php
     $root_tests = $xml->createElement("tests");
     $root->appendChild($root_tests);
     $tests_categ1 = $this->createCategTest($xml, $root_tests, "Configuration php basique");
     $this->createNoeudTest($xml, $tests_categ1, "Test version de PHP > 5.1.0", clUpdater::checkPHPVersion('5.1.0'));
     $this->createNoeudTest($xml, $tests_categ1, "Safe mode non activ?", clUpdater::testSafeMode());
     $this->createNoeudTest($xml, $tests_categ1, "Test de la desactivation de la limite temporelle d'execution du script", clUpdater::testLimiteTempo());
     $this->createNoeudTest($xml, $tests_categ1, "Test de l'augmentation de la memoire allouee a 512M", clUpdater::testNoNoNoNoNoNoThereIsNoLimit("512M"));
     $tests_categ2 = $this->createCategTest($xml, $root_tests, "Modules php necessaires");
     $modules = array("soap", "xsl", "xml", "ftp", "mysql", "calendar", "gd", "zlib", "mbstring", "sockets");
     foreach ($modules as $module) {
         $this->createNoeudTest($xml, $tests_categ2, "Test de la presence du module PHP " . $module, clUpdater::testModule($module));
     }
     $tests_categ3 = $this->createCategTest($xml, $root_tests, "Modules php pour fonctionalites etendues");
     $modules = array("curl", "openssl");
     foreach ($modules as $module) {
         $this->createNoeudTest($xml, $tests_categ3, "Test de la presence du module PHP " . $module, clUpdater::testModule($module));
     }
     $tests_categ4 = $this->createCategTest($xml, $root_tests, "Verification des repertoires");
     $dirs = array(URLCACHE, URLDOCS, URLLOCAL . 'hprim/', URLLOCAL . 'hprim/ok/', URLLOCAL . 'hprim/xml/', URLLOCAL . 'rpu/', URLLOCAL . 'rpu/ok/', URLLOCAL . 'rpu/logs/', URLLOCAL . 'var/', URLLOCAL . 'var/maj/', URLLOCAL . 'temp/', URLLOCAL . 'var/dist/');
     foreach ($dirs as $dir) {
         $this->createNoeudTest($xml, $tests_categ4, "Test du droit d'ecriture sur le dossier " . $dir, clUpdater::testEcritureDossier($dir), true);
     }
     $tests_categ5 = $this->createCategTest($xml, $root_tests, "Connexions aux bases");
     $this->createNoeudTest($xml, $tests_categ5, "Connexion au serveur MySQL '" . MYSQL_USER . "@" . MYSQL_HOST . " (using password: "******")'", mysql_pconnect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS));
     $bases = array(BASEXHAM, BDD, CCAM_BDD);
     $bbases = array("xham", "tuv2", "ccam");
     foreach ($bases as $i => $base) {
         $this->createNoeudTest($xml, $tests_categ5, "Connexion ? la base " . $bbases[$i] . " '" . $base . "'", mysql_select_db($base));
         $this->createNoeudTest($xml, $tests_categ5, "Test des privileges " . $bbases[$i] . " : CREATE ALTER DROP base '" . $base . "'", clUpdater::testGrantOnBase(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, $base));
     }
     $tests_categ6 = $this->createCategTest($xml, $root_tests, "Communication");
     ob_flush();
     flush();
     $ftp_server = 'www.veille-arh-paca.com';
     $ftp_user_name = 'importsrv';
     $ftp_user_pass = '******';
     $this->createNoeudTest($xml, $tests_categ6, "Test de connexion FTP vers serveur de veille  (ftp://www.veille-arh-paca.com)", clUpdater::testDepotFTP($ftp_server, $ftp_user_name, $ftp_user_pass), true);
     $this->createNoeudTest($xml, $tests_categ6, "Test de cryptage avec la clef publique ARH", clUpdater::clefARH(), true);
     return $xml;
 }
Exemple #2
0
}
if (!file_exists(URLLOCAL . 'queries_int/getHistoriqueDocs.qry')) {
    copy(URLLOCAL . 'queries_int/getHistoriqueDocs.qry.base', URLLOCAL . 'queries_int/getHistoriqueDocs.qry');
}
if (!file_exists(URLLOCAL . 'queries_int/getHistoriqueDoc.qry') and file_exists(URLLOCAL . 'queries_int/getHistoriqueDoc.qry.base')) {
    copy(URLLOCAL . 'queries_int/getHistoriqueDoc.qry.base', URLLOCAL . 'queries_int/getHistoriqueDoc.qry');
}
echo "<h3>Procédure de vérification</h3><hr />";
/*
 * TEST DE LA CONFIGURATION
 */
echo "<h4>Configuration php basique</h4>";
$version = "5.1.0";
$mem = "512M";
affichage("Test version de PHP > " . $version, clUpdater::checkPHPVersion($version));
affichage("Safe mode non activé", clUpdater::testSafeMode());
affichage("Test de la désactivation de la limite temporelle d'exécution du script", clUpdater::testLimiteTempo());
affichage("Test de l'augmentation de la mémoire allouée à " . $mem, clUpdater::testNoNoNoNoNoNoThereIsNoLimit($mem));
/*
-disable-cgi --enable-soap
            --with-libxml-dir --with-xsl --enable-track-vars --with-xml --enable-ftp --with-mysql
            --with-calendar --with-gd --enable-calendar --with-zlib-dir --with-jpeg-dir
            --enable-sigchild --with-freetype-dir --enable-mbstring --enable-sockets --with-zip
*/
/*
 * TEST DES MODULES PHP
 */
echo "<br /><hr /><h4>Modules php nécessaires</h4>";
$modules = array("soap", "xsl", "xml", "ftp", "mysql", "calendar", "gd", "zlib", "ftp", "mbstring", "sockets");
foreach ($modules as $module) {
    affichage("Test de la présence du module PHP " . $module, clUpdater::testModule($module), false, false, false);