/** * * @param string $linea * @return array */ function fixLineValue($linea) { $array1 = explode("\"", $linea); $fieldSeparator = ";"; if (count($array1) % 2 == 1) { $line = $linea; $index = 0; $indexes = array(); $continuar = true; $tmp = ""; while ($continuar == true) { $indexes = getIndexes($line, $index); //print_r($indexes); if ($indexes == null) { $continuar = false; } else { $index = $indexes[1] + 1; $tmp = substr($line, $indexes[0] + 1, $indexes[1] - $indexes[0] - 1) . "<br>"; $tmp = preg_replace("/;/", " ", $tmp); $line = substr($line, 0, $indexes[0]) . $tmp . substr($line, $indexes[1] + 1); //echo $line."<br><br><br>"; } } $linea = explode($fieldSeparator, $line); } return $linea; }
/** * Tests index fails. * * @return void */ public function testIndexCreationFail() { R::nuke(); $book = R::dispense('book'); $book->author_id = 'a'; R::store($book); $indexes = getIndexes('book'); //should just work fine asrt(in_array('index_foreignkey_book_author', $indexes), TRUE); //these should just pass, no indexes but no errors as well R::getWriter()->addIndex('book', 'bla', 'nonexist'); pass(); R::getWriter()->addIndex('book', '@#$', 'nonexist'); pass(); R::getWriter()->addIndex('nonexist', 'bla', 'nonexist'); pass(); $indexesAfter = getIndexes('book'); asrt(count($indexesAfter), count($indexes)); }
$pdf->Image("_temp/" . $filename . getExtension($gallery[0]->getTypeImage()), 25, 20); } } } foreach ($notes as $note) { if ($note->getNote() === "Hipótesis de Gestión Económica y Composición del Precio") { $pdf->SetY(125); $pdf->MultiCell(0, 5, $note->getNoteText()); } } $pdf->Output(); break; case '3': $pdf = new FPDF(); $pdf->AddPage(); $indexes = getIndexes(); // Títulos de las columnas $header = array('País', 'Capital', 'Superficie (km2)', 'Pobl. (en miles)'); // Carga de datos $pdf->SetFont('Arial', '', 14); $pdf->AddPage(); foreach ($header as $col) { $pdf->Cell(40, 7, $col, 1); } $pdf->Ln(); foreach ($indexes as $row) { foreach ($row as $col) { $pdf->Cell(40, 6, $row, 1); } $pdf->Ln(); }
MatrixDAL::restoreDb(); if ($first_run) { pre_echo('Dropping destination sequences'); $del_seqs = getSequences(); foreach ($del_seqs as $sequence) { printName('Dropping: ' . strtolower($sequence)); $sql = 'DROP SEQUENCE ' . $sequence; $ok = MatrixDAL::executeSql($sql); if ($ok === false) { printUpdateStatus('Failure, unable to run query: ' . $sql); exit; } printUpdateStatus('OK'); } pre_echo('Dropping destination indexes'); $del_indexes = getIndexes(); foreach ($del_indexes as $index) { if (substr($index, 0, 3) == 'sq_') { printName('Dropping: ' . $index); $sql = 'DROP INDEX ' . $index; $ok = MatrixDAL::executeSql($sql); if ($ok === false) { printUpdateStatus('Failure, unable to run query: ' . $sql); exit; } printUpdateStatus('OK'); } //end if } //end foreach }
* * Postgres does this automatically. * * It changes this: * ((assetid || '~' || attrid)); * to * ((((assetid)::text||'~'::text)||attrid)) * * So just skip checking those definitions. */ $skip_definition_checks = array('sq_ast_attr_val_concat', 'sq_rb_ast_attr_val_concat'); /** * Keep this here so we can reference the index definition if necessary */ $dbtype = _getDbType(); $index_info = getIndexes(); $full_index_list = $index_info['index_list']; $parallel_list = $index_info['parallel_list']; $constraint_list = $index_info['constraint_list']; pre_echo('Checking Indexes'); $sql_commands = array(); $bad_indexes = array(); $parallel_warnings = array(); $postgres_primary_key_warnings = array(); $packages = $GLOBALS['SQ_SYSTEM']->getInstalledPackages(); foreach ($packages as $_pkgid => $pkg_details) { $pkg_name = $pkg_details['code_name']; if ($pkg_name == '__core__') { $file = $SYSTEM_ROOT . '/core/assets/tables.xml'; } else { $file = SQ_PACKAGES_PATH . '/' . $pkg_name . '/tables.xml';
echo 'Aktualisiere Tabelle base_veranstaltung<br />'; $libDb->query('ALTER TABLE base_veranstaltung ADD datum_ende DATETIME NULL AFTER datum'); } if (!in_array('fb_eventid', $columnsBaseVeranstaltung)) { echo 'Aktualisiere Tabelle base_veranstaltung<br />'; $libDb->query('ALTER TABLE base_veranstaltung ADD fb_eventid VARCHAR(255) NULL'); } if (!in_array('intern', $columnsBaseVeranstaltung)) { echo 'Aktualisiere Tabelle base_veranstaltung<br />'; $libDb->query('ALTER TABLE base_veranstaltung ADD intern tinyint(1) NOT NULL default 0'); } /** * Tabelle base_person aktualisieren */ $columnsBasePerson = getColumns('base_person'); $indexesBasePerson = getIndexes('base_person'); if (in_array('username', $indexesBasePerson)) { echo 'Aktualisiere Index auf Tabelle base_person<br />'; $libDb->query('DROP INDEX username ON base_person'); } if (in_array('austritt_grund', $columnsBasePerson)) { echo 'Aktualisiere Tabelle base_person<br />'; $libDb->query('ALTER TABLE base_person DROP austritt_grund'); } if (in_array('password_salt', $columnsBasePerson)) { echo 'Aktualisiere Tabelle base_person<br />'; $libDb->query('ALTER TABLE base_person DROP password_salt'); } if (in_array('icq', $columnsBasePerson)) { echo 'Aktualisiere Tabelle base_person<br />'; $libDb->query('ALTER TABLE base_person DROP icq');