Commit ac7452b0 authored by efalcy's avatar efalcy

dev #19573 : extract database name on typo3.php

parent 305807c7
......@@ -35,8 +35,8 @@ class Class_Import_Typo3 {
$user_mapper,
$unknown_koha_urls = [];
public function __construct() {
$this->t3db = new Typo3DB();
public function __construct($dbname) {
$this->t3db = new Typo3DB($dbname);
$this->report = ['categories_created' => 0,
'domaine_created' => 0,
'categories_sites_created' => 0,
......@@ -1049,7 +1049,7 @@ class Typo3DB {
$t3db,
$pages_titles;
public function __construct() {
public function __construct($db_name) {
$this->t3db = new Class_Systeme_Sql('','','','');
$this
->t3db
......@@ -1058,8 +1058,7 @@ class Typo3DB {
['host' => 'localhost',
'username' => 'root',
'password' => 'root',
// 'dbname' => 'miop_typo3']));
'dbname' => 'miopencoding']));
'dbname' => $db_name ]));
}
......
<?php
/*
*
* Launch import_typo3.php like:
* php import_typo3.php <arg>
* <arg> can be users (import users only), docu(update dossiers documentaires only), articles (import articles only) or all (import all)
......@@ -12,7 +13,7 @@ require('console.php');
$toRun = $argv[1];
Class_Import_Typo3_Logs::getInstance()->activateOutput();
$migration = new Class_Import_Typo3();
$migration = new Class_Import_Typo3('miop_typo3');
if ($toRun=="update" && sizeof($argv)<3) {
echo "Missing last update date\n";
......
......@@ -50,7 +50,7 @@ abstract class Import_Typo3TestCase extends ModelTestCase {
'priority' => 1,
'model' => 'Article']);
$this->migration = new Class_Import_Typo3();
$this->migration = new Class_Import_Typo3('miop_test');
$this->migration->setTypo3DB(new MockTypo3DB());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment