Index: branches/new-installer/phase3/includes/GlobalFunctions.php |
— | — | @@ -3362,3 +3362,14 @@ |
3363 | 3363 | $langCode = implode ( '-' , $codeBCP ); |
3364 | 3364 | return $langCode; |
3365 | 3365 | } |
| 3366 | + |
| 3367 | +function wfArrayMap( $function, $input ) { |
| 3368 | + $ret = array_map( $function, $input ); |
| 3369 | + foreach ( $ret as $key => $value ) { |
| 3370 | + $taint = istainted( $input[$key] ); |
| 3371 | + if ( $taint ) { |
| 3372 | + taint( $ret[$key], $taint ); |
| 3373 | + } |
| 3374 | + } |
| 3375 | + return $ret; |
| 3376 | +} |
Index: branches/new-installer/phase3/includes/db/SchemaBuilder.php |
— | — | @@ -485,4 +485,89 @@ |
486 | 486 | protected function updateTable( $name, $definition, $db ) { |
487 | 487 | return ''; |
488 | 488 | } |
489 | | -} |
\ No newline at end of file |
| 489 | +} |
| 490 | + |
| 491 | +class OracleSchema extends SchemaBuilder { |
| 492 | + |
| 493 | + public function getType() { |
| 494 | + return 'oracle'; |
| 495 | + } |
| 496 | + |
| 497 | + protected function adjustTablesForDatabase() { |
| 498 | + $this->tables['searchindex'] = array( |
| 499 | + 'prefix' => 'si', |
| 500 | + 'fields' => array( |
| 501 | + 'page' => array( |
| 502 | + 'type' => 'int', |
| 503 | + 'null' => false, |
| 504 | + ), |
| 505 | + 'title' => array( |
| 506 | + 'type' => 'varchar', |
| 507 | + 'length' => 255, |
| 508 | + 'null' => false, |
| 509 | + 'default' => '', |
| 510 | + ), |
| 511 | + 'text' => array( |
| 512 | + 'type' => 'text', |
| 513 | + 'null' => false, |
| 514 | + ), |
| 515 | + ), |
| 516 | + 'indexes' => array( |
| 517 | + 'si_page' => array( |
| 518 | + 'UNIQUE', 'page', |
| 519 | + ), |
| 520 | + 'si_title' => array( |
| 521 | + 'CTXSYS.CONTEXT', 'title', |
| 522 | + ), |
| 523 | + 'si_text' => array( |
| 524 | + 'CTXSYS.CONTEXT', 'text', |
| 525 | + ), |
| 526 | + ), |
| 527 | + ); |
| 528 | + } |
| 529 | + |
| 530 | + protected function createTable( $name, $def ) { |
| 531 | + $prefix = $def['prefix'] ? $def['prefix'] . '_' : ''; |
| 532 | + $tblName = $this->tblPrefix . $name; |
| 533 | + |
| 534 | + $sql = "CREATE TABLE $tblName ("; |
| 535 | + foreach( $def['fields'] as $field => $attribs ) { |
| 536 | + $sql .= "\n\t{$prefix}{$field} " . $this->getFieldDefinition( $attribs ); |
| 537 | + } |
| 538 | + $sql = rtrim( $sql, ',' ); |
| 539 | + $sql .= ");\n"; |
| 540 | + |
| 541 | + $idx_i = 0; |
| 542 | + $idx_u = 0; |
| 543 | + if( isset( $def['indexes'] ) ) { |
| 544 | + foreach( $def['indexes'] as $idx => $idxDef ) { |
| 545 | + $idxType = ''; |
| 546 | + if (isset($idxDef[1])) { |
| 547 | + $idxType = array_shift( $idxDef ); |
| 548 | + } |
| 549 | + |
| 550 | + if( $idxType === 'UNIQUE' ) { |
| 551 | + $sql .= "CREATE UNIQUE INDEX {$tblName}_u". |
| 552 | + str_pad(++$idx_u, 2, "0", STR_PAD_LEFT). |
| 553 | + " ON {$tblName} ("; |
| 554 | + } elseif ($idxType !== '') { |
| 555 | + $sql .= "CREATE INDEX {$this->tblPrefix}{$idx} ON {$tblName} ("; |
| 556 | + } else { |
| 557 | + $sql .= "CREATE INDEX {$tblName}_u". |
| 558 | + str_pad(++$idx_i, 2, "0", STR_PAD_LEFT). |
| 559 | + " ON {$tblName} ("; |
| 560 | + } |
| 561 | + |
| 562 | + foreach( $idxDef as $col ) { |
| 563 | + $sql .= "{$prefix}{$col}, "; |
| 564 | + } |
| 565 | + $sql = rtrim( $sql, ', ' ); |
| 566 | + $sql .= ");\n"; |
| 567 | + } |
| 568 | + } |
| 569 | + return $sql . "\n"; |
| 570 | + } |
| 571 | + |
| 572 | + protected function updateTable( $name, $definition, $db ) {} |
| 573 | + |
| 574 | +} |
Index: branches/new-installer/phase3/includes/installer/Installer.php |
— | — | @@ -82,7 +82,8 @@ |
83 | 83 | var $dbTypes = array( |
84 | 84 | 'mysql', |
85 | 85 | 'postgres', |
86 | | - 'sqlite' |
| 86 | + 'sqlite', |
| 87 | + 'oracle' |
87 | 88 | ); |
88 | 89 | |
89 | 90 | /** |
Index: branches/new-installer/phase3/includes/AutoLoader.php |
— | — | @@ -433,6 +433,7 @@ |
434 | 434 | 'MysqlInstaller' => 'includes/installer/MysqlInstaller.php', |
435 | 435 | 'PostgresInstaller' => 'includes/installer/PostgresInstaller.php', |
436 | 436 | 'SqliteInstaller' => 'includes/installer/SqliteInstaller.php', |
| 437 | + 'OracleInstaller' => 'includes/installer/OracleInstaller.php', |
437 | 438 | |
438 | 439 | # includes/media |
439 | 440 | 'BitmapHandler' => 'includes/media/Bitmap.php', |
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php |
— | — | @@ -4274,9 +4274,11 @@ |
4275 | 4275 | 'config-type-mysql' => 'MySQL', |
4276 | 4276 | 'config-type-postgres' => 'PostgreSQL', |
4277 | 4277 | 'config-type-sqlite' => 'SQLite', |
| 4278 | +'config-type-oracle' => 'Oracle', |
4278 | 4279 | 'config-header-mysql' => 'MySQL settings', |
4279 | 4280 | 'config-header-postgres' => 'PostgreSQL settings', |
4280 | 4281 | 'config-header-sqlite' => 'SQLite settings', |
| 4282 | +'config-header-oracle' => 'Oracle settings', |
4281 | 4283 | 'config-invalid-db-type' => 'Invalid database type', |
4282 | 4284 | 'config-missing-db-name' => 'You must enter a value for "Database name"', |
4283 | 4285 | 'config-invalid-db-name' => 'Invalid database name "$1". It may only contain numbers, letters and underscores.', |