Skip to content
Snippets Groups Projects
Commit fbde4b8c authored by Laurent's avatar Laurent
Browse files

dev #17990 display logs only on command line

parent a426d4b8
Branches
Tags
2 merge requests!565Dev#17990 miop integration suite,!561Dev#17990 miop integration suite
......@@ -61,28 +61,28 @@ class Class_Import_Typo3 {
$_SERVER['HTTP_HOST']='localhost';
if ($what == 'all' || $what == 'users') {
echo "Importing users\n";
Class_Import_Typo3_Logs::getInstance()->addLogRow("\n\n ******** Importing users");
$this->import_user();
}
if ($what == 'all' || $what == 'articles') {
echo "Importing categories\n";
Class_Import_Typo3_Logs::getInstance()->addLogRow("\n\n ******** Importing categories");
$this->import_categories();
echo "Importing articles pages\n";
Class_Import_Typo3_Logs::getInstance()->addLogRow("\n\n ******** Importing articles pages");
$this->importArticlesPages();
echo "Importing articles\n";
Class_Import_Typo3_Logs::getInstance()->addLogRow("\n\n ******** Importing articles");
$this->importArticles();
echo "Importing events\n";
Class_Import_Typo3_Logs::getInstance()->addLogRow("\n\n ******** Importing events");
$this->importCalendar();
echo "Importing sites\n";
Class_Import_Typo3_Logs::getInstance()->addLogRow("\n\n ******** Importing sites");
$this->importSites();
}
Class_Import_Typo3_Logs::getInstance()->report();
return Class_Import_Typo3_Logs::getInstance()->report();
}
......
......@@ -35,7 +35,8 @@ class Class_Import_Typo3_logs {
$_saved_domains = 0,
$_rejected_articles,
$_saved_categories_article = 0,
$_saved_categories_sito = 0;
$_saved_categories_sito = 0,
$_output_activated = false;
public static function getInstance() {
......@@ -46,6 +47,12 @@ class Class_Import_Typo3_logs {
}
public function activateOutput() {
$this->_output_activated = true;
return $this;
}
public function getLogs() {
return $this->_logs;
}
......@@ -56,7 +63,10 @@ class Class_Import_Typo3_logs {
public function addLogRow($log) {
$this->_logs .= $log . '\n';
$this->_logs .= $log . "\n";
if ($this->_output_activated) {
echo $log."\n";
}
return $this;
}
......
......@@ -11,7 +11,8 @@ require('console.php');
$toRun = $argv[1];
Class_Import_Typo3_Logs::getInstance()->activateOutput();
$migration = new Class_Import_Typo3();
$migration->run($toRun);
?>
\ No newline at end of file
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