Example #1
0
 public static function cbd_run()
 {
     $proc = new XSLTProcessor();
     $proc->importStyleSheet(DOMDocument::load('xsl/cbd.xsl'));
     global $registerPHPFunctions;
     if ($registerPHPFunctions) {
         $proc->registerPHPFunctions($registerPHPFunctions);
     }
     $cbd_xml = $proc->transformToDoc(DOMDocument::load('db://?all-data'));
     $xml = simplexml_import_dom($cbd_xml) or die('import failed');
     global $cbd_host, $cbd_db, $cbd_user, $cbd_pwd;
     $conn_pg = pg_connect("host='{$cbd_host}' dbname={$cbd_db} user={$cbd_user} password={$cbd_pwd}") or die("error on connection to {$cbd_db}");
     Importer::_run($xml, $conn_pg);
 }