/** * @param string $inspectionIdentifier */ public function render($inspectionIdentifier) { $check = Tx_Smoothmigration_Service_Check_Registry::getInstance()->getActiveCheckByIdentifier($inspectionIdentifier); $this->templateVariableContainer->add('inspection', $check); $content = $this->renderChildren(); $this->templateVariableContainer->remove('inspection'); return $content; }
/** * @param Tx_Smoothmigration_Domain_Model_Issue $issue * * @return mixed */ public function render($issue) { $check = Tx_Smoothmigration_Service_Check_Registry::getInstance()->getActiveCheckByIdentifier($issue->getInspection()); if ($check !== NULL) { $this->templateVariableContainer->add('explanation', $check->getResultAnalyzer()->getExplanation($issue)); $this->templateVariableContainer->add('solution', $check->getResultAnalyzer()->getSolution($issue)); $content = $this->renderChildren(); $this->templateVariableContainer->remove('explanation'); $this->templateVariableContainer->remove('solution'); } return $content; }
/** * @param string $checkIdentifier * * @return string */ public function runTestAction($checkIdentifier) { $registry = Tx_Smoothmigration_Service_Check_Registry::getInstance(); $check = $registry->getActiveCheckByIdentifier($checkIdentifier); if ($check !== NULL) { $processor = $check->getProcessor(); $processor->execute(); foreach ($processor->getIssues() as $issue) { $this->issueRepository->add($issue); } return json_encode(array('result' => 'OK', 'issueCount' => count($processor->getIssues()))); } else { $this->response->setStatus(404, 'Check not found'); return json_encode(array('result' => 'ERROR')); } }
/** * Get available checks * * @return string */ private function getChecks() { $output = ''; $registry = Tx_Smoothmigration_Service_Check_Registry::getInstance(); $checks = $registry->getActiveChecks(); $maxLen = 0; /** @var Tx_Smoothmigration_Checks_AbstractCheckDefinition $check */ foreach ($checks as $check) { if (strlen($check->getIdentifier()) > $maxLen) { $maxLen = strlen($check->getIdentifier()); } } foreach ($checks as $check) { $output .= $check->getIdentifier() . substr($this->cli_indent(rtrim($check->getTitle()), $maxLen + 4), strlen($check->getIdentifier())) . LF; } return $output; }
/** * Display report for all issues or for a single extension * * The report command displays a report of found issues * * @param string $extensionKey A single extension to migratie * * @return void */ public function reportCommand($extensionKey = '') { $registry = Tx_Smoothmigration_Service_Check_Registry::getInstance(); /** @var Tx_Smoothmigration_Domain_Repository_IssueRepository $issueRepository */ $issueRepository = $this->objectManager->get('Tx_Smoothmigration_Domain_Repository_IssueRepository'); if ($extensionKey) { $issuesWithInspections = $issueRepository->findByExtensionGroupedByInspection($extensionKey); } else { $issuesWithInspections = $issueRepository->findAllGroupedByExtensionAndInspection(); } if (count($issuesWithInspections)) { foreach ($issuesWithInspections as $extensionKey => $inspections) { $count = 0; $notMigratedCount = 0; foreach ($inspections as $issues) { /** @var Tx_Smoothmigration_Domain_Model_Issue $singleIssue */ foreach ($issues as $singleIssue) { if ($count == 0) { // Render Extension Key $this->messageBus->headerMessage('Extension : ' . $singleIssue->getExtension(), 'info'); } $check = $registry->getActiveCheckByIdentifier($singleIssue->getInspection()); $migrationStatus = $singleIssue->getMigrationStatus(); Tx_Smoothmigration_Domain_Interface_Migration::SUCCESS; if ($check) { switch ($migrationStatus) { case Tx_Smoothmigration_Domain_Interface_Migration::SUCCESS: $this->messageBus->successMessage($check->getResultAnalyzer()->getSolution($singleIssue)); break; default: $this->messageBus->message($check->getResultAnalyzer()->getSolution($singleIssue)); $notMigratedCount++; } } $count++; } } $this->issueReport($notMigratedCount, $extensionKey); } } else { $this->issueReport('0', $extensionKey); } }
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } $checkArray = array('Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_Definition', 'Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_Definition', 'Tx_Smoothmigration_Checks_Core_Mysql_Definition', 'Tx_Smoothmigration_Checks_Core_Namespace_Definition', 'Tx_Smoothmigration_Checks_Core_RemovedConstants_Definition', 'Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_Definition', 'Tx_Smoothmigration_Checks_Core_Xclasses_Definition', 'Tx_Smoothmigration_Checks_Dam_CallToDamClasses_Definition', 'Tx_Smoothmigration_Checks_Database_Utf8_Definition', 'Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_Definition', 'Tx_Smoothmigration_Checks_Extension_Obsolete_Definition'); Tx_Smoothmigration_Service_Check_Registry::getInstance()->registerChecks($checkArray); $migrationArray = array('Tx_Smoothmigration_Migrations_Core_CallToDeprecatedStaticMethods_Definition', 'Tx_Smoothmigration_Migrations_Core_Namespace_Definition', 'Tx_Smoothmigration_Migrations_Core_RequireOnceInExtensions_Definition', 'Tx_Smoothmigration_Migrations_Database_CreateMissingTablesAndFields_Definition', 'Tx_Smoothmigration_Migrations_Database_Utf8_Definition'); Tx_Smoothmigration_Service_Migration_Registry::getInstance()->registerMigrations($migrationArray); $TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys']['smoothmigration'] = array(t3lib_extMgm::extPath('smoothmigration', 'Classes/Cli/class.smoothmigration_cli.php'), '_CLI_smoothmigration');