[INIT] Original source
authorMarkus Klein <markus.klein@reelworx.at>
Thu, 14 May 2015 01:48:01 +0000 (03:48 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 14 May 2015 12:11:13 +0000 (14:11 +0200)
129 files changed:
Classes/Checks/AbstractCheckDefinition.php [new file with mode: 0644]
Classes/Checks/AbstractCheckProcessor.php [new file with mode: 0644]
Classes/Checks/AbstractCheckResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Core/CallToDeprecatedStaticMethods/Definition.php [new file with mode: 0644]
Classes/Checks/Core/CallToDeprecatedStaticMethods/Processor.php [new file with mode: 0644]
Classes/Checks/Core/CallToDeprecatedStaticMethods/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Core/CallToDeprecatedViewHelpers/Definition.php [new file with mode: 0644]
Classes/Checks/Core/CallToDeprecatedViewHelpers/Processor.php [new file with mode: 0644]
Classes/Checks/Core/CallToDeprecatedViewHelpers/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Core/MissingAddPluginParameter/Definition.php [new file with mode: 0644]
Classes/Checks/Core/MissingAddPluginParameter/Processor.php [new file with mode: 0644]
Classes/Checks/Core/MissingAddPluginParameter/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Core/Mysql/Definition.php [new file with mode: 0644]
Classes/Checks/Core/Mysql/Processor.php [new file with mode: 0644]
Classes/Checks/Core/Mysql/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Core/Namespace/Definition.php [new file with mode: 0644]
Classes/Checks/Core/Namespace/Processor.php [new file with mode: 0644]
Classes/Checks/Core/Namespace/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Core/RemovedConstants/Definition.php [new file with mode: 0644]
Classes/Checks/Core/RemovedConstants/Processor.php [new file with mode: 0644]
Classes/Checks/Core/RemovedConstants/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Core/RequireOnceInExtensions/Definition.php [new file with mode: 0644]
Classes/Checks/Core/RequireOnceInExtensions/Processor.php [new file with mode: 0644]
Classes/Checks/Core/RequireOnceInExtensions/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Core/Xclasses/Definition.php [new file with mode: 0644]
Classes/Checks/Core/Xclasses/Processor.php [new file with mode: 0644]
Classes/Checks/Core/Xclasses/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Dam/CallToDamClasses/Definition.php [new file with mode: 0644]
Classes/Checks/Dam/CallToDamClasses/Processor.php [new file with mode: 0644]
Classes/Checks/Dam/CallToDamClasses/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Database/Utf8/Definition.php [new file with mode: 0644]
Classes/Checks/Database/Utf8/Processor.php [new file with mode: 0644]
Classes/Checks/Database/Utf8/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Extension/IncompatibleWithLts/Definition.php [new file with mode: 0644]
Classes/Checks/Extension/IncompatibleWithLts/Processor.php [new file with mode: 0644]
Classes/Checks/Extension/IncompatibleWithLts/ResultAnalyzer.php [new file with mode: 0644]
Classes/Checks/Extension/Obsolete/Definition.php [new file with mode: 0644]
Classes/Checks/Extension/Obsolete/Processor.php [new file with mode: 0644]
Classes/Checks/Extension/Obsolete/ResultAnalyzer.php [new file with mode: 0644]
Classes/Cli/CommandManager.php [new file with mode: 0644]
Classes/Cli/class.smoothmigration_cli.php [new file with mode: 0644]
Classes/Controller/AbstractCommandController.php [new file with mode: 0644]
Classes/Controller/AbstractModuleController.php [new file with mode: 0644]
Classes/Controller/AjaxController.php [new file with mode: 0644]
Classes/Controller/ReportController.php [new file with mode: 0644]
Classes/Controller/SmoothmigrationCommandController.php [new file with mode: 0644]
Classes/Domain/Interface/Check.php [new file with mode: 0644]
Classes/Domain/Interface/CheckDescription.php [new file with mode: 0644]
Classes/Domain/Interface/CheckProcessor.php [new file with mode: 0644]
Classes/Domain/Interface/CheckRequirements.php [new file with mode: 0644]
Classes/Domain/Interface/CheckResultAnalyzer.php [new file with mode: 0644]
Classes/Domain/Interface/Description.php [new file with mode: 0644]
Classes/Domain/Interface/IssueLocation.php [new file with mode: 0644]
Classes/Domain/Interface/Migration.php [new file with mode: 0644]
Classes/Domain/Interface/MigrationDescription.php [new file with mode: 0644]
Classes/Domain/Interface/MigrationProcessor.php [new file with mode: 0644]
Classes/Domain/Interface/MigrationRequirements.php [new file with mode: 0644]
Classes/Domain/Interface/MigrationResultAnalyzer.php [new file with mode: 0644]
Classes/Domain/Interface/Processor.php [new file with mode: 0644]
Classes/Domain/Interface/Requirements.php [new file with mode: 0644]
Classes/Domain/Interface/ResultAnalyzer.php [new file with mode: 0644]
Classes/Domain/Model/Deprecation.php [new file with mode: 0644]
Classes/Domain/Model/Issue.php [new file with mode: 0644]
Classes/Domain/Model/IssueLocation/Configuration.php [new file with mode: 0644]
Classes/Domain/Model/IssueLocation/Database.php [new file with mode: 0644]
Classes/Domain/Model/IssueLocation/Extension.php [new file with mode: 0644]
Classes/Domain/Model/IssueLocation/File.php [new file with mode: 0644]
Classes/Domain/Model/IssueLocation/PhysicalLocation.php [new file with mode: 0644]
Classes/Domain/Repository/DeprecationRepository.php [new file with mode: 0644]
Classes/Domain/Repository/IssueRepository.php [new file with mode: 0644]
Classes/Migrations/AbstractMigrationDefinition.php [new file with mode: 0644]
Classes/Migrations/AbstractMigrationProcessor.php [new file with mode: 0644]
Classes/Migrations/Core/CallToDeprecatedStaticMethods/Definition.php [new file with mode: 0644]
Classes/Migrations/Core/CallToDeprecatedStaticMethods/Processor.php [new file with mode: 0644]
Classes/Migrations/Core/MissingAddPluginParameter/Definition.php [new file with mode: 0644]
Classes/Migrations/Core/MissingAddPluginParameter/Processor.php [new file with mode: 0644]
Classes/Migrations/Core/Namespace/Definition.php [new file with mode: 0644]
Classes/Migrations/Core/Namespace/Processor.php [new file with mode: 0644]
Classes/Migrations/Core/RequireOnceInExtensions/Definition.php [new file with mode: 0644]
Classes/Migrations/Core/RequireOnceInExtensions/Processor.php [new file with mode: 0644]
Classes/Migrations/Core/Xclasses/Definition.php [new file with mode: 0644]
Classes/Migrations/Core/Xclasses/Processor.php [new file with mode: 0644]
Classes/Migrations/Database/CreateMissingTablesAndFields/Definition.php [new file with mode: 0644]
Classes/Migrations/Database/CreateMissingTablesAndFields/Processor.php [new file with mode: 0644]
Classes/Migrations/Database/Utf8/Definition.php [new file with mode: 0644]
Classes/Migrations/Database/Utf8/Processor.php [new file with mode: 0644]
Classes/Service/Check/Registry.php [new file with mode: 0644]
Classes/Service/ClassAliasProvider.php [new file with mode: 0644]
Classes/Service/MessageService.php [new file with mode: 0644]
Classes/Service/Migration/Registry.php [new file with mode: 0644]
Classes/Service/RequirementsAnalyzer.php [new file with mode: 0644]
Classes/UserFunctions/Tca.php [new file with mode: 0644]
Classes/Utility/DatabaseUtility.php [new file with mode: 0644]
Classes/Utility/ExtensionUtility.php [new file with mode: 0644]
Classes/Utility/FileLocatorUtility.php [new file with mode: 0644]
Classes/ViewHelpers/IfMigrationAvailableViewHelper.php [new file with mode: 0644]
Classes/ViewHelpers/InspectionViewHelper.php [new file with mode: 0644]
Classes/ViewHelpers/ResultAnalyzerViewHelper.php [new file with mode: 0644]
Configuration/TCA/tx_smoothmigration_domain_model_deprecation.php [new file with mode: 0644]
Configuration/TCA/tx_smoothmigration_domain_model_issue.php [new file with mode: 0644]
Documentation/Changelog/Index.rst [new file with mode: 0644]
Documentation/Includes.txt [new file with mode: 0644]
Documentation/Index.rst [new file with mode: 0644]
Documentation/Installation/Index.rst [new file with mode: 0644]
Documentation/Settings.yml [new file with mode: 0644]
Documentation/UserManual/Index.rst [new file with mode: 0644]
README.md [new file with mode: 0644]
Resources/Private/Language/locallang.xml [new file with mode: 0644]
Resources/Private/Language/locallang_mod.xml [new file with mode: 0644]
Resources/Private/Layouts/module.html [new file with mode: 0644]
Resources/Private/Templates/Report/Checks.html [new file with mode: 0644]
Resources/Private/Templates/Report/Extension.html [new file with mode: 0644]
Resources/Private/Templates/Report/PageIdList.html [new file with mode: 0644]
Resources/Private/Templates/Report/ReportOverview.html [new file with mode: 0644]
Resources/Private/Templates/Report/Show.html [new file with mode: 0644]
Resources/Public/Images/ModuleIcon.png [new file with mode: 0644]
Resources/Public/JavaScript/General.js [new file with mode: 0644]
Resources/Public/JavaScript/jquery-1.10.1.min.js [new file with mode: 0644]
Resources/Public/JavaScript/sprintf.min.js [new file with mode: 0644]
Resources/Public/StyleSheet/module.css [new file with mode: 0644]
ext_autoload.php [new file with mode: 0644]
ext_conf_template.txt [new file with mode: 0644]
ext_emconf.php [new file with mode: 0644]
ext_icon.gif [new file with mode: 0644]
ext_localconf.php [new file with mode: 0644]
ext_tables.php [new file with mode: 0644]
ext_tables.sql [new file with mode: 0644]
ext_tables_static+adt.sql [new file with mode: 0644]
ext_typoscript_setup.txt [new file with mode: 0644]

diff --git a/Classes/Checks/AbstractCheckDefinition.php b/Classes/Checks/AbstractCheckDefinition.php
new file mode 100644 (file)
index 0000000..a966fab
--- /dev/null
@@ -0,0 +1,197 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_AbstractCheckDefinition
+ *
+ * @author Steffen Ritter
+ */
+abstract class Tx_Smoothmigration_Checks_AbstractCheckDefinition implements Tx_Smoothmigration_Domain_Interface_Check {
+
+       /**
+        *
+        * @var Tx_Extbase_Object_ObjectManager
+        */
+       protected $objectManager;
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               if (t3lib_div::int_from_ver(TYPO3_version) < 6001000) {
+                       $this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+               } else {
+                       $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\CMS\Extbase\Object\ObjectManager');
+               }
+       }
+
+       /**
+        * Return the minimum TYPO3 Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMinimalTypo3Version() {
+               return '';
+       }
+
+       /**
+        * Return the maximal TYPO3 Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMaximalTypo3Version() {
+               return '';
+       }
+
+       /**
+        * Return the minimum PHP Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMinimalPhpVersion() {
+               return '';
+       }
+
+       /**
+        * Return the maximal PHP Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMaximalPhpVersion() {
+               return '';
+       }
+
+       /**
+        * Returns an array of php-modules, which need to be available
+        * to activate this check;
+        *
+        * Empty array is returned if no special modules are needed
+        *
+        * @return string[]
+        */
+       public function getRequiredAvailablePhpModules() {
+               return array();
+       }
+
+       /**
+        * Returns an array of php-modules, which need to be absent
+        * to activate this check
+        *
+        * Empty array is returned if there are no missing php-modules
+        *
+        * @return string[]
+        */
+       public function getRequiredAbsentPhpModules() {
+               return array();
+       }
+
+       /**
+        * Returns an array of Extensions which are required by this check.
+        *
+        * The array may either contain the extension-key as array key while a
+        * a version-range (x.x.x-y.y.y)is provided as value or only the extension-key
+        * as value which then will just check for presence of the given extension.
+        *
+        * @return array
+        */
+       public function getRequiredExtensions() {
+               return array();
+       }
+
+       /**
+        * Returns an array of Extensions which make this check either obsolete,
+        * or this check is incompatible to.
+        *
+        * @return array
+        */
+       public function getConflictingExtensions() {
+               return array();
+       }
+
+       /**
+        * Returns the name of the check
+        *
+        * @return string
+        */
+       public function getTitle() {
+               return $this->getLanguageLabelForCheck('title');
+       }
+
+       /**
+        * Returns the Type of the Check
+        * One of the Constants Defined in that interface
+        *
+        * @return int
+        */
+       public function getType() {
+               return Tx_Smoothmigration_Domain_Interface_CheckDescription::TYPE_PHP_CODE;
+       }
+
+       /**
+        * Returns a string which describes the check in one sentence.
+        *
+        * @return string
+        */
+       public function getShortDescription() {
+               return $this->getLanguageLabelForCheck('shortDescription');
+       }
+
+       /**
+        * Returns a string which contains an elaborate description
+        * of what the check does.
+        *
+        * @return string
+        */
+       public function getDescription() {
+               return $this->getLanguageLabelForCheck('description');
+       }
+
+       /**
+        * Get language label for check
+        *
+        * @param $field
+        *
+        * @return mixed
+        */
+       protected function getLanguageLabelForCheck($field) {
+               $classParts = explode('_', __CLASS__);
+               $extensionName = strtolower($classParts[1]);
+               return $GLOBALS['LANG']->sL(
+                       'LLL:EXT:' . $extensionName . '/Resources/Private/Language/locallang.xml:check.' . $this->getIdentifier() . '.' . $field
+               );
+       }
+
+       /**
+        * Get objectManager
+        *
+        * @return Tx_Extbase_Object_ObjectManager
+        */
+       public function getObjectManager() {
+               return $this->objectManager;
+       }
+
+}
diff --git a/Classes/Checks/AbstractCheckProcessor.php b/Classes/Checks/AbstractCheckProcessor.php
new file mode 100644 (file)
index 0000000..a1e18d4
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_AbstractCheckProcessor
+ *
+ * @author Michiel Roos
+ */
+abstract class Tx_Smoothmigration_Checks_AbstractCheckProcessor implements Tx_Smoothmigration_Domain_Interface_CheckProcessor {
+
+       /**
+        * @var string
+        */
+       private $extensionKey = NULL;
+
+       /**
+        * @var Tx_Smoothmigration_Domain_Model_Issue[]
+        */
+       protected $issues = array();
+
+       /**
+        * @var Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_Definition
+        */
+       protected $parentCheck;
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Interface_Check $check
+        */
+       public function __construct(Tx_Smoothmigration_Domain_Interface_Check $check) {
+               $this->parentCheck = $check;
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Model_Issue[]
+        */
+       public function getIssues() {
+               return $this->issues;
+       }
+
+       /**
+        * @return boolean
+        */
+       public function hasIssues() {
+               return count($this->issues) > 0;
+       }
+
+       /**
+        * @return string
+        */
+       public function getExtensionKey() {
+               return $this->extensionKey;
+       }
+
+       /**
+        * @param string $extensionKey
+        *
+        * @return $this to allow for chaining
+        */
+       public function setExtensionKey($extensionKey) {
+               $this->extensionKey = $extensionKey;
+
+               return $this;
+       }
+
+}
diff --git a/Classes/Checks/AbstractCheckResultAnalyzer.php b/Classes/Checks/AbstractCheckResultAnalyzer.php
new file mode 100644 (file)
index 0000000..7900473
--- /dev/null
@@ -0,0 +1,111 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer implements Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer {
+
+       /**
+        * @var object
+        */
+       protected $parentCheck;
+
+       /**
+        * @var Tx_Extbase_Utility_Localization
+        */
+       protected $translator;
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Interface_Check $check
+        */
+       public function __construct(Tx_Smoothmigration_Domain_Interface_Check $check) {
+               $this->parentCheck = $check;
+               $translator = t3lib_div::makeInstance('Tx_Extbase_Utility_Localization');
+               $this->injectTranslator($translator);
+       }
+
+       /**
+        * Injects the Localization Utility
+        *
+        * @param Tx_Extbase_Utility_Localization $translator
+        *        An instance of the Localization Utility
+        * @return void
+        */
+       public function injectTranslator(Tx_Extbase_Utility_Localization $translator) {
+               $this->translator = $translator;
+       }
+
+       /**
+        * Shortcut function for fetching language labels
+        *
+        * @param $key
+        * @param $arguments
+        * @return string
+        */
+       public function ll($key, $arguments = NULL) {
+               return $this->translator->translate($key, 'smoothmigration', $arguments);
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSeverity(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return 0;
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return '';
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return '';
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getRawTextForCopyPaste(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return '';
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Core/CallToDeprecatedStaticMethods/Definition.php b/Classes/Checks/Core/CallToDeprecatedStaticMethods/Definition.php
new file mode 100644 (file)
index 0000000..245068c
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_Definition
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-core-code-callToDeprecatedStaticMethods';
+       }
+
+}
diff --git a/Classes/Checks/Core/CallToDeprecatedStaticMethods/Processor.php b/Classes/Checks/Core/CallToDeprecatedStaticMethods/Processor.php
new file mode 100644 (file)
index 0000000..fa38f71
--- /dev/null
@@ -0,0 +1,123 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the
+ * license from the author is found in LICENSE.txt distributed with these
+ * scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class
+ * Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_Definition
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * @var Tx_Smoothmigration_Domain_Repository_DeprecationRepository
+        */
+       protected $deprecationRepository;
+
+       /**
+        * Inject the deprecation repository
+        *
+        * @param Tx_Smoothmigration_Domain_Repository_DeprecationRepository $deprecationRepository
+        *
+        * @return void
+        */
+       public function injectDeprecationRepository(Tx_Smoothmigration_Domain_Repository_DeprecationRepository $deprecationRepository) {
+               $this->deprecationRepository = $deprecationRepository;
+       }
+
+       /**
+        * Execute the check
+        *
+        * @return void
+        */
+       public function execute() {
+               $regularExpression = $this->generateRegularExpression();
+               if (trim($regularExpression)) {
+                       if ($this->getExtensionKey()) {
+                               $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtension(
+                                       $this->getExtensionKey(),
+                                       '.*\.(php|inc)$',
+                                       $regularExpression
+                               );
+                       } else {
+                               $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtensions(
+                                       '.*\.(php|inc)$',
+                                       $regularExpression
+                               );
+                       }
+                       foreach ($locations as $location) {
+                               $issue = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+                               $issue->setAdditionalInformation($this->getRepleacabilityReport($location));
+                               $this->issues[] = $issue;
+                       }
+               }
+       }
+
+       /**
+        * See if we can replace the found deprecation
+        *
+        * @param Tx_Smoothmigration_Domain_Model_IssueLocation_File $location
+        *
+        * @return array
+        */
+       protected function getRepleacabilityReport($location) {
+               $report = array();
+               $match = $location->getMatchedString();
+               $match = rtrim($match, '(');
+               list($class, $method) = explode('::', $match);
+               $deprecation = $this->deprecationRepository->findOneStaticByClassAndMethod($class, $method);
+               if ($deprecation instanceof Tx_Smoothmigration_Domain_Model_Deprecation) {
+                       $report['isReplaceable'] = $deprecation->getNoBrainer();
+                       $report['replacementClass'] = $deprecation->getReplacementClass();
+                       $report['replacementMethod'] = $deprecation->getReplacementMethod();
+                       $report['replacementMessage'] = $deprecation->getReplacementMessage();
+                       $report['deprecationMessage'] = $deprecation->getMessage();
+                       $report['regexSearch'] = $deprecation->getRegexSearch();
+                       $report['regexReplace'] = $deprecation->getRegexReplace();
+               } else {
+                       $report['isReplaceable'] = FALSE;
+               }
+
+               return $report;
+       }
+
+       /**
+        * Generate a regular expression to search for all deprecated static calls
+        */
+       protected function generateRegularExpression() {
+               $regularExpression = array();
+
+               $deprecatedMethods = $this->deprecationRepository->findByIsStatic(TRUE);
+               foreach ($deprecatedMethods as $deprecatedMethod) {
+                       $regularExpression[] = $deprecatedMethod->getClass() . '::' . $deprecatedMethod->getMethod() . '\s?\(';
+               }
+
+               return '(' . implode('|', $regularExpression) . ')';
+       }
+
+}
diff --git a/Classes/Checks/Core/CallToDeprecatedStaticMethods/ResultAnalyzer.php b/Classes/Checks/Core/CallToDeprecatedStaticMethods/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..7458b4a
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_ResultAnalyzer
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-core-code-callToDeprecatedStaticMethods.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-core-code-callToDeprecatedStaticMethods.solution',
+                       array(
+                               $issue->getLocation()->getMatchedString(),
+                               $issue->getLocation()->getFilePath(),
+                               $issue->getLocation()->getLineNumber()
+                       )
+               );
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Core/CallToDeprecatedViewHelpers/Definition.php b/Classes/Checks/Core/CallToDeprecatedViewHelpers/Definition.php
new file mode 100644 (file)
index 0000000..4708ad5
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_Definition
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-core-code-callToDeprecatedViewHelpers';
+       }
+
+}
diff --git a/Classes/Checks/Core/CallToDeprecatedViewHelpers/Processor.php b/Classes/Checks/Core/CallToDeprecatedViewHelpers/Processor.php
new file mode 100644 (file)
index 0000000..e284ceb
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_Definition
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * Array of all deprecated viewHelpers
+        *
+        * @var array
+        */
+       protected $viewHelpers = array(
+               'escape',
+               'form.errors',
+               'form.textbox',
+               'renderflashmessages',
+       );
+
+       /**
+        * Execute the check
+        *
+        * @return void
+        */
+       public function execute() {
+               if ($this->getExtensionKey()) {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtension(
+                               $this->getExtensionKey(),
+                               '.*\.(html)$',
+                               $this->generateRegularExpression()
+                       );
+               } else {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtensions(
+                               '.*\.(html)$',
+                               $this->generateRegularExpression()
+                       );
+               }
+               foreach ($locations as $location) {
+                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+               }
+       }
+
+       /**
+        * Generate a regular expression to search for all deprecated static calls
+        */
+       protected function generateRegularExpression() {
+               $regularExpression = array();
+               foreach ($this->viewHelpers as $viewHelper) {
+                       $regularExpression[] = '<f\:' . $viewHelper;
+               }
+               return '(' . implode('|', $regularExpression) . ')';
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Core/CallToDeprecatedViewHelpers/ResultAnalyzer.php b/Classes/Checks/Core/CallToDeprecatedViewHelpers/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..0720c5d
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_ResultAnalyzer
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_CallToDeprecatedViewHelpers_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-core-code-callToDeprecatedViewHelpers.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-core-code-callToDeprecatedViewHelpers.solution',
+                       array (
+                               $issue->getLocation()->getMatchedString(),
+                               $issue->getLocation()->getFilePath(),
+                               $issue->getLocation()->getLineNumber()
+                       )
+               );
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Core/MissingAddPluginParameter/Definition.php b/Classes/Checks/Core/MissingAddPluginParameter/Definition.php
new file mode 100644 (file)
index 0000000..66cdb85
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Peter Kuehn <peter.kuehn@wmdb.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_MissingAddPluginParameter_Definition
+ *
+ * Checks for extensions that don't claim to be compatible with the current LTS
+ * version in their ext_emconf.php files.
+ *
+ * @author Peter Kuehn
+ */
+class Tx_Smoothmigration_Checks_Core_MissingAddPluginParameter_Definition
+       extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_MissingAddPluginParameter_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_MissingAddPluginParameter_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-core-code-missingaddpluginparameter';
+       }
+
+}
diff --git a/Classes/Checks/Core/MissingAddPluginParameter/Processor.php b/Classes/Checks/Core/MissingAddPluginParameter/Processor.php
new file mode 100644 (file)
index 0000000..50b7e5f
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Peter Kuehn <peter.kuehn@wmdb.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_MissingAddPluginParameter_Processor
+ *
+ * @author Peter Kuehn
+ */
+class Tx_Smoothmigration_Checks_Core_MissingAddPluginParameter_Processor
+       extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * Execute the check
+        *
+        * @return void
+        */
+       public function execute() {
+               $list = Tx_Smoothmigration_Utility_ExtensionUtility::getLoadedExtensionsFiltered(TRUE, FALSE, TRUE);
+               foreach ($list as $extensionKey) {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtension(
+                               $extensionKey,
+                               '.*[^ext_tables]\.(php|inc)$',
+                               '(addPlugin\s*\(\s*(array\s*\([^\)]*\)[^\,]*\,|\$[^\,]*\,)[^\)\,]*\))'
+                       );
+                       foreach ($locations as $location) {
+                               $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+                       }
+               }
+       }
+}
diff --git a/Classes/Checks/Core/MissingAddPluginParameter/ResultAnalyzer.php b/Classes/Checks/Core/MissingAddPluginParameter/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..44337bf
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Peter Kuehn <peter.kuehn@wmdb.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_MissingAddPluginParameter_ResultAnalyzer
+ *
+ * @author Peter Kuehn
+ */
+class Tx_Smoothmigration_Checks_Core_MissingAddPluginParameter_ResultAnalyzer
+       extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-core-code-missingaddpluginparameter.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-core-code-missingaddpluginparameter.solution',
+                       array(
+                               $issue->getLocation()->getExtension(),
+                               $issue->getLocation()->getMinimumVersion(),
+                               $issue->getLocation()->getMaximumVersion(),
+                       )
+               );
+       }
+
+}
diff --git a/Classes/Checks/Core/Mysql/Definition.php b/Classes/Checks/Core/Mysql/Definition.php
new file mode 100644 (file)
index 0000000..5c9affd
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Mysql_Definition
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_Mysql_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->getObjectManager()->get('Tx_Smoothmigration_Checks_Core_Mysql_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->getObjectManager()->get('Tx_Smoothmigration_Checks_Core_Mysql_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-core-code-mysql';
+       }
+
+}
diff --git a/Classes/Checks/Core/Mysql/Processor.php b/Classes/Checks/Core/Mysql/Processor.php
new file mode 100644 (file)
index 0000000..1a4d692
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Mysql_Definition
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_Mysql_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * @return void
+        */
+       public function execute() {
+               $regularExpression = '/[^>\*#]\s*(mysql_[a-z_]*)\s?\(/';
+
+               if ($this->getExtensionKey()) {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtension(
+                               $this->getExtensionKey(),
+                               '.*\.(php|inc)$',
+                               $regularExpression
+                       );
+               } else {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtensions(
+                               '.*\.(php|inc)$',
+                               $regularExpression
+                       );
+               }
+               foreach ($locations as $location) {
+                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+               }
+       }
+
+}
diff --git a/Classes/Checks/Core/Mysql/ResultAnalyzer.php b/Classes/Checks/Core/Mysql/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..023e3ce
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Mysql_ResultAnalyzer
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Core_Mysql_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-core-code-mysql.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-core-code-mysql.solution',
+                       array(
+                               $issue->getLocation()->getMatchedString(),
+                               $issue->getLocation()->getFilePath(),
+                               $issue->getLocation()->getLineNumber()
+                       )
+               );
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Core/Namespace/Definition.php b/Classes/Checks/Core/Namespace/Definition.php
new file mode 100644 (file)
index 0000000..0447785
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Namespace_Definition
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Core_Namespace_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_Namespace_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_Namespace_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-core-code-namespace';
+       }
+}
diff --git a/Classes/Checks/Core/Namespace/Processor.php b/Classes/Checks/Core/Namespace/Processor.php
new file mode 100644 (file)
index 0000000..2a15b84
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Namespace_Definition
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Core_Namespace_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * Execute the check
+        *
+        * The regex can become quite large. We try to reduce the size by making the
+        * keys unique and splitting the array in several parts.
+        *
+        * @return void
+        */
+       public function execute() {
+               /** @var Tx_Smoothmigration_Service_ClassAliasProvider $classAliasProvider */
+               $classAliasProvider = t3lib_div::makeInstance('Tx_Smoothmigration_Service_ClassAliasProvider');
+
+               $legacyClasses = array_keys($classAliasProvider->getLegacyClasses());
+               $classAaliases = array_keys($classAliasProvider->getClassAliasMap());
+
+               $classes = array_unique(array_merge($legacyClasses, $classAaliases), SORT_REGULAR);
+
+               $count = count($classes);
+
+               $classChunks = array_chunk($classes, $count / 4);
+
+               if ($this->getExtensionKey()) {
+                       foreach ($classChunks as $chunk) {
+                               $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtension(
+                                       $this->getExtensionKey(),
+                                       '.*\.(php|inc)$',
+                                       '(?:^|\s+|[^\/\.a-zA-Z0-9_]+)(' . implode('|', $chunk) . ')(?:[^\/\.a-zA-Z0-9_]+)'
+                               );
+                               foreach ($locations as $location) {
+                                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+                               }
+                       }
+               } else {
+                       foreach ($classChunks as $chunk) {
+                               $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtensions(
+                                       '.*\.(php|inc)$',
+                                       '(?:^|\s+|[^\/\.a-zA-Z0-9_]+)(' . implode('|', $chunk) . ')(?:[^\/\.a-zA-Z0-9_]+)'
+                               );
+                               foreach ($locations as $location) {
+                                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+                               }
+                       }
+               }
+       }
+}
diff --git a/Classes/Checks/Core/Namespace/ResultAnalyzer.php b/Classes/Checks/Core/Namespace/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..2ee2ba9
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Namespace_ResultAnalyzer
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Core_Namespace_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-core-code-namespace.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-core-code-namespace.solution',
+                       array(
+                               $issue->getLocation()->getMatchedString(),
+                               $issue->getLocation()->getFilePath(),
+                               $issue->getLocation()->getLineNumber()
+                       )
+               );
+       }
+
+}
diff --git a/Classes/Checks/Core/RemovedConstants/Definition.php b/Classes/Checks/Core/RemovedConstants/Definition.php
new file mode 100644 (file)
index 0000000..e8dc8e1
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_RemovedConstants_Definition
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Core_RemovedConstants_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_RemovedConstants_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_RemovedConstants_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-core-code-removedConstants';
+       }
+
+}
diff --git a/Classes/Checks/Core/RemovedConstants/Processor.php b/Classes/Checks/Core/RemovedConstants/Processor.php
new file mode 100644 (file)
index 0000000..57dd408
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_RemovedConstants_Definition
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Core_RemovedConstants_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * @var array
+        */
+       protected $constants = array('PATH_t3lib');
+
+       /**
+        * Execute the check
+        *
+        * @return void
+        */
+       public function execute() {
+               if ($this->getExtensionKey()) {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtension(
+                               $this->getExtensionKey(),
+                               '.*\.(php|inc)$',
+                               $this->generateRegularExpression()
+                       );
+               } else {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtensions(
+                               '.*\.(php|inc)$',
+                               $this->generateRegularExpression()
+                       );
+               }
+               foreach ($locations as $location) {
+                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+               }
+       }
+
+       /**
+        * Generate a regular expression to search for all deprecated static calls
+        */
+       protected function generateRegularExpression() {
+               $regularExpression = array();
+               foreach ($this->constants as $constant) {
+                       $regularExpression[] = $constant;
+               }
+               return '(' . implode('|', $regularExpression) . ')';
+       }
+}
diff --git a/Classes/Checks/Core/RemovedConstants/ResultAnalyzer.php b/Classes/Checks/Core/RemovedConstants/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..3f9cc38
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_RemovedConstants_ResultAnalyzer
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Core_RemovedConstants_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-core-code-removedConstants.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-core-code-mysql.solution',
+                       array(
+                               $issue->getLocation()->getMatchedString(),
+                               $issue->getLocation()->getFilePath(),
+                               $issue->getLocation()->getLineNumber()
+                       )
+               );
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Core/RequireOnceInExtensions/Definition.php b/Classes/Checks/Core/RequireOnceInExtensions/Definition.php
new file mode 100644 (file)
index 0000000..dc22e3b
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_Definition
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-core-code-requireOnceInExtensions';
+       }
+
+}
diff --git a/Classes/Checks/Core/RequireOnceInExtensions/Processor.php b/Classes/Checks/Core/RequireOnceInExtensions/Processor.php
new file mode 100644 (file)
index 0000000..a4d7779
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_Definition
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * @return void
+        */
+       public function execute() {
+               $regularExpression = '(?x)
+               ^\s*
+               (
+                       (?:require|require_once|include|include_once)
+                       (?:\s*\(?\s*|\s+)
+                       (?:
+                               (?:\$BACK_PATH|PATH_t3lib|PATH_tslib|PATH_typo3|PATH_txdam|PATH_site\s*\.\s*TYPO3_mainDir)
+                               \s?\.\s?
+                               (?![\'"]init\.php[\'"])
+                               |
+                               t3lib_extMgm::extPath[^\)]*\)
+                       )
+                       .*\)?\s*;?
+               )';
+
+               if ($this->getExtensionKey()) {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtension(
+                               $this->getExtensionKey(),
+                               '.*\.(php|inc)$',
+                               $regularExpression
+                       );
+               } else {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtensions(
+                               '.*\.(php|inc)$',
+                               $regularExpression
+                       );
+               }
+               foreach ($locations as $location) {
+                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+               }
+       }
+
+}
diff --git a/Classes/Checks/Core/RequireOnceInExtensions/ResultAnalyzer.php b/Classes/Checks/Core/RequireOnceInExtensions/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..bd48328
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_ResultAnalyzer
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Checks_Core_RequireOnceInExtensions_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-core-code-requireOnceInExtensions.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-core-code-requireOnceInExtensions.solution',
+                       array(
+                               $issue->getLocation()->getMatchedString(),
+                               $issue->getLocation()->getFilePath(),
+                               $issue->getLocation()->getLineNumber()
+                       )
+               );
+       }
+
+}
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Core/Xclasses/Definition.php b/Classes/Checks/Core/Xclasses/Definition.php
new file mode 100644 (file)
index 0000000..0deb6ab
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Xclasses_Definition
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Checks_Core_Xclasses_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_Xclasses_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Core_Xclasses_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-core-code-xclasses';
+       }
+
+       /**
+        * Return the maximal TYPO3 Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMaximalTypo3Version() {
+               return '4.7.999';
+       }
+
+}
diff --git a/Classes/Checks/Core/Xclasses/Processor.php b/Classes/Checks/Core/Xclasses/Processor.php
new file mode 100644 (file)
index 0000000..62e75d7
--- /dev/null
@@ -0,0 +1,136 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Xclasses_Definition
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Checks_Core_Xclasses_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * @return void
+        */
+       public function execute() {
+               $contexts = array('BE', 'FE');
+               if ($this->getExtensionKey()) {
+                       $extensionList = array($this->getExtensionKey());
+               } else {
+                       $extensionList = Tx_Smoothmigration_Utility_ExtensionUtility::getLoadedExtensionsFiltered();
+               }
+
+               foreach ($contexts as $context) {
+                       if (is_array($GLOBALS['TYPO3_CONF_VARS'][$context]['XCLASS']) && count($GLOBALS['TYPO3_CONF_VARS'][$context]['XCLASS']) > 0) {
+                               foreach ($GLOBALS['TYPO3_CONF_VARS'][$context]['XCLASS'] AS $targetClass => $implementationClass) {
+                                       if (is_file($implementationClass)) {
+                                               $path = str_replace(PATH_typo3conf . 'ext/', '', $implementationClass);
+                                               $extKey = current(explode('/', $path));
+                                       } else {
+                                               $extKey = t3lib_extMgm::getExtensionKeyByPrefix(strtolower($implementationClass));
+                                       }
+
+                                       if (!in_array($extKey, $extensionList)) {
+                                               continue;
+                                       }
+                                       $this->issues[] = $this->createIssue($context, $targetClass, $implementationClass, $extKey);
+                               }
+                       }
+               }
+
+       }
+
+       /**
+        * @param string $context
+        * @param string $targetClass
+        * @param string $implementationClass
+        * @param string $extKey
+        *
+        * @return Tx_Smoothmigration_Domain_Model_Issue
+        */
+       protected function createIssue($context, $targetClass, $implementationClass, $extKey) {
+               $physicalLocation = new Tx_Smoothmigration_Domain_Model_IssueLocation_File($extKey, 'EXT:' . $extKey . '/ext_localconf.php');
+               $details = new Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration(
+                       Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration::TYPE_PHP,
+                       '$GLOBALS[TYPO3_CONF_VARS][' . $context . '][XCLASS][' . $targetClass . ']',
+                       $implementationClass,
+                       $physicalLocation
+               );
+
+               // Cut off any possibly leading slash
+               $targetClass = ltrim($targetClass, '/');
+               if(file_exists(PATH_site . 'typo3conf/' . $targetClass)) {
+                       $originalFilePath = PATH_site . 'typo3conf/' . $targetClass;
+               } elseif(file_exists(PATH_site . 'typo3/sys/' . $targetClass)) {
+                       $originalFilePath = PATH_site . 'typo3/sys/' . $targetClass;
+               } elseif(file_exists(PATH_site . 'typo3/sysext/cms/' . $targetClass)) {
+                       $originalFilePath = PATH_site . 'typo3/sysext/cms/' . $targetClass;
+               } else {
+                       $originalFilePath = PATH_site . $targetClass;
+               }
+
+               $originalClass = $this->getFirstClassInFile($originalFilePath);
+
+               $xClass = $this->getFirstClassInFile($implementationClass);
+
+               $issue = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $details);
+               $issue->setAdditionalInformation(array(
+                       'ORIGINAL_CLASS_FILENAME' => $targetClass,
+                       'IMPLEMENTATION_CLASS_FILENAME' => $implementationClass,
+                       'ORIGINAL_CLASS' => $originalClass,
+                       'IMPLEMENTATION_CLASS' => $xClass
+               ));
+               return $issue;
+       }
+
+       /**
+        * @param string $physicalLocation
+        *
+        * @return string       the first class name in the given file
+        */
+       protected function getFirstClassInFile($physicalLocation) {
+               return $this->getClassInCode(file_get_contents($physicalLocation));
+       }
+
+       /**
+        * @param string $sourceCode
+        *
+        * @return string the first class name in the given source code
+        */
+       protected function getClassInCode($sourceCode) {
+
+               $tokens = token_get_all($sourceCode);
+               $count = count($tokens);
+               for ($i = 2; $i < $count; $i++) {
+                       if (   $tokens[$i - 2][0] == T_CLASS
+                               && $tokens[$i - 1][0] == T_WHITESPACE
+                               && $tokens[$i][0] == T_STRING) {
+
+                               return $tokens[$i][1];
+                       }
+               }
+       }
+}
diff --git a/Classes/Checks/Core/Xclasses/ResultAnalyzer.php b/Classes/Checks/Core/Xclasses/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..2d4d730
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Core_Xclasses_ResultAnalyzer
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Checks_Core_Xclasses_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               $information = $issue->getAdditionalInformation();
+               return $this->ll(
+                       'result.typo3-core-code-xclasses.explanation',
+                       array(
+                               $information['IMPLEMENTATION_CLASS'],
+                               $information['ORIGINAL_CLASS']
+                       )
+               );
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               $information = $issue->getAdditionalInformation();
+
+               $originalClass = $information['ORIGINAL_CLASS'];
+               $newClass = $information['IMPLEMENTATION_CLASS'];
+
+               if (is_file($newClass)) {
+                       $pattern = '/^\s?class\s+([A-Za-z0-9_\\\\]+)\s+extends\s+([A-Za-z0-9_\\\\]+)/';
+                       foreach (new SplFileObject($newClass) as $lineContent) {
+                               $matches = array();
+                               if (preg_match($pattern, $lineContent, $matches)) {
+                                       $newClass = $matches[1];
+                                       $originalClass = $matches[2];
+                                       break;
+                               }
+                       }
+               }
+               return $this->ll(
+                       'result.typo3-core-code-xclasses.solution',
+                       array(
+                               $issue->getLocation()->getPhysicalLocation()->getFilePath() .
+                               ($issue->getLocation()->getPhysicalLocation()->getLineNumber() > -1 ?
+                                       ' line ' . $issue->getLocation()->getPhysicalLocation()->getLineNumber() :
+                                       ''),
+                               $originalClass,
+                               $newClass
+                       )
+               );
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getRawTextForCopyPaste(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               $information = $issue->getAdditionalInformation();
+
+               $originalClass = $information['ORIGINAL_CLASS'];
+               $newClass = $information['IMPLEMENTATION_CLASS'];
+               return $this->ll(
+                       'result.typo3-core-code-xclasses.raw',
+                       array(
+                               $originalClass,
+                               $newClass
+                       )
+               );
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Dam/CallToDamClasses/Definition.php b/Classes/Checks/Dam/CallToDamClasses/Definition.php
new file mode 100644 (file)
index 0000000..c968601
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Dam_CallToDamClasses_Definition
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Dam_CallToDamClasses_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Dam_CallToDamClasses_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Dam_CallToDamClasses_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-dam-code-callToDamClasses';
+       }
+
+}
diff --git a/Classes/Checks/Dam/CallToDamClasses/Processor.php b/Classes/Checks/Dam/CallToDamClasses/Processor.php
new file mode 100644 (file)
index 0000000..8715991
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class
+ * Tx_Smoothmigration_Checks_Core_CallToDeprecatedStaticMethods_Definition
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Dam_CallToDamClasses_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * Array of all deprecated static methods
+        *
+        * @var array
+        */
+       protected $damClasses = array(
+               'tx_dam\w+',
+               'tx_damcatedit_positionMap',
+               'tx_damcatedit_db',
+               'tx_damcatedit_cm'
+       );
+
+       /**
+        * @return void
+        */
+       public function execute() {
+               if ($this->getExtensionKey()) {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtension(
+                               $this->getExtensionKey(),
+                               '.*\.(php|inc)$',
+                               $this->generateRegularExpression()
+                       );
+               } else {
+                       $locations = Tx_Smoothmigration_Utility_FileLocatorUtility::searchInExtensions(
+                               '.*\.(php|inc)$',
+                               $this->generateRegularExpression(),
+                               array(
+                                       'dam',
+                                       'dam_catedit',
+                                       'dam_cron',
+                                       'dam_filelinks',
+                                       'dam_index',
+                                       'dam_pages',
+                                       'dam_ttcontent',
+                                       'dam_ttnews',
+                                       'extbase_dam'
+                               )
+                       );
+               }
+               foreach ($locations as $location) {
+                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+               }
+       }
+
+       /**
+        * Generate a regular expression to search for all deprecated static calls
+        *
+        * @return string
+        */
+       protected function generateRegularExpression() {
+               $regularExpression = array();
+               foreach ($this->damClasses as $damClass) {
+                       // static call
+                       $regularExpression[] = '(' . $damClass . '\:\:\w+)';
+                       // makeInstance call
+                       $regularExpression[] = '(makeInstance\((\"|\')' . $damClass . '(\"|\')\))';
+                       // new-call
+                       $regularExpression[] = '(new\s+' . $damClass . '\s*\;)';
+               }
+
+               return implode('|', $regularExpression);
+       }
+
+}
diff --git a/Classes/Checks/Dam/CallToDamClasses/ResultAnalyzer.php b/Classes/Checks/Dam/CallToDamClasses/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..dba4633
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Peter Beernink, Drecomm (p.beernink@drecomm.nl)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Dam_CallToDamClasses_ResultAnalyzer
+ *
+ * @author Peter Beernink
+ */
+class Tx_Smoothmigration_Checks_Dam_CallToDamClasses_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-dam-code-callToDamClasses.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-core-code-mysql.solution',
+                       array(
+                               $issue->getLocation()->getMatchedString(),
+                               $issue->getLocation()->getFilePath(),
+                               $issue->getLocation()->getLineNumber()
+                       )
+               );
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Database/Utf8/Definition.php b/Classes/Checks/Database/Utf8/Definition.php
new file mode 100644 (file)
index 0000000..2427f17
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Database_Utf8_Definition
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Database_Utf8_Definition extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Database_Utf8_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Database_Utf8_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-database-database-utf8';
+       }
+
+       /**
+        * Returns the Type of the Check
+        * One of the Constants Defined in that interface
+        *
+        * @return int
+        */
+       public function getType() {
+               return Tx_Smoothmigration_Domain_Interface_CheckDescription::TYPE_DATABASE;
+       }
+
+}
diff --git a/Classes/Checks/Database/Utf8/Processor.php b/Classes/Checks/Database/Utf8/Processor.php
new file mode 100644 (file)
index 0000000..d62ab45
--- /dev/null
@@ -0,0 +1,245 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Database_Utf8_Processor
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Database_Utf8_Processor extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * Execute the check
+        * @return void
+        */
+       public function execute() {
+               $characterSets = $this->getMySqlCharacterSets();
+               $preferredCharacterSets = array(
+                       'character_set_connection' => 'utf8',
+                       'character_set_database' => 'utf8',
+                       'character_set_server' => 'utf8'
+               );
+
+               foreach ($characterSets as $key => $characterSet) {
+                       if (array_key_exists($key, $preferredCharacterSets)) {
+                               if ($characterSet !== $preferredCharacterSets[$key]) {
+                                       $physicalLocation = new Tx_Smoothmigration_Domain_Model_IssueLocation_Database(TYPO3_db_username . '@' . TYPO3_db_host . '/' . TYPO3_db);
+                                       $details = new Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration(
+                                               Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration::TYPE_DATABASESERVER,
+                                               TYPO3_db_username . '@' . TYPO3_db_host . '/' . TYPO3_db . ': ' . $key,
+                                               $characterSet,
+                                               $physicalLocation
+                                       );
+
+                                       $issue = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $details);
+                                       $issue->setAdditionalInformation(array(
+                                               'type' => 'configuration',
+                                               'setting' => $key,
+                                               'preferredValue' => $preferredCharacterSets[$key],
+                                               'actualValue' => $characterSet
+                                       ));
+                                       $this->issues[] = $issue;
+                               }
+                       }
+               }
+
+               $dbCharsetCollation = $this->getDatabaseCharsetAndCollation();
+               $allowedCollations = array(
+                       'utf8_general_ci',
+                       'utf8_unicode_ci',
+                       'utf8_general_cs',
+                       'utf8_unicode_cs',
+                       'utf8_bin'
+               );
+               $physicalLocation = new Tx_Smoothmigration_Domain_Model_IssueLocation_Database(TYPO3_db_username . '@' . TYPO3_db_host . '/' . TYPO3_db);
+               if ($dbCharsetCollation['characterSet'] !== 'utf8' OR
+                               !in_array($dbCharsetCollation['defaultCollation'], $allowedCollations)) {
+                       $key = 'databaseCharacterset';
+                       $details = new Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration(
+                               Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration::TYPE_DATABASE,
+                               TYPO3_db_username . '@' . TYPO3_db_host . '/' . TYPO3_db . ': ' . $key,
+                               $key,
+                               $physicalLocation
+                       );
+                       $issue = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $details);
+                       $issue->setAdditionalInformation(array(
+                               'type' => 'databaseCollation',
+                               'characterSet' => $dbCharsetCollation['characterSet'],
+                               'defaultCollation' => $dbCharsetCollation['defaultCollation']
+                       ));
+                       $this->issues[] = $issue;
+               }
+
+               $tableCollations = $this->getTableCollations();
+               foreach ($tableCollations as $collationInfo) {
+                       $key = $collationInfo['table_name'] . '#' . $collationInfo['collation_name'];
+                       $physicalLocation = new Tx_Smoothmigration_Domain_Model_IssueLocation_Database(TYPO3_db_username . '@' . TYPO3_db_host . '/' . TYPO3_db);
+                       $details = new Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration(
+                               Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration::TYPE_DATABASE,
+                               TYPO3_db_username . '@' . TYPO3_db_host . '/' . TYPO3_db . ': ' . $key,
+                               $key,
+                               $physicalLocation
+                       );
+
+                       $issue = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $details);
+                       $issue->setAdditionalInformation(array(
+                               'type' => 'tableCollation',
+                               'tableName' => $collationInfo['table_name'],
+                               'tableCollation' => $collationInfo['table_collation']
+                       ));
+                       $this->issues[] = $issue;
+               }
+
+               $columnCollations = $this->getColumnCollations();
+               foreach ($columnCollations as $collationInfo) {
+                       $key = $collationInfo['table_name'] . '#' . $collationInfo['column_name'] . '#' . $collationInfo['character_set_name'] . '#' . $collationInfo['collation_name'];
+                       $physicalLocation = new Tx_Smoothmigration_Domain_Model_IssueLocation_Database(TYPO3_db_username . '@' . TYPO3_db_host . '/' . TYPO3_db);
+                       $details = new Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration(
+                               Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration::TYPE_DATABASE,
+                               TYPO3_db_username . '@' . TYPO3_db_host . '/' . TYPO3_db . ': ' . $key,
+                               $key,
+                               $physicalLocation
+                       );
+
+                       $issue = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $details);
+                       $issue->setAdditionalInformation(array(
+                               'type' => 'columnCollation',
+                               'tableName' => $collationInfo['table_name'],
+                               'columnName' => $collationInfo['column_name'],
+                               'characterSetName' => $collationInfo['character_set_name'],
+                               'collationName' => $collationInfo['collation_name']
+                       ));
+                       $this->issues[] = $issue;
+               }
+       }
+
+       /**
+        * Get informations about the mysql server character_set
+        *
+        * @return array
+        */
+       protected function getMySqlCharacterSets() {
+               $characterSets = '';
+
+               $res = $GLOBALS['TYPO3_DB']->sql_query('SHOW VARIABLES LIKE "character_set_%";');
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $characterSets[$row['Variable_name']] = $row['Value'];
+               }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+
+               return $characterSets;
+       }
+
+       /**
+        * Get the database charset and collation
+        *
+        * The charset should be utf8
+        *
+        * For default collation:
+        * utf8_general_ci is reccomended
+        * utf8_unicode_ci is also ok
+        * utf8_bin is also ok
+        * The cs versions (Case sensitive compare) are also ok
+        *
+        * @return array $row
+        */
+       protected function getDatabaseCharsetAndCollation() {
+               $res = $GLOBALS['TYPO3_DB']->sql_query('
+                       SELECT
+                               DEFAULT_CHARACTER_SET_NAME as characterSet,
+                               DEFAULT_COLLATION_NAME as defaultCollation
+                       FROM
+                               information_schema.SCHEMATA
+                       WHERE
+                               SCHEMA_NAME = "' . TYPO3_db . '"');
+               $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+               return $row;
+       }
+
+       /**
+        * Get the table collations for the current database
+        * utf8_general_ci is reccomended
+        * utf8_unicode_ci is also ok
+        * utf8_bin is also ok
+        * The cs versions (Case sensitive compare) are also ok
+        *
+        * @return array $mysqlTableCollations
+        */
+       protected function getTableCollations() {
+               $mysqlTableCollations = array();
+               $res = $GLOBALS['TYPO3_DB']->sql_query('
+                       SELECT table_name, table_collation
+                       FROM information_schema.TABLES
+                       WHERE table_schema = "' . TYPO3_db . '"
+                       AND NOT table_collation = "utf8_general_ci"
+                       AND NOT table_collation = "utf8_unicode_ci"
+                       AND NOT table_collation = "utf8_general_cs"
+                       AND NOT table_collation = "utf8_unicode_cs"
+                       AND NOT table_collation = "utf8_bin"
+                       ORDER BY table_name, table_collation');
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $mysqlTableCollations[] = $row;
+               }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+               return $mysqlTableCollations;
+       }
+
+
+       /**
+        * Get the column collations for the current database
+        * utf8_general_ci is reccomended
+        * utf8_unicode_ci is also ok
+        * utf8_bin is also ok
+        * The cs versions (Case sensitive compare) are also ok
+        *
+        * @return array $mysqlColumnCollations
+        */
+       protected function getColumnCollations() {
+               $mysqlColumnCollations = array();
+               $res = $GLOBALS['TYPO3_DB']->sql_query('
+                       SELECT table_name, column_name, character_set_name, collation_name
+                       FROM information_schema.COLUMNS
+                       WHERE table_schema = "' . TYPO3_db . '"
+                       AND (
+                               NOT character_set_name = "utf8"
+                               OR (
+                                       NOT collation_name = "utf8_general_ci"
+                                       AND NOT collation_name = "utf8_unicode_ci"
+                                       AND NOT collation_name = "utf8_general_cs"
+                                       AND NOT collation_name = "utf8_unicode_cs"
+                                       AND NOT collation_name = "utf8_bin"
+                               )
+                       )
+                       ORDER BY table_name, column_name');
+               while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                       $mysqlColumnCollations[] = $row;
+               }
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);
+               return $mysqlColumnCollations;
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Database/Utf8/ResultAnalyzer.php b/Classes/Checks/Database/Utf8/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..a8f9480
--- /dev/null
@@ -0,0 +1,102 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Checks_Database_Utf8_ResultAnalyzer
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Database_Utf8_ResultAnalyzer extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-database-database-utf8.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               if (is_string($issue->getAdditionalInformation())) {
+                       $additionalInformation = unserialize($issue->getAdditionalInformation());
+               } else {
+                       $additionalInformation = $issue->getAdditionalInformation();
+               }
+               switch ($additionalInformation['type']) {
+                       case 'configuration':
+                               $result = $this->ll(
+                                       'result.typo3-database-database-utf8.databaseServerSetting',
+                                       array(
+                                               $additionalInformation['setting'],
+                                               $additionalInformation['actualValue'],
+                                               $additionalInformation['preferredValue']
+                                       )
+                               );
+                               break;
+                       case 'databaseCollation':
+                               $result = $this->ll(
+                                       'result.typo3-database-database-utf8.databaseCollation',
+                                       array(
+                                               $additionalInformation['characterSet'],
+                                               $additionalInformation['defaultCollation'],
+                                               'utf8',
+                                               'utf8_general_ci'
+                                       )
+                               );
+                               break;
+                       case 'tableCollation':
+                               $result = $this->ll(
+                                       'result.typo3-database-database-utf8.databaseTableCollation',
+                                       array(
+                                               $additionalInformation['tableName'],
+                                               $additionalInformation['tableCollation'],
+                                               'utf8_general_ci'
+                                       )
+                               );
+                               break;
+                       case 'columnCollation':
+                               $result = $this->ll(
+                                       'result.typo3-database-database-utf8.databaseColumnCollation',
+                                       array(
+                                               $additionalInformation['tableName'],
+                                               $additionalInformation['columnName'],
+                                               $additionalInformation['characterSetName'],
+                                               $additionalInformation['collationName']
+                                       )
+                               );
+                               break;
+                       default:
+                               $result = '';
+               }
+               return $result;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Checks/Extension/IncompatibleWithLts/Definition.php b/Classes/Checks/Extension/IncompatibleWithLts/Definition.php
new file mode 100644 (file)
index 0000000..bd7adf0
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_Definition
+ *
+ * Checks for extensions that don't claim to be compatible with the current LTS
+ * version in their ext_emconf.php files.
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_Definition
+       extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-extension-code-incompatiblewithlts';
+       }
+
+}
diff --git a/Classes/Checks/Extension/IncompatibleWithLts/Processor.php b/Classes/Checks/Extension/IncompatibleWithLts/Processor.php
new file mode 100644 (file)
index 0000000..de9a9c6
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_Definition
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_Processor
+       extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * Execute the check
+        *
+        * @return void
+        */
+       public function execute() {
+               $extensions = Tx_Smoothmigration_Utility_ExtensionUtility::getIncompatibleExtensions();
+               foreach ($extensions as $extension => $versionRange) {
+                       $location = new Tx_Smoothmigration_Domain_Model_IssueLocation_Extension($extension, $versionRange[0], $versionRange[1]);
+                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+               }
+       }
+}
diff --git a/Classes/Checks/Extension/IncompatibleWithLts/ResultAnalyzer.php b/Classes/Checks/Extension/IncompatibleWithLts/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..03738ef
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_ResultAnalyzer
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Extension_IncompatibleWithLts_ResultAnalyzer
+       extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-extension-code-incompatiblewithlts.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-extension-code-incompatiblewithlts.solution',
+                       array(
+                               $issue->getLocation()->getExtension(),
+                               $issue->getLocation()->getMinimumVersion(),
+                               $issue->getLocation()->getMaximumVersion(),
+                       )
+               );
+       }
+
+}
diff --git a/Classes/Checks/Extension/Obsolete/Definition.php b/Classes/Checks/Extension/Obsolete/Definition.php
new file mode 100644 (file)
index 0000000..4476e57
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Extension_Obsolete_Definition
+ *
+ * Checks for extensions that don't claim to be compatible with the current LTS
+ * version in their ext_emconf.php files.
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Extension_Obsolete_Definition
+       extends Tx_Smoothmigration_Checks_AbstractCheckDefinition {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor() {
+               return $this->objectManager->get('Tx_Smoothmigration_Checks_Extension_Obsolete_Processor', $this);
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer() {
+               return $this->objectManager->ge('Tx_Smoothmigration_Checks_Extension_Obsolete_ResultAnalyzer', $this);
+       }
+
+       /**
+        * Returns an CheckIdentifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier() {
+               return 'typo3-extension-code-obsolete';
+       }
+
+}
diff --git a/Classes/Checks/Extension/Obsolete/Processor.php b/Classes/Checks/Extension/Obsolete/Processor.php
new file mode 100644 (file)
index 0000000..72e7413
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Extension_Obsolete_Definition
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Extension_Obsolete_Processor
+       extends Tx_Smoothmigration_Checks_AbstractCheckProcessor {
+
+       /**
+        * Execute the check
+        *
+        * @return void
+        */
+       public function execute() {
+               $extensions = Tx_Smoothmigration_Utility_ExtensionUtility::getObsoleteExtensions();
+               foreach ($extensions as $extension) {
+                       $location = new Tx_Smoothmigration_Domain_Model_IssueLocation_Extension($extension);
+                       $this->issues[] = new Tx_Smoothmigration_Domain_Model_Issue($this->parentCheck->getIdentifier(), $location);
+               }
+       }
+}
diff --git a/Classes/Checks/Extension/Obsolete/ResultAnalyzer.php b/Classes/Checks/Extension/Obsolete/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..445c464
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Checks_Extension_Obsolete_ResultAnalyzer
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Checks_Extension_Obsolete_ResultAnalyzer
+       extends Tx_Smoothmigration_Checks_AbstractCheckResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll('result.typo3-extension-code-obsolete.explanation');
+       }
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue) {
+               return $this->ll(
+                       'result.typo3-extension-code-obsolete.solution',
+                       array(
+                               $issue->getLocation()->getExtension()
+                       )
+               );
+       }
+
+}
diff --git a/Classes/Cli/CommandManager.php b/Classes/Cli/CommandManager.php
new file mode 100644 (file)
index 0000000..9aae18a
--- /dev/null
@@ -0,0 +1,133 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * A helper for CLI commands
+ *
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public
+ *    License, version 3 or later
+ */
+class Tx_Smoothmigration_Cli_CommandManager extends Tx_Extbase_MVC_CLI_CommandManager {
+
+       /**
+        * Returns an array of all commands
+        *
+        * @return array<Tx_Extbase_MVC_CLI_Command>
+        * @api
+        */
+       public function getAvailableCommands() {
+               if ($this->availableCommands === NULL) {
+                       $this->availableCommands = array();
+
+                       /** @var Tx_Smoothmigration_Service_Check_Registry $checkRegistry */
+                       $checkRegistry = $this->objectManager->get('Tx_Smoothmigration_Service_Check_Registry');
+                       $checks = $checkRegistry->getActiveChecks();
+                       foreach ($checks as $command) {
+                               $commandIdentifier = $command->getIdentifier();
+                               $this->availableCommands['check'][$commandIdentifier] = $command;
+                       }
+
+                       /** @var Tx_Smoothmigration_Service_Migration_Registry $migrationRegistry */
+                       $migrationRegistry = $this->objectManager->get('Tx_Smoothmigration_Service_Migration_Registry');
+                       $migrations = $migrationRegistry->getActiveMigrations();
+                       foreach ($migrations as $command) {
+                               $commandIdentifier = $command->getIdentifier();
+                               $this->availableCommands['migration'][$commandIdentifier] = $command;
+                       }
+               }
+               return $this->availableCommands;
+       }
+
+       /**
+        * Returns a Command that matches the given identifier.
+        * If no Command could be found a CommandNotFoundException is thrown
+        * If more than one Command matches an AmbiguousCommandIdentifierException
+        * is thrown that contains the matched Commands
+        *
+        * @param string $type The type of command
+        * @param string $commandIdentifier command identifier in the format
+        *    foo:bar:baz
+        *
+        * @throws Tx_Extbase_MVC_Exception_AmbiguousCommandIdentifier
+        * @throws Tx_Extbase_MVC_Exception_NoSuchCommand
+        * @return Tx_Extbase_MVC_CLI_Command
+        * @api
+        */
+       public function getCommandByTypeAndIdentifier($type, $commandIdentifier) {
+               $commandIdentifier = strtolower(trim($commandIdentifier));
+               $type = strtolower(trim($type));
+
+               if ($commandIdentifier === 'help') {
+                       $commandIdentifier = 'extbase:help:help';
+               }
+               $matchedCommands = array();
+               $availableCommands = $this->getAvailableCommands();
+               foreach ($availableCommands as $commandType => $commands) {
+                       if ($type === $commandType) {
+                               foreach ($commands as $identifier => $command) {
+                                       if (strtolower($identifier) === $commandIdentifier) {
+                                               $matchedCommands[] = $command;
+                                       }
+                               }
+                       }
+               }
+               if (count($matchedCommands) === 0) {
+                       throw new Tx_Extbase_MVC_Exception_NoSuchCommand('No command could be found that matches the command identifier "' . $commandIdentifier . '".', 1310556663);
+               }
+               if (count($matchedCommands) > 1) {
+                       throw new Tx_Extbase_MVC_Exception_AmbiguousCommandIdentifier('More than one command matches the command identifier "' . $commandIdentifier . '"', 1310557169, NULL, $matchedCommands);
+               }
+
+               return current($matchedCommands);
+       }
+
+       /**
+        * Returns TRUE if the specified command identifier matches the identifier
+        * of the specified command. This is the case, if the identifiers are the
+        * same or if at least the last two command parts match (case sensitive).
+        *
+        * @param Tx_Extbase_MVC_CLI_Command $command
+        * @param string $commandIdentifier command identifier in the format
+        *    foo:bar:baz (all lower case)
+        *
+        * @return boolean TRUE if the specified command identifier matches this
+        *    commands identifier
+        * @author Bastian Waidelich <bastian@typo3.org>
+        */
+       protected function commandMatchesIdentifier(Tx_Extbase_MVC_CLI_Command $command, $commandIdentifier) {
+               $commandIdentifierParts = explode(':', $command->getCommandIdentifier());
+               $searchedCommandIdentifierParts = explode(':', $commandIdentifier);
+               $extensionKey = array_shift($commandIdentifierParts);
+               if (count($searchedCommandIdentifierParts) === 3) {
+                       $searchedExtensionKey = array_shift($searchedCommandIdentifierParts);
+                       if ($searchedExtensionKey !== $extensionKey) {
+                               return FALSE;
+                       }
+               }
+               if (count($searchedCommandIdentifierParts) !== 2) {
+                       return FALSE;
+               }
+
+               return $searchedCommandIdentifierParts === $commandIdentifierParts;
+       }
+}
diff --git a/Classes/Cli/class.smoothmigration_cli.php b/Classes/Cli/class.smoothmigration_cli.php
new file mode 100644 (file)
index 0000000..8eee467
--- /dev/null
@@ -0,0 +1,289 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Ingo Schmitt <is@marketing-factory.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+if (t3lib_div::int_from_ver(TYPO3_version) < 6002000) {
+       require_once(PATH_t3lib . 'class.t3lib_cli.php');
+}
+
+/**
+ * Class tx_smoothmigration_cli
+ */
+class tx_smoothmigration_cli extends t3lib_cli {
+
+       /**
+        * The issue repostitory
+        *
+        * @var Tx_Smoothmigration_Domain_Repository_IssueRepository
+        */
+       protected $issueRepository;
+
+       /**
+        * @var Tx_Smoothmigration_Service_MessageService
+        */
+       protected $messageBus;
+
+       /**
+        * @var Tx_Extbase_Object_ObjectManager
+        */
+       protected $objectManager;
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               if (t3lib_div::int_from_ver(TYPO3_version) < 6002000) {
+                               // Loads the cli_args array with command line arguments
+                       $this->cli_args = $this->cli_getArgIndex();
+               } else {
+                               // Loads the cli_args array with command line arguments
+                       $this->cli_setArguments($_SERVER['argv']);
+               }
+
+               $this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+               $this->issueRepository = $this->objectManager->get('Tx_Smoothmigration_Domain_Repository_IssueRepository');
+               $this->messageBus = $this->objectManager->get('Tx_Smoothmigration_Service_MessageService');
+
+                       // Adding options to help archive:
+               $this->cli_options = array();
+               $this->cli_options[] = array('check', 'Check your code for needed migrations');
+               $this->cli_options[] = array('report', 'Detailed Report including extension, codeline and check');
+               $this->cli_options[] = array('executeAllChecks', 'Execute all checks and show a short summary');
+               $this->cli_options[] = array('migrate', 'Try to migrate your code');
+               $this->cli_options[] = array('help', 'Display this message');
+
+                       // Setting help texts:
+               $this->cli_help['name'] = 'CLI Smoothmigration Agent';
+               $this->cli_help['synopsis'] = 'cli_dispatch.phpsh smoothmigration {task}';
+               $this->cli_help['description'] = 'Executes the report of the smoothmigration extension on CLI Basis';
+               $this->cli_help['examples'] = './typo3/cli_dispatch.phpsh smoothmigration report';
+               $this->cli_help['author'] = 'Ingo Schmitt <is@marketing-factory.de>';
+       }
+
+       /**
+        * CLI engine
+        *
+        * @param array $argv command line arguments
+        * @return string
+        */
+       public function cli_main($argv) {
+               $task = ((string)$this->cli_args['_DEFAULT'][1]) ?: '';
+
+                       // Analysis type:
+               switch ($task) {
+                       case 'check':
+                               $checkKey = ((string)$this->cli_args['_DEFAULT'][2]) ?: '';
+                               $extension = trim((string)$this->cli_args['--extension'][0]);
+                               $this->check($checkKey, $extension);
+                               break;
+                       case 'executeAllChecks':
+                               $this->executeAllChecks();
+                               break;
+                       case 'report':
+                               $this->report();
+                               break;
+                       case 'migrate':
+                               $migrationTask = ((string)$this->cli_args['_DEFAULT'][2]) ?: '';
+                               $experimental = in_array((string)$this->cli_args['--experimental'][0],  array('y', 'yes', 'true', '1'));
+                               $extension = trim((string)$this->cli_args['--extension'][0]);
+                               $this->migrate($migrationTask, $extension, $experimental);
+                               break;
+                       default:
+                               $this->cli_validateArgs();
+                               $this->cli_help();
+                               exit;
+               }
+       }
+
+       /**
+        * Check
+        *
+        * @param string $checkKey
+        * @param string $extensionKey
+        * @return void
+        */
+       private function check($checkKey, $extensionKey = '') {
+               $check = NULL;
+               /** @var Tx_Smoothmigration_Service_Check_Registry $registry */
+               $registry = Tx_Smoothmigration_Service_Check_Registry::getInstance();
+
+               if (!empty($checkKey)) {
+                       $check = $registry->getActiveCheckByIdentifier($checkKey);
+               }
+               if ($check === NULL) {
+                       $this->messageBus->message('Please choose a check to execute.' . LF . LF . 'Possible options are:' .  LF);
+                       $this->messageBus->message($this->getChecks());
+                       return;
+               }
+
+               /** @var Tx_Smoothmigration_Checks_AbstractCheckProcessor $processor */
+               $processor = $check->getProcessor();
+               $processor->setExtensionKey($extensionKey);
+               $processor->execute();
+               foreach ($processor->getIssues() as $issue) {
+                       $this->issueRepository->add($issue);
+               }
+               /** @var Tx_Extbase_Persistence_Manager $persistenceManger */
+               $persistenceManger = $this->objectManager->get('Tx_Extbase_Persistence_Manager');
+               $persistenceManger->persistAll();
+               $this->messageBus->infoMessage('Check: ' . $check->getTitle() . ' has ' . count($processor->getIssues()) . ' issues ');
+       }
+
+       /**
+        * Renders a Report of Extensions as ASCII
+        *
+        * @return void
+        */
+       private function report() {
+               $registry = Tx_Smoothmigration_Service_Check_Registry::getInstance();
+               $issuesWithInspections = $this->issueRepository->findAllGroupedByExtensionAndInspection();
+               foreach ($issuesWithInspections as $extensionKey => $inspections) {
+                       $count = 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());
+                                       if ($check) {
+                                               $this->messageBus->message($check->getResultAnalyzer()->getSolution($singleIssue));
+                                       }
+                                       $count ++;
+                               }
+                       }
+                       $this->messageBus->successMessage('Total: ' . $count . ' issues in ' . $extensionKey . LF);
+               }
+       }
+
+       /**
+        * Execute all checks
+        *
+        * @return void
+        */
+       private function executeAllChecks() {
+               $issues = 0;
+               $registry = Tx_Smoothmigration_Service_Check_Registry::getInstance();
+               $checks = $registry->getActiveChecks();
+
+               /** @var Tx_Smoothmigration_Domain_Interface_Check $singleCheck */
+               foreach ($checks as $singleCheck) {
+                       $processor = $singleCheck->getProcessor();
+                       $this->messageBus->headerMessage('Check: ' . $singleCheck->getTitle(), 'info');
+                       $processor->execute();
+                       foreach ($processor->getIssues() as $issue) {
+                               $this->issueRepository->add($issue);
+                       }
+                       $issues = $issues + count($processor->getIssues());
+                       $this->messageBus->infoMessage(count($processor->getIssues()) . ' issues found');
+               }
+               $persistenceManger = $this->objectManager->get('Tx_Extbase_Persistence_Manager');
+               $persistenceManger->persistAll();
+               $this->messageBus->infoMessage(LF . 'Total Issues : ' . $issues);
+       }
+
+       /**
+        * Migrate
+        *
+        * @param string $migrationTaskKey
+        * @param string $extensionKey
+        * @param boolean $experimental When TRUE, try to process experimental
+        *    migrations as well
+        * @return void
+        */
+       private function migrate($migrationTaskKey, $extensionKey = '', $experimental) {
+               $migrationTask = NULL;
+               /** @var Tx_Smoothmigration_Service_Migration_Registry $registry */
+               $registry = Tx_Smoothmigration_Service_Migration_Registry::getInstance();
+
+               if (!empty($migrationTaskKey)) {
+                       $migrationTask = $registry->getActiveMigrationByCliKey($migrationTaskKey);
+               }
+               if ($migrationTask === NULL) {
+                       $this->messageBus->message('Please choose a migration to execute.' . LF . LF . 'Possible options are:' .  LF);
+                       $this->messageBus->message($this->getMigrations());
+                       return;
+               }
+
+               /** @var Tx_Smoothmigration_Migrations_AbstractMigrationProcessor $processor */
+               $processor = $migrationTask->getProcessor();
+               $processor->setMessageService($this->messageBus);
+               $processor->setExperimental($experimental);
+               $processor->setExtensionKey($extensionKey);
+               $processor->execute();
+       }
+
+       /**
+        * 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;
+       }
+
+       /**
+        * Get available migrations
+        *
+        * @return string
+        */
+       private function getMigrations() {
+               $output = '';
+               /** @var Tx_Smoothmigration_Service_Migration_Registry $registry */
+               $registry = Tx_Smoothmigration_Service_Migration_Registry::getInstance();
+               $migrations = $registry->getActiveMigrations();
+               $maxLen = 0;
+               /** @var Tx_Smoothmigration_Migrations_AbstractMigrationDefinition $migration */
+               foreach ($migrations as $migration) {
+                       if (strlen($migration->getCliKey()) > $maxLen) {
+                               $maxLen = strlen($migration->getCliKey());
+                       }
+               }
+               foreach ($migrations as $migration) {
+                       $output .= $migration->getCliKey() . substr($this->cli_indent(rtrim($migration->getTitle()), $maxLen + 4), strlen($migration->getCliKey())) . LF;
+               }
+
+               return $output;
+       }
+}
+
+$cleanerObj = t3lib_div::makeInstance('tx_smoothmigration_cli');
+$cleanerObj->cli_main($_SERVER['argv']);
diff --git a/Classes/Controller/AbstractCommandController.php b/Classes/Controller/AbstractCommandController.php
new file mode 100644 (file)
index 0000000..577f87c
--- /dev/null
@@ -0,0 +1,316 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+// I can haz color / use unicode?
+if (DIRECTORY_SEPARATOR !== '\\') {
+       define('USE_COLOR', function_exists('posix_isatty') && posix_isatty(STDOUT));
+       define('UNICODE', TRUE);
+} else {
+       define('USE_COLOR', getenv('ANSICON') !== FALSE);
+       define('UNICODE', FALSE);
+}
+
+// Get terminal width
+if (@exec('tput cols')) {
+       define('TERMINAL_WIDTH', exec('tput cols'));
+} else {
+       define('TERMINAL_WIDTH', 79);
+}
+
+/**
+ * Abstract Command Controller
+ *
+ * @package smoothmigration
+ * @subpackage Controller
+ */
+class Tx_Smoothmigration_Controller_AbstractCommandController extends Tx_Extbase_MVC_Controller_CommandController {
+
+       /**
+        * Output t3lib_FlashMessage
+        *
+        * @param t3lib_FlashMessage $message
+        *
+        * @return void
+        */
+       public function outputMessage($message = NULL) {
+               if ($message->getTitle()) {
+                       $this->outputLine($message->getTitle());
+               }
+               if ($message->getMessage()) {
+                       $this->outputLine($message->getMessage());
+               }
+               if ($message->getSeverity() !== t3lib_FlashMessage::OK) {
+                       $this->sendAndExit(1);
+               }
+       }
+
+       /**
+        * Normal message
+        *
+        * @param $message
+        * @param boolean $flushOutput
+        *
+        * @return void
+        */
+       public function message($message = NULL, $flushOutput = TRUE) {
+               $this->outputLine($message);
+               if ($flushOutput) {
+                       $this->response->send();
+                       $this->response->setContent('');
+               }
+       }
+
+       /**
+        * Informational message
+        *
+        * @param string $message
+        * @param boolean $showIcon
+        * @param boolean $flushOutput
+        *
+        * @return void
+        */
+       public function infoMessage($message = NULL, $showIcon = FALSE, $flushOutput = TRUE) {
+               $icon = '';
+               if ($showIcon && UNICODE) {
+                       $icon = '★ ';
+               }
+               if (USE_COLOR) {
+                       $this->outputLine("\033[0;36m" . $icon . $message . "\033[0m");
+               } else {
+                       $this->outputLine($icon . $message);
+               }
+               if ($flushOutput) {
+                       $this->response->send();
+                       $this->response->setContent('');
+               }
+       }
+
+       /**
+        * Error message
+        *
+        * @param string $message
+        * @param boolean $showIcon
+        * @param boolean $flushOutput
+        *
+        * @return void
+        */
+       public function errorMessage($message = NULL, $showIcon = FALSE, $flushOutput = TRUE) {
+               $icon = '';
+               if ($showIcon && UNICODE) {
+                       $icon = '✖ ';
+               }
+               if (USE_COLOR) {
+                       $this->outputLine("\033[31m" . $icon . $message . "\033[0m");
+               } else {
+                       $this->outputLine($icon . $message);
+               }
+               if ($flushOutput) {
+                       $this->response->send();
+                       $this->response->setContent('');
+               }
+       }
+
+       /**
+        * Warning message
+        *
+        * @param string $message
+        * @param boolean $showIcon
+        * @param boolean $flushOutput
+        *
+        * @return void
+        */
+       public function warningMessage($message = NULL, $showIcon = FALSE, $flushOutput = TRUE) {
+               $icon = '';
+               if ($showIcon) {
+                       $icon = '! ';
+               }
+               if (USE_COLOR) {
+                       $this->outputLine("\033[0;33m" . $icon . $message . "\033[0m");
+               } else {
+                       $this->outputLine($icon . $message);
+               }
+               if ($flushOutput) {
+                       $this->response->send();
+                       $this->response->setContent('');
+               }
+       }
+
+       /**
+        * Success message
+        *
+        * @param string $message
+        * @param boolean $showIcon
+        * @param boolean $flushOutput
+        *
+        * @return void
+        */
+       public function successMessage($message = NULL, $showIcon = FALSE, $flushOutput = TRUE) {
+               $icon = '';
+               if ($showIcon && UNICODE) {
+                       $icon = '✔ ';
+               }
+               if (USE_COLOR) {
+                       $this->outputLine("\033[0;32m" . $icon . $message . "\033[0m");
+               } else {
+                       $this->outputLine($icon . $message);
+               }
+               if ($flushOutput) {
+                       $this->response->send();
+                       $this->response->setContent('');
+               }
+       }
+
+       /**
+        * Info string
+        *
+        * @param string $string
+        *
+        * @return string
+        */
+       public function infoString($string = NULL) {
+               if (USE_COLOR) {
+                       $string = "\033[0;36m" . $string . "\033[0m";
+               }
+               return $string;
+       }
+
+       /**
+        * Error string
+        *
+        * @param string $string
+        *
+        * @return string
+        */
+       public function errorString($string = NULL) {
+               if (USE_COLOR) {
+                       $string = "\033[0;31m" . $string . "\033[0m";
+               }
+               return $string;
+       }
+
+       /**
+        * Warning string
+        *
+        * @param string $string
+        *
+        * @return string
+        */
+       public function warningString($string = NULL) {
+               if (USE_COLOR) {
+                       $string = "\033[0;33m" . $string . "\033[0m";
+               }
+               return $string;
+       }
+
+       /**
+        * Success string
+        *
+        * @param string $string
+        *
+        * @return string
+        */
+       public function successString($string = NULL) {
+               if (USE_COLOR) {
+                       $string = "\033[0;32m" . $string . "\033[0m";
+               }
+               return $string;
+       }
+
+
+       /**
+        * Show a header message
+        *
+        * @param $message
+        * @param string $style
+        * @param boolean $flushOutput
+        *
+        * @return void
+        */
+       public function headerMessage($message, $style = 'info', $flushOutput = TRUE) {
+               // Crop the message
+               $message = substr($message, 0, TERMINAL_WIDTH );
+               if (UNICODE) {
+                       $linePaddingLength = mb_strlen('─') * (TERMINAL_WIDTH);
+                       $message =
+                               str_pad('', $linePaddingLength, '─') . LF .
+                               str_pad($message, TERMINAL_WIDTH) . LF .
+                               str_pad('', $linePaddingLength, '─');
+               } else {
+                       $message =
+                               str_pad('', TERMINAL_WIDTH, '-') . LF .
+                               str_pad($message, TERMINAL_WIDTH) . LF .
+                               str_pad('', TERMINAL_WIDTH, '-');
+               }
+               switch ($style) {
+                       case 'error':
+                               $this->errorMessage($message, FALSE, $flushOutput);
+                               break;
+                       case 'info':
+                               $this->infoMessage($message, FALSE, $flushOutput);
+                               break;
+                       case 'success':
+                               $this->successMessage($message, FALSE, $flushOutput);
+                               break;
+                       case 'warning':
+                               $this->warningMessage($message, FALSE, $flushOutput);
+                               break;
+                       default:
+                               $this->message($message, $flushOutput);
+               }
+       }
+
+       /**
+        * Show a horizontal line
+        *
+        * @param string $style
+        * @param boolean $flushOutput
+        *
+        * @return void
+        */
+       public function horizontalLine($style = '', $flushOutput = TRUE) {
+               if (UNICODE) {
+                       $linePaddingLength = mb_strlen('─') * (TERMINAL_WIDTH);
+                       $message =
+                               str_pad('', $linePaddingLength, '─');
+               } else {
+                       $message =
+                               str_pad('', TERMINAL_WIDTH, '-');
+               }
+               switch ($style) {
+                       case 'error':
+                               $this->errorMessage($message, FALSE, $flushOutput);
+                               break;
+                       case 'info':
+                               $this->infoMessage($message, FALSE, $flushOutput);
+                               break;
+                       case 'success':
+                               $this->successMessage($message, FALSE, $flushOutput);
+                               break;
+                       case 'warning':
+                               $this->warningMessage($message, FALSE, $flushOutput);
+                               break;
+                       default:
+                               $this->message($message, $flushOutput);
+               }
+       }
+}
diff --git a/Classes/Controller/AbstractModuleController.php b/Classes/Controller/AbstractModuleController.php
new file mode 100644 (file)
index 0000000..8463437
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+if (t3lib_div::int_from_ver(TYPO3_version) < 6002000) {
+       require_once(PATH_site . TYPO3_mainDir . 'template.php');
+}
+
+/**
+ * Abstract action controller.
+ *
+ * @author Steffen Ritter
+
+ */
+class Tx_Smoothmigration_Controller_AbstractModuleController extends Tx_Extbase_MVC_Controller_ActionController {
+       /**
+        * @var string Key of the extension this controller belongs to
+        */
+       protected $extensionName = 'Smoothmigration';
+
+       /**
+        * @var string The module security token
+        */
+       protected $moduleToken = '';
+
+       /**
+        * @var t3lib_PageRenderer
+        */
+       protected $pageRenderer;
+       /**
+        * Initializes the controller before invoking an action method.
+        *
+        * @return void
+        */
+       protected function initializeAction() {
+               $this->pageRenderer->addCssFile(t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/StyleSheet/module.css');
+               $this->pageRenderer->addInlineLanguageLabelFile('EXT:smoothmigration/Resources/Private/Language/locallang.xml');
+               $this->pageRenderer->addJsLibrary('jquery', t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/jquery-1.10.1.min.js');
+               $this->pageRenderer->addJsLibrary('sprintf', t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/sprintf.min.js');
+               $this->pageRenderer->addJsFile(t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/General.js');
+
+               if (t3lib_div::int_from_ver(TYPO3_version) > 6001000) {
+                       $this->moduleToken = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get()->generateToken('moduleCall', 'tools_SmoothmigrationSmoothmigration');
+               }
+       }
+
+       /**
+        * Processes a general request. The result can be returned by altering the given response.
+        *
+        * @param Tx_Extbase_MVC_RequestInterface $request The request object
+        * @param Tx_Extbase_MVC_ResponseInterface $response The response, modified by this handler
+        * @throws Tx_Extbase_MVC_Exception_UnsupportedRequestType if the controller doesn't support the current request type
+        * @return void
+        */
+       public function processRequest(Tx_Extbase_MVC_RequestInterface $request, Tx_Extbase_MVC_ResponseInterface $response) {
+               $this->template = t3lib_div::makeInstance('template');
+               $this->pageRenderer = $this->template->getPageRenderer();
+
+               $GLOBALS['SOBE'] = new stdClass();
+               $GLOBALS['SOBE']->doc = $this->template;
+
+               parent::processRequest($request, $response);
+
+               $pageHeader = $this->template->startpage(
+                       $GLOBALS['LANG']->sL('LLL:EXT:smoothmigration/Resources/Private/Language/locallang.xml:module.title')
+               );
+               $pageEnd = $this->template->endPage();
+
+               $response->setContent($pageHeader . $response->getContent() . $pageEnd);
+       }
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/smoothmigration/Classes/Controller/AbstractModuleController.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/smoothmigration/Classes/Controller/AbstractModuleController.php']);
+}
+?>
\ No newline at end of file
diff --git a/Classes/Controller/AjaxController.php b/Classes/Controller/AjaxController.php
new file mode 100644 (file)
index 0000000..c8e9630
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Controller_ReportController
+ */
+class Tx_Smoothmigration_Controller_AjaxController extends Tx_Extbase_MVC_Controller_ActionController {
+
+       /**
+        * @var Tx_Smoothmigration_Domain_Repository_IssueRepository {
+        */
+       protected $issueRepository;
+
+       public function injectIssueRepository(Tx_Smoothmigration_Domain_Repository_IssueRepository $issueRepository) {
+               $this->issueRepository = $issueRepository;
+       }
+
+       /**
+        * Initializes the controller before invoking an action method.
+        *
+        * @return void
+        */
+       protected function initializeAction() {
+               parent::initializeAction();
+               $this->response->setHeader('Content-type', 'application/json; charset=utf-8');
+       }
+
+       /**
+        * @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'));
+               }
+       }
+
+
+       /**
+        * @param string $checkIdentifier
+        *
+        * @return string
+        */
+       public function clearTestResultsAction($checkIdentifier) {
+               $deletedIssueCount = $this->issueRepository->deleteAllByInspection($checkIdentifier);
+
+               if ($deletedIssueCount !== -1) {
+                       return json_encode(array(
+                               'result' => 'OK',
+                               'issueCount' => $deletedIssueCount,
+                       ));
+               } else {
+                       $this->response->setStatus(404, 'Check not found');
+                       return json_encode(array('result' => 'ERROR'));
+               }
+       }
+}
+
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/smoothmigration/Classes/Controller/AjaxController.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/smoothmigration/Classes/Controller/AjaxController.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Controller/ReportController.php b/Classes/Controller/ReportController.php
new file mode 100644 (file)
index 0000000..358de21
--- /dev/null
@@ -0,0 +1,356 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Controller_ReportController
+ */
+class Tx_Smoothmigration_Controller_ReportController extends Tx_Smoothmigration_Controller_AbstractModuleController {
+
+       /**
+        * @var Tx_Smoothmigration_Domain_Repository_IssueRepository {
+        */
+       protected $issueRepository;
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Repository_IssueRepository $issueRepository
+        *
+        * @return void
+        */
+       public function injectIssueRepository(Tx_Smoothmigration_Domain_Repository_IssueRepository $issueRepository) {
+               $this->issueRepository = $issueRepository;
+       }
+
+       /**
+        * Checks action, displays the available checks
+        *
+        * @return void
+        */
+       public function checksAction() {
+               /** @var Tx_Smoothmigration_Service_Check_Registry $checkRegistry */
+               $checkRegistry = $this->objectManager->get('Tx_Smoothmigration_Service_Check_Registry');
+               $activeChecks = $checkRegistry->getActiveChecks();
+               $this->view->assign('checks', $activeChecks);
+               $this->view->assign('issuesByCheck', $this->issueRepository->findAllGroupedByInspection($activeChecks));
+               $this->view->assign('moduleToken', $this->moduleToken);
+       }
+
+       /**
+        * Page id list action
+        * Lists page id's beneath each site root
+        *
+        * @return void
+        */
+       public function pageIdListAction() {
+               $values = array();
+
+               // FIXME: It's unclear to me how to get this value programmatically
+               // There is a getArgumentPrefix method, but that only applies to widgets
+               $values['argumentPrefix'] = 'tx_smoothmigration_tools_smoothmigrationsmoothmigration';
+
+               // List of sites
+               $sites = Tx_Smoothmigration_Utility_DatabaseUtility::getSiteRoots();
+               $selectSites = array();
+               foreach ($sites as $siteUid => $siteData) {
+                       $selectSites[$siteUid] = $siteUid . ': ' . $siteData['title'];
+               }
+               $values['sites'] = $selectSites;
+
+               $selectedSite = '';
+               if ($this->request->hasArgument('site')) {
+                       $selectedSite = $this->request->getArgument('site');
+                       $values['selectedSite'] = $selectedSite;
+               }
+
+               $limit = 1000;
+               if ($this->request->hasArgument('limit')) {
+                       $limit = $this->request->getArgument('limit');
+                       $values['limit'] = $limit;
+               }
+
+               if ($selectedSite) {
+                       $values['pageCount'] = count(Tx_Smoothmigration_Utility_DatabaseUtility::getChildPagesArray($selectedSite, $limit));
+                       $values['pageIds'] = implode(', ', Tx_Smoothmigration_Utility_DatabaseUtility::getChildPagesArray($selectedSite, $limit));
+                       $values['domainRecords'] = Tx_Smoothmigration_Utility_DatabaseUtility::getDomainRecords($selectedSite);
+               }
+
+               $this->view->assignMultiple($values);
+               $this->view->assign('moduleToken', $this->moduleToken);
+       }
+
+       /**
+        * Extension action, displays extension report
+        *
+        * @return void
+        */
+       public function extensionAction() {
+               $values = array();
+
+               // FIXME: It's unclear to me how to get this value programmatically
+               // There is a getArgumentPrefix method, but that only applies to widgets
+               $values['argumentPrefix'] = 'tx_smoothmigration_tools_smoothmigrationsmoothmigration';
+
+               // List of frontend extensions
+               $loadedExtensions = Tx_Smoothmigration_Utility_ExtensionUtility::getFrontendExtensions(FALSE);
+               $this->view->assign('loadedExtensions', $loadedExtensions);
+
+               $selectedExtension = '';
+               if ($this->request->hasArgument('extension')) {
+                       $selectedExtension = $this->request->getArgument('extension');
+               }
+
+               // List of sites
+               $sites = Tx_Smoothmigration_Utility_DatabaseUtility::getSiteRoots();
+               $selectSites = array();
+               foreach ($sites as $siteUid => $siteData) {
+                       $selectSites[$siteUid] = $siteUid . ': ' . $siteData['title'];
+               }
+               $values['sites'] = $selectSites;
+
+               $selectedSite = '';
+               if ($this->request->hasArgument('site')) {
+                       $selectedSite = $this->request->getArgument('site');
+                       $values['selectedSite'] = $selectedSite;
+               }
+
+               if ($selectedSite && $selectedExtension != 1) {
+                       // Get TypoScript configuration for selected site
+                       if (count($sites) && $selectedSite) {
+                               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
+                               $tmpl->tt_track = 0;
+                               $tmpl->init();
+                               $tmpl->runThroughTemplates(t3lib_BEfunc::BEgetRootLine((int)$selectedSite, 'AND 1=1'), 0);
+                               $tmpl->generateConfig();
+                       }
+
+                       // Fetch correct class names
+                       $correctClassNames = array();
+                       if ($selectedExtension) {
+                               $correctClassNames[$selectedExtension] = t3lib_extMgm::getCN($selectedExtension);
+                       } else {
+                               $extensionKeys = Tx_Smoothmigration_Utility_ExtensionUtility::getLoadedExtensions();
+                               foreach ($extensionKeys as $key) {
+                                       $correctClassNames[$key] = t3lib_extMgm::getCN($key);
+                               }
+                       }
+
+                       $listTypes = array();
+                       $values['plugins'] = array();
+                       // For all the root plugin objects in the plugin array
+                       foreach ($tmpl->setup['plugin.'] as $name => $_) {
+                               $name = rtrim($name, '.');
+                               // Store the matching extension key with the plugin name
+                               foreach ($correctClassNames as $key => $className) {
+                                       if (strstr($name, $className)) {
+                                               $values['plugins'][$name] = $key;
+                                               $suffix = str_replace($className, '', $name);
+                                               $listTypes[] = $key . $suffix;
+                                       }
+                               }
+                       }
+                       asort($values['plugins']);
+
+                       $pluginNames = array_keys($values['plugins']);
+
+                       // This catches Powermail which has it's own ctype which it calls powermail_pi1
+                       $values['cTypes'] = array();
+                       foreach ($pluginNames as $name) {
+                               array_push($values['cTypes'], str_replace('tx_', '', $name));
+                       }
+
+                       // Fetch list types, initialize with legacy tt_news list_type: 9
+                       $values['listTypes'] = array();
+                       if ($selectedExtension === 'tt_news') {
+                               $values['listTypes'] = array('9');
+                       }
+                       foreach ($tmpl->setup['tt_content.']['list.']['20.'] as $listType => $_) {
+                               if (preg_match('/^[^.]+$/', $listType)) {
+                                       foreach ($values['plugins'] as $correctedClassName) {
+                                               if (preg_match('/^' . $correctedClassName .'/', $listType)) {
+                                                       $values['listTypes'][] = $listType;
+                                               }
+                                       }
+                               }
+                       }
+                       asort($values['listTypes']);
+
+                       $values['pages'] = array();
+                       if (count($values['listTypes']) || count($values['cTypes'])) {
+                               $values['pages'] =
+                                       Tx_Smoothmigration_Utility_DatabaseUtility::getPagesWithContentElements($values['cTypes'], $values['listTypes']);
+                       }
+
+                       $pages = array();
+                       foreach ($values['pages'] as $page) {
+                               $this->setInPageArray(
+                                       $pages,
+                                       t3lib_BEfunc::BEgetRootLine($page['pageUid'], 'AND 1=1'),
+                                       $page
+                               );
+                       }
+
+                       $lines = array();
+                       $lines[] = '<tr class="t3-row-header">
+                               <td nowrap>Page title</td>
+                               <td nowrap>' . $GLOBALS['LANG']->getLL('isExt') . '</td>
+                               </tr>';
+                       $lines = array_merge($lines, $this->renderList($pages));
+
+                       $values['table'] = '<table border="0" cellpadding="0" cellspacing="1" id="ts-overview">' . implode('', $lines) . '</table>';
+               }
+
+               $this->view->assignMultiple($values);
+               $this->view->assign('selectedExtension', $selectedExtension);
+               $this->view->assign('moduleToken', $this->moduleToken);
+       }
+
+       /**
+        * Overview of report actions
+        *
+        * @return void
+        */
+       public function reportOverviewAction() {
+               $this->view->assign('issueCount', $this->issueRepository->findAll()->count());
+               $this->view->assign('moduleToken', $this->moduleToken);
+       }
+
+       /**
+        * Show action, Shows the report
+        *
+        * @return void
+        */
+       public function showAction() {
+               // Set a default site root so we can link to the extension usage report
+               $sites = Tx_Smoothmigration_Utility_DatabaseUtility::getSiteRoots();
+               $defaultSite = array_shift($sites);
+               $this->view->assign('site', $defaultSite['uid']);
+               $this->view->assign('issueCount', $this->issueRepository->findAll()->count());
+               $this->view->assign('groupedIssues', $this->issueRepository->findAllGroupedByExtensionAndInspection());
+               $this->view->assign('moduleToken', $this->moduleToken);
+       }
+
+       /**
+        * Initializes the controller before invoking an action method.
+        *
+        * @return void
+        */
+       protected function initializeAction() {
+               parent::initializeAction();
+
+               $this->pageRenderer->addJsFile($this->backPath . '../t3lib/js/extjs/ux/flashmessages.js');
+
+               $resourcePath = t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/';
+
+               //$this->pageRenderer->addCssFile($resourcePath . 'gridfilters/css/GridFilters.css');
+
+               $jsFiles = array();
+
+               foreach ($jsFiles as $jsFile) {
+                       $this->pageRenderer->addJsFile($resourcePath . $jsFile);
+               }
+       }
+
+       /**
+        * Populate the pages array
+        * Ugly code taken from \SC_mod_web_ts_index
+        *
+        * @param $pages
+        * @param $rootLine
+        * @param $row
+        *
+        * @return void
+        */
+       private function setInPageArray(&$pages, $rootLine, $row) {
+               ksort($rootLine);
+               reset($rootLine);
+               if (!$rootLine[0]['uid']) {
+                       array_shift($rootLine);
+               }
+
+               $contentElement = current($rootLine);
+               $pages[$contentElement['uid']] = htmlspecialchars($contentElement['title']);
+               array_shift($rootLine);
+               if (count($rootLine)) {
+                       if (!isset($pages[$contentElement['uid'] . '.'])) {
+                               $pages[$contentElement['uid'] . '.'] = array();
+                       }
+                       $this->setInPageArray($pages[$contentElement['uid'] . '.'], $rootLine, $row);
+               } else {
+                       $pages[$contentElement['uid'] . '_'] = $row;
+               }
+       }
+
+       /**
+        * Render the list of pages with plugins
+        * Ugly code taken from \SC_mod_web_ts_index
+        *
+        * @param $pages
+        * @param array $lines
+        * @param int $c
+        *
+        * @return array
+        */
+       private function renderList($pages, $lines = array(), $c = 0) {
+               if (is_array($pages)) {
+                       reset($pages);
+                       static $i;
+                       $isV4 = t3lib_div::int_from_ver(TYPO3_version) < 6002000;
+                       foreach ($pages as $k => $v) {
+                               if ($isV4) {
+                                       $valueIsInt = t3lib_div::testInt($k);
+                               } else {
+                                       $valueIsInt = \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($k);
+                               }
+                               if ($valueIsInt) {
+                                       if (isset($pages[$k . "_"])) {
+                                               $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
+                                                       <td nowrap><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align="top">' .
+                                                       '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('id' => $k))) . '">' .
+                                                       t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k), array("title" => 'ID: ' . $k)) .
+                                                       t3lib_div::fixed_lgd_cs($pages[$k], 30) . '</a></td>
+                                                       <td align="center">' . ($pages[$k . '_']['root_min_val'] == 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : "&nbsp;") .
+                                                       '</td>
+                                                       </tr>';
+                                       } else {
+                                               $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
+                                                       <td nowrap ><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align=top>' .
+                                                       t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k)) .
+                                                       t3lib_div::fixed_lgd_cs($pages[$k], 30) . '</td>
+                                                       <td align="center"></td>
+                                                       </tr>';
+                                       }
+                                       $lines = $this->renderList($pages[$k . '.'], $lines, $c + 1);
+                               }
+                       }
+               }
+               return $lines;
+       }
+}
+
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/smoothmigration/Classes/Controller/ReviewController.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/smoothmigration/Classes/Controller/ReviewController.php']);
+}
diff --git a/Classes/Controller/SmoothmigrationCommandController.php b/Classes/Controller/SmoothmigrationCommandController.php
new file mode 100644 (file)
index 0000000..b0aa6f0
--- /dev/null
@@ -0,0 +1,516 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+
+/**
+ * Command Controller to execute smoothmigration checks
+ *
+ * @package smoothmigration
+ * @subpackage Controller
+ */
+class Tx_Smoothmigration_Controller_SmoothmigrationCommandController extends Tx_Extbase_MVC_Controller_CommandController {
+
+       /**
+        * @var array
+        */
+       protected $autoCompleteValues = array();
+
+       /**
+        * @var array
+        */
+       protected $availableActions = array();
+
+       /**
+        * @var array<\TYPO3\CMS\Extbase\Mvc\Cli\Command>
+        */
+       protected $availableCommands = NULL;
+
+       /**
+        * True if we are running in interactive mode
+        *
+        * @var bool
+        */
+       protected $isInInteractiveMode = FALSE;
+
+       /**
+        * True if we are running the checkAll comman
+        *
+        * @var bool
+        */
+       protected $isCheckingAll = FALSE;
+
+       /**
+        * @var Tx_Smoothmigration_Cli_CommandManager
+        */
+       protected $commandManager;
+
+       /**
+        * @param Tx_Smoothmigration_Cli_CommandManager $commandManager
+        *
+        * @return void
+        */
+       public function injectCommandManager(Tx_Smoothmigration_Cli_CommandManager $commandManager) {
+               $this->commandManager = $commandManager;
+       }
+
+       /**
+        * @var Tx_Smoothmigration_Service_MessageService
+        */
+       protected $messageBus;
+
+       /**
+        * inject the messageBus
+        *
+        * @param Tx_Smoothmigration_Service_MessageService $messageBus
+        * @return void
+        */
+       public function injectMessageBus(Tx_Smoothmigration_Service_MessageService $messageBus) {
+               $this->messageBus = $messageBus;
+       }
+
+       /**
+        * Display available checks
+        *
+        * The check command displays available checks
+        *
+        * @param string $commandIdentifier Identifier of a command for more details
+        * @param string $extensionKey A single extension to migratie
+        *
+        * @return void
+        */
+       public function checkCommand($commandIdentifier = NULL, $extensionKey = '') {
+               if ($commandIdentifier === NULL) {
+                       $this->displayActionIndex();
+               } else {
+                       try {
+                               /** @var Tx_Smoothmigration_Domain_Interface_Check $check */
+                               $check = $this->commandManager->getCommandByTypeAndIdentifier('Check', $commandIdentifier);
+                               if ($check) {
+                                       $forExtension = (trim($extensionKey)) ? ' in extension: ' . $extensionKey : '';
+                                       $this->messageBus->headerMessage('Check: \'' . $check->getTitle() . '\'' . $forExtension);
+                                       /** @var Tx_Smoothmigration_Checks_AbstractCheckProcessor $processor */
+                                       $processor = $check->getProcessor();
+                                       if (trim($extensionKey)) {
+                                               $processor->setExtensionKey($extensionKey);
+                                       }
+                                       $processor->execute();
+                                       $issueRepository = $this->objectManager->get('Tx_Smoothmigration_Domain_Repository_IssueRepository');
+                                       foreach ($processor->getIssues() as $issue) {
+                                               $issueRepository->add($issue);
+                                       }
+
+                                       /** @var Tx_Extbase_Persistence_Manager $persistenceManger */
+                                       $persistenceManger = $this->objectManager->get('Tx_Extbase_Persistence_Manager');
+                                       $persistenceManger->registerRepositoryClassName('Tx_Smoothmigration_Domain_Repository_IssueRepository');
+                                       $persistenceManger->persistAll();
+                                       $this->issueReport(count($processor->getIssues()), $extensionKey);
+                                       if ($this->isInInteractiveMode && !$this->isCheckingAll) {
+                                               $this->checkCommand();
+                                       }
+                               }
+                       } catch (Tx_Extbase_MVC_Exception_Command $exception) {
+                               $this->messageBus->message($exception->getMessage());
+
+                               return;
+                       }
+               }
+       }
+
+       /**
+        * Run all checks on all- or on a single extension
+        *
+        * @param string $extensionKey A single extension to migratie
+        *
+        * @return void
+        */
+       public function checkAllCommand($extensionKey = '') {
+               $this->isCheckingAll = TRUE;
+               $availableCommands = $this->commandManager->getAvailableCommands();
+               /** @var Tx_Smoothmigration_Checks_AbstractCheckDefinition $command */
+               foreach ($availableCommands['check'] as $command) {
+                       $commandIdentifier = $command->getIdentifier();
+                       $this->checkCommand($commandIdentifier, $extensionKey);
+               }
+               $this->isCheckingAll = FALSE;
+               if ($this->isInInteractiveMode) {
+                       $this->checkCommand();
+               }
+       }
+
+       /**
+        * Run in interactive mode
+        *
+        * @return void
+        */
+       public function interactiveCommand() {
+               $this->isInInteractiveMode = TRUE;
+               $this->messageBus->headerMessage('Smooth Migration:', 'info');
+               $this->getAvailableCommands();
+
+               if ($this->availableActions === array()) {
+                       $this->availableActions = $this->commandManager->getAvailableCommands();
+               }
+               foreach ($this->availableActions as $type => $actions) {
+                       foreach ($actions as $action) {
+                               $this->autoCompleteValues['actions'][$type][] = $action->getIdentifier();
+                       }
+               }
+
+               $colorizedIdentifierLength = $this->getMaximumCommandNameLength($this->availableCommands, TRUE);
+               $identifierLength = $this->getMaximumCommandNameLength($this->availableCommands);
+
+               $this->messageBus->message(vsprintf('   %-' . $identifierLength . 's %s', array(
+                       'Identifier',
+                       'Description'
+               )));
+               $this->messageBus->horizontalLine();
+
+               /** @var \TYPO3\CMS\Extbase\Mvc\Cli\Command $command */
+               $actions = array();
+               $counter = 1;
+               foreach ($this->availableCommands as $command) {
+                       $description = wordwrap($command->getShortDescription(), TERMINAL_WIDTH - $identifierLength - 6, PHP_EOL . str_repeat(' ', $identifierLength + 8), TRUE);
+                       $shortCommandIdentifier = $command->getControllerCommandName();
+                       $this->messageBus->message(vsprintf('%s) %-' . $colorizedIdentifierLength . 's %s', array(
+                               $counter,
+                               $this->messageBus->successString($shortCommandIdentifier),
+                               $description
+                       )));
+                       $actions[$counter] = $shortCommandIdentifier;
+                       $counter++;
+               }
+               $this->messageBus->message();
+               $this->messageBus->setCompletions(array(
+                       'actions' => $this->autoCompleteValues['actions'],
+                       'commands' => $this->autoCompleteValues['commands'],
+                       'extensions' => Tx_Smoothmigration_Utility_ExtensionUtility::getLoadedExtensionsFiltered()
+               ));
+               $this->messageBus->usage();
+               $response = $this->messageBus->prompt();
+               $this->messageBus->message();
+
+               $responseParts = explode(' ', $response);
+               $code = array_shift($responseParts);
+               switch ($code) {
+                       case '0':
+                       case 'check':
+                               readline_add_history($response);
+                               $this->checkCommand(array_shift($responseParts), array_shift($responseParts));
+                               break;
+                       case '1':
+                       case 'migration':
+                               readline_add_history($response);
+                               $this->migrationCommand(array_shift($responseParts), array_shift($responseParts));
+                               break;
+                       default:
+                               if (array_key_exists($code, $actions)) {
+                                       readline_add_history($response);
+                                       $method = $actions[$code] . 'Command';
+                                       $this->$method(array_shift($responseParts), array_shift($responseParts));
+                               } elseif (in_array($code, $actions)) {
+                                       readline_add_history($response);
+                                       $method = $code . 'Command';
+                                       $this->$method(array_shift($responseParts), array_shift($responseParts));
+                               } elseif ($code == -1) {
+                                       $this->messageBus->errorMessage('Can\'t go furter back.');
+                               } else {
+                                       $this->messageBus->errorMessage('Uknown comand: ' . $code);
+                               }
+               }
+               $this->interactiveCommand();
+       }
+
+       /**
+        * Display available migrations
+        *
+        * The migrate command displays available migrations
+        *
+        * @param string $commandIdentifier Identifier of a command for more details
+        * @param string $extensionKey A single extension to migratie
+        * @param boolean $experimental Execute experimental migrations
+        *
+        * @return void
+        */
+       public function migrationCommand($commandIdentifier = NULL, $extensionKey = '', $experimental = FALSE) {
+               if ($commandIdentifier === NULL) {
+                       $this->displayActionIndex('Migration');
+               } else {
+                       try {
+                               /** @var Tx_Smoothmigration_Domain_Interface_Migration $migration */
+                               $migration = $this->commandManager->getCommandByTypeAndIdentifier('Migration', $commandIdentifier);
+                               if ($migration) {
+                                       $forExtension = (trim($extensionKey)) ? ' for extension: ' . $extensionKey : '';
+                                       $this->messageBus->headerMessage('Migration: \'' . $migration->getTitle() . '\'' . $forExtension);
+                                       /** @var Tx_Smoothmigration_Migrations_AbstractMigrationProcessor $processor */
+                                       $processor = $migration->getProcessor();
+                                       if (trim($extensionKey)) {
+                                               $processor->setExtensionKey($extensionKey);
+                                       }
+                                       if ((bool)$experimental) {
+                                               $processor->setExperimental($experimental);
+                                       }
+                                       $processor->setMessageService($this->messageBus);
+                                       $processor->execute();
+
+                                       /** @var Tx_Extbase_Persistence_Manager $persistenceManger */
+                                       $persistenceManger = $this->objectManager->get('Tx_Extbase_Persistence_Manager');
+                                       $persistenceManger->persistAll();
+                               }
+                       } catch (Tx_Extbase_MVC_Exception_Command $exception) {
+                               $this->messageBus->message($exception->getMessage());
+
+                               return;
+                       }
+               }
+       }
+
+       /**
+        * 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);
+               }
+       }
+
+       /**
+        * Returns an array of all commands in this class
+        *
+        * @return array<\TYPO3\CMS\Extbase\Mvc\Cli\Command>
+        * @api
+        */
+       protected function getAvailableCommands() {
+               if ($this->availableCommands === NULL) {
+                       $this->availableCommands = array();
+
+                       foreach (get_class_methods(get_class($this)) as $methodName) {
+                               if (substr($methodName, -7, 7) === 'Command' && $methodName !== 'interactiveCommand') {
+
+                                       /** @var \TYPO3\CMS\Extbase\Mvc\Cli\Command $command */
+                                       $command = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Command', get_class($this), substr($methodName, 0, -7));
+                                       $this->availableCommands[] = $command;
+                                       $this->autoCompleteValues['commands'][] = $command->getControllerCommandName();
+                               }
+                       }
+               }
+               return $this->availableCommands;
+       }
+
+       /**
+        * Display index of actions
+        *
+        * @param string $type
+        *
+        * @return void
+        */
+       protected function displayActionIndex($type = 'Check') {
+               $this->messageBus->headerMessage('Avaliable ' . $type . 's:', 'info');
+               $type = strtolower($type);
+               if ($this->availableActions === array()) {
+                       $this->availableActions = $this->commandManager->getAvailableCommands();
+               }
+
+               $colorizedIdentifierLength = $this->getMaximumIdentifierLength($this->availableActions[$type], TRUE);
+               $identifierLength = $this->getMaximumIdentifierLength($this->availableActions[$type]);
+
+               $this->messageBus->message(vsprintf('    %-' . $identifierLength . 's %s', array(
+                       'Identifier',
+                       'Description'
+               )));
+               $this->messageBus->horizontalLine();
+
+               /** @var Tx_Smoothmigration_Checks_AbstractCheckDefinition $command */
+               $counter = 1;
+               foreach ($this->availableActions[$type] as $command) {
+                       $this->autoCompleteValues['actions'][] = $command->getIdentifier();
+                       $description = wordwrap($command->getShortDescription(), TERMINAL_WIDTH - $identifierLength - 7, PHP_EOL . str_repeat(' ', $identifierLength + 7), TRUE);
+                       $shortCommandIdentifier = $command->getIdentifier();
+                       $this->messageBus->message(vsprintf('%2s) %-' . $colorizedIdentifierLength . 's %s', array(
+                               $counter,
+                               $this->messageBus->successString($shortCommandIdentifier),
+                               $description
+                       )));
+                       $counter++;
+               }
+               $this->messageBus->message();
+               if ($this->isInInteractiveMode) {
+                       $this->messageBus->setCompletions(array(
+                               'actions' => $this->autoCompleteValues['actions'],
+                               'extensions' => Tx_Smoothmigration_Utility_ExtensionUtility::getLoadedExtensionsFiltered()
+                       ));
+                       $actions = $this->autoCompleteValues['actions'][$type];
+                       $this->messageBus->usage();
+                       $response = $this->messageBus->prompt();
+                       $this->messageBus->message();
+                       list($code, $extension) = explode(' ', $response);
+                       if (array_key_exists($code, $actions)) {
+                               readline_add_history($response);
+                               $method = $type . 'Command';
+                               $this->$method($actions[$code], $extension);
+                       } elseif (in_array($code, $actions)) {
+                               readline_add_history($response);
+                               $method = $type . 'Command';
+                               $this->$method($code, $extension);
+                       } elseif ($code == -1) {
+                               $this->interactiveCommand();
+                       } else {
+                               $this->messageBus->errorMessage('Uknown comand: ' . $code);
+                               $this->interactiveCommand();
+                       }
+               } else {
+                       $this->messageBus->message('Usage: ./cli_dispatch.phpsh extbase smoothmigration:' . $type . ' <Identifier> [extensionName]');
+               }
+               $this->messageBus->message();
+       }
+
+       /**
+        * Get the maximum length of the command names
+        *
+        * @param array $commands
+        * @param bool $colorizedLength
+        *
+        * @return int
+        */
+       protected function getMaximumCommandNameLength($commands, $colorizedLength = FALSE) {
+               $length = 0;
+
+               /** @var \TYPO3\CMS\Extbase\Mvc\Cli\Command $command */
+               if ($colorizedLength) {
+                       foreach ($commands as $command) {
+                               if ($length < strlen($this->messageBus->successString($command->getControllerCommandName()))) {
+                                       $length = strlen($this->messageBus->successString($command->getControllerCommandName()));
+                               }
+                       }
+               } else {
+                       foreach ($commands as $command) {
+                               if ($length < strlen($command->getControllerCommandName())) {
+                                       $length = strlen($command->getControllerCommandName());
+                               }
+                       }
+               }
+
+               return $length;
+       }
+
+       /**
+        * Get the maximum length of the indentifiers
+        *
+        * @param array $commands
+        * @param bool $colorizedLength
+        *
+        * @return int
+        */
+       protected function getMaximumIdentifierLength($commands, $colorizedLength = FALSE) {
+               $length = 0;
+
+               if ($colorizedLength) {
+                       /** @var Tx_Smoothmigration_Checks_AbstractCheckDefinition $command */
+                       foreach ($commands as $command) {
+                               if ($length < strlen($this->messageBus->successString($command->getIdentifier()))) {
+                                       $length = strlen($this->messageBus->successString($command->getIdentifier()));
+                               }
+                       }
+               } else {
+                       /** @var Tx_Smoothmigration_Checks_AbstractCheckDefinition $command */
+                       foreach ($commands as $command) {
+                               if ($length < strlen($command->getIdentifier())) {
+                                       $length = strlen($command->getIdentifier());
+                               }
+                       }
+               }
+
+               return $length;
+       }
+
+       /**
+        * Show an issue report
+        *
+        * @param integer $count
+        * @param string $extensionKey
+        */
+       protected function issueReport($count, $extensionKey = '') {
+
+               $forExtension = (trim($extensionKey)) ? ' for extension: ' . $extensionKey : '';
+               switch ((int)$count) {
+                       case 0:
+                               $this->messageBus->successMessage('No issues found' . $forExtension, TRUE);
+                               break;
+                       case 1:
+                               $this->messageBus->warningMessage($count . ' issue found' . $forExtension, TRUE);
+                               break;
+                       default:
+                               $this->messageBus->warningMessage($count . ' issues found' . $forExtension, TRUE);
+               }
+       }
+
+       /**
+        * @return Tx_Smoothmigration_Service_MessageService
+        */
+       public function getMessageBus() {
+               return $this->messageBus;
+       }
+
+}
diff --git a/Classes/Domain/Interface/Check.php b/Classes/Domain/Interface/Check.php
new file mode 100644 (file)
index 0000000..bffd0f2
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_CheckProcessor
+ *
+ * @author Steffen Ritter
+ */
+interface Tx_Smoothmigration_Domain_Interface_Check extends Tx_Smoothmigration_Domain_Interface_CheckDescription, Tx_Smoothmigration_Domain_Interface_CheckRequirements, t3lib_Singleton {
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckProcessor
+        */
+       public function getProcessor();
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer
+        */
+       public function getResultAnalyzer();
+}
diff --git a/Classes/Domain/Interface/CheckDescription.php b/Classes/Domain/Interface/CheckDescription.php
new file mode 100644 (file)
index 0000000..5a41a80
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_CheckDescription
+ *
+ * @author Steffen Ritter
+ */
+interface Tx_Smoothmigration_Domain_Interface_CheckDescription extends Tx_Smoothmigration_Domain_Interface_Description {
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/CheckProcessor.php b/Classes/Domain/Interface/CheckProcessor.php
new file mode 100644 (file)
index 0000000..e1ca72a
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_CheckProcessor
+ *
+ * @author Steffen Ritter
+ */
+interface Tx_Smoothmigration_Domain_Interface_CheckProcessor extends Tx_Smoothmigration_Domain_Interface_Processor {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Interface_Check $check
+        */
+       public function __construct(Tx_Smoothmigration_Domain_Interface_Check $check);
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/CheckRequirements.php b/Classes/Domain/Interface/CheckRequirements.php
new file mode 100644 (file)
index 0000000..af25b22
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_CheckRequirements
+ *
+ * @author Steffen Ritter
+ */
+interface Tx_Smoothmigration_Domain_Interface_CheckRequirements extends Tx_Smoothmigration_Domain_Interface_Requirements {
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/CheckResultAnalyzer.php b/Classes/Domain/Interface/CheckResultAnalyzer.php
new file mode 100644 (file)
index 0000000..64694bf
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_CheckProcessor
+ *
+ * @author Steffen Ritter
+ */
+interface Tx_Smoothmigration_Domain_Interface_CheckResultAnalyzer extends Tx_Smoothmigration_Domain_Interface_ResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Interface_Check $check
+        */
+       public function __construct(Tx_Smoothmigration_Domain_Interface_Check $check);
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/Description.php b/Classes/Domain/Interface/Description.php
new file mode 100644 (file)
index 0000000..70e0cf8
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_Description
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_Description {
+
+       const TYPE_SETTINGS = 0;
+       const TYPE_PHP_CODE = 1;
+       const TYPE_EXTENSION = 2;
+       const TYPE_DATABASE = 4;
+       const TYPE_ENVIRONMENT = 8;
+
+       /**
+        * Returns an Identifier
+        * Has to be unique
+        *
+        * @return string
+        */
+       public function getIdentifier();
+
+       /**
+        * Returns the Type of the Object
+        * One of the Constants Defined in that interface
+        *
+        * @return int
+        */
+       public function getType();
+
+       /**
+        * Returns the name of the check
+        *
+        * @return string
+        */
+       public function getTitle();
+
+       /**
+        * Returns a string which describes the check in one sentence.
+        *
+        * @return string
+        */
+       public function getShortDescription();
+
+       /**
+        * Returns a string which contains an elaborate description
+        * of what the check does.
+        *
+        * @return string
+        */
+       public function getDescription();
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/IssueLocation.php b/Classes/Domain/Interface/IssueLocation.php
new file mode 100644 (file)
index 0000000..76019a7
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_IssueDetails
+ *
+ * @author Steffen Ritter
+ */
+interface Tx_Smoothmigration_Domain_Interface_IssueLocation {
+
+       /**
+        * Creates ID which identifies the occurence of that issue
+        *
+        * @return string
+        */
+       public function createIssueIdentifier();
+
+       /**
+        * Developers want to group by Extension/not by test,
+        * implement that later
+        *
+        * @return string|NULL
+        */
+       public function getExtension();
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/Migration.php b/Classes/Domain/Interface/Migration.php
new file mode 100644 (file)
index 0000000..340ed49
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_MigrationProcessor
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_Migration extends Tx_Smoothmigration_Domain_Interface_MigrationDescription, Tx_Smoothmigration_Domain_Interface_MigrationRequirements, t3lib_Singleton {
+
+       const SUCCESS = 1;
+       const ERROR_FILE_NOT_FOUND = 2;
+       const ERROR_FILE_NOT_WRITABLE = 3;
+       const ERROR_FILE_NOT_CHANGED = 4;
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_MigrationProcessor
+        */
+       public function getProcessor();
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Interface_MigrationResultAnalyzer
+        */
+       public function getResultAnalyzer();
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/MigrationDescription.php b/Classes/Domain/Interface/MigrationDescription.php
new file mode 100644 (file)
index 0000000..5f7a8a6
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_MigrationDescription
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_MigrationDescription extends
+       Tx_Smoothmigration_Domain_Interface_Description {
+
+       /**
+        * Get a key to identify the migration for CLI usage
+        *
+        * @return string
+        */
+       public function getCliKey();
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/MigrationProcessor.php b/Classes/Domain/Interface/MigrationProcessor.php
new file mode 100644 (file)
index 0000000..f09974a
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_MigrationProcessor
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_MigrationProcessor extends Tx_Smoothmigration_Domain_Interface_Processor {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Interface_Migration $migration
+        */
+       public function __construct(Tx_Smoothmigration_Domain_Interface_Migration $migration);
+
+}
diff --git a/Classes/Domain/Interface/MigrationRequirements.php b/Classes/Domain/Interface/MigrationRequirements.php
new file mode 100644 (file)
index 0000000..3943e25
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_CheckRequirements
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_MigrationRequirements extends Tx_Smoothmigration_Domain_Interface_Requirements {
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/MigrationResultAnalyzer.php b/Classes/Domain/Interface/MigrationResultAnalyzer.php
new file mode 100644 (file)
index 0000000..13a2701
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_MigrationProcessor
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_MigrationResultAnalyzer extends Tx_Smoothmigration_Domain_Interface_ResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Interface_Migration $migration
+        */
+       public function __construct(Tx_Smoothmigration_Domain_Interface_Migration $migration);}
+
+?>
diff --git a/Classes/Domain/Interface/Processor.php b/Classes/Domain/Interface/Processor.php
new file mode 100644 (file)
index 0000000..04ce2ba
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_Processor
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_Processor {
+
+       /**
+        * @return mixed
+        */
+       public function execute();
+
+       /**
+        * @return boolean
+        */
+       public function hasIssues();
+
+       /**
+        * @return Tx_Smoothmigration_Domain_Model_Issue[]
+        */
+       public function getIssues();
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/Requirements.php b/Classes/Domain/Interface/Requirements.php
new file mode 100644 (file)
index 0000000..f25d053
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_Requirements
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_Requirements {
+
+       /**
+        * Return the minimum TYPO3 Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMinimalTypo3Version();
+
+       /**
+        * Return the maximal TYPO3 Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMaximalTypo3Version();
+
+       /**
+        * Return the minimum PHP Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMinimalPhpVersion();
+
+       /**
+        * Return the maximal PHP Version the checks needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMaximalPhpVersion();
+
+       /**
+        * Returns an array of php-modules, which need to be available
+        * to activate this check;
+        *
+        * Empty array is returned if no special modules are needed
+        *
+        * @return string[]
+        */
+       public function getRequiredAvailablePhpModules();
+
+       /**
+        * Returns an array of php-modules, which need to be absent
+        * to activate this check
+        *
+        * Empty array is returned if there are no missing php-modules
+        *
+        * @return string[]
+        */
+       public function getRequiredAbsentPhpModules();
+
+       /**
+        * Returns an array of Extensions which are required by this check.
+        *
+        * The array may either contain the extension-key as array key while a
+        * a version-range (x.x.x-y.y.y)is provided as value or only the extension-key
+        * as value which then will just check for presence of the given extension.
+        *
+        * @return array
+        */
+       public function getRequiredExtensions();
+
+       /**
+        * Returns an array of Extensions which make this check either obsolete,
+        * or this check is incompatible to.
+        *
+        * @return array
+        */
+       public function getConflictingExtensions();
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Interface/ResultAnalyzer.php b/Classes/Domain/Interface/ResultAnalyzer.php
new file mode 100644 (file)
index 0000000..a1474c4
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Interface Tx_Smoothmigration_Domain_Interface_ResultAnalyzer
+ *
+ * @author Michiel Roos
+ */
+interface Tx_Smoothmigration_Domain_Interface_ResultAnalyzer {
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSeverity(Tx_Smoothmigration_Domain_Model_Issue $issue);
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getExplanation(Tx_Smoothmigration_Domain_Model_Issue $issue);
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getSolution(Tx_Smoothmigration_Domain_Model_Issue $issue);
+
+       /**
+        * @param Tx_Smoothmigration_Domain_Model_Issue $issue
+        *
+        * @return string
+        */
+       public function getRawTextForCopyPaste(Tx_Smoothmigration_Domain_Model_Issue $issue);
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/Deprecation.php b/Classes/Domain/Model/Deprecation.php
new file mode 100644 (file)
index 0000000..5c9bc00
--- /dev/null
@@ -0,0 +1,226 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Domain_Model_Deprecation
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Domain_Model_Deprecation extends Tx_Extbase_DomainObject_AbstractEntity {
+
+       /**
+        * @var string
+        */
+       protected $file;
+
+       /**
+        * @var string
+        */
+       protected $class;
+
+       /**
+        * @var string
+        */
+       protected $insterface;
+
+       /**
+        * @var string
+        */
+       protected $method;
+
+       /**
+        * @var string
+        */
+       protected $message;
+
+       /**
+        * @var integer
+        */
+       protected $isStatic;
+
+       /**
+        * @var string
+        */
+       protected $visibility;
+
+       /**
+        * @var string
+        */
+       protected $deprecatedSinceVersion;
+
+       /**
+        * @var string
+        */
+       protected $removedInVersion;
+
+       /**
+        * @var string
+        */
+       protected $replacementClass;
+
+       /**
+        * @var string
+        */
+       protected $replacementInterface;
+
+       /**
+        * @var string
+        */
+       protected $replacementMethod;
+
+       /**
+        * @var string
+        */
+       protected $regexSearch;
+
+       /**
+        * @var string
+        */
+       protected $regexReplace;
+
+       /**
+        * @var integer
+        */
+       protected $noBrainer;
+
+       /**
+        * @var string
+        */
+       protected $replacementMessage;
+
+       /**
+        * @return string
+        */
+       public function getClass() {
+               return $this->class;
+       }
+
+       /**
+        * @return string
+        */
+       public function getDeprecatedSinceVersion() {
+               return $this->deprecatedSinceVersion;
+       }
+
+       /**
+        * @return string
+        */
+       public function getFile() {
+               return $this->file;
+       }
+
+       /**
+        * @return string
+        */
+       public function getInsterface() {
+               return $this->insterface;
+       }
+
+       /**
+        * @return int
+        */
+       public function getIsStatic() {
+               return $this->isStatic;
+       }
+
+       /**
+        * @return string
+        */
+       public function getMessage() {
+               return $this->message;
+       }
+
+       /**
+        * @return string
+        */
+       public function getMethod() {
+               return $this->method;
+       }
+
+       /**
+        * @return int
+        */
+       public function getNoBrainer() {
+               return $this->noBrainer;
+       }
+
+       /**
+        * @return string
+        */
+       public function getRemovedInVersion() {
+               return $this->removedInVersion;
+       }
+
+       /**
+        * @return string
+        */
+       public function getReplacementClass() {
+               return $this->replacementClass;
+       }
+
+       /**
+        * @return string
+        */
+       public function getReplacementInterface() {
+               return $this->replacementInterface;
+       }
+
+       /**
+        * @return string
+        */
+       public function getReplacementMethod() {
+               return $this->replacementMethod;
+       }
+
+       /**
+        * @return string
+        */
+       public function getRegexSearch() {
+               return $this->regexSearch;
+       }
+
+       /**
+        * @return string
+        */
+       public function getRegexReplace() {
+               return $this->regexReplace;
+       }
+
+       /**
+        * @return string
+        */
+       public function getReplacementMessage() {
+               return $this->replacementMessage;
+       }
+
+       /**
+        * @return string
+        */
+       public function getVisibility() {
+               return $this->visibility;
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/Issue.php b/Classes/Domain/Model/Issue.php
new file mode 100644 (file)
index 0000000..1900157
--- /dev/null
@@ -0,0 +1,218 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the
+ * license from the author is found in LICENSE.txt distributed with these
+ * scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Domain_Model_Issue
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Domain_Model_Issue extends Tx_Extbase_DomainObject_AbstractEntity {
+
+       /**
+        * @var string
+        */
+       protected $inspection;
+
+       /**
+        * @var string
+        */
+       protected $identifier;
+
+       /**
+        * @var string
+        */
+       protected $extension;
+
+       /**
+        * @var Tx_Smoothmigration_Domain_Interface_IssueLocation
+        */
+       protected $location;
+
+       /**
+        * @var array
+        */
+       protected $additionalInformation = array();
+
+       /**
+        * @var string
+        */
+       protected $additionalInfo;
+
+       /**
+        * @var string
+        */
+       protected $locationInfo = 'Test';
+
+       /**
+        * @var integer
+        */
+       protected $migrationStatus;
+
+       /**
+        * @param string $checkIdentifier
+        * @param Tx_Smoothmigration_Domain_Interface_IssueLocation $issueDetails
+        */
+       public function __construct($checkIdentifier, Tx_Smoothmigration_Domain_Interface_IssueLocation $issueDetails) {
+               $this->setLocation($issueDetails);
+               $this->inspection = $checkIdentifier;
+       }
+
+       public function initializeObject() {
+               $this->additionalInformation = unserialize($this->additionalInfo);
+               $this->location = unserialize($this->locationInfo);
+       }
+
+       /**
+        * @return string
+        */
+       public function getIdentifier() {
+               return $this->identifier;
+       }
+
+       /**
+        * @return string
+        */
+       public function getInspection() {
+               return $this->inspection;
+       }
+
+       /**
+        * @param \Tx_Smoothmigration_Domain_Interface_IssueLocation $details
+        *
+        * @return void
+        */
+       public function setLocation($details) {
+               $this->location = $details;
+               $this->extension = $details->getExtension();
+               $this->identifier = $this->location->createIssueIdentifier();
+               $this->locationInfo = serialize($details);
+       }
+
+       /**
+        * @return \Tx_Smoothmigration_Domain_Interface_IssueLocation
+        */
+       public function getLocation() {
+               if ($this->location == NULL && $this->locationInfo !== NULL) {
+                       $this->location = unserialize($this->locationInfo);
+               }
+
+               return $this->location;
+       }
+
+       /**
+        * @param array $additionalInformation
+        *
+        * @return void
+        */
+       public function setAdditionalInformation(array $additionalInformation) {
+               $this->additionalInformation = $additionalInformation;
+               $this->additionalInfo = serialize($additionalInformation);
+       }
+
+       /**
+        * @return array
+        */
+       public function getAdditionalInformation() {
+               if ($this->additionalInformation == NULL && $this->additionalInfo !== NULL) {
+                       $this->additionalInformation = unserialize($this->additionalInfo);
+               }
+
+               return $this->additionalInformation;
+       }
+
+       /**
+        * sets the Extension
+        *
+        * @param string $extension
+        *
+        * @return void
+        */
+       public function setExtension($extension) {
+               $this->extension = $extension;
+       }
+
+       /**
+        * get the Extension
+        *
+        * @return string
+        */
+       public function getExtension() {
+               return $this->extension;
+       }
+
+       /**
+        * @param string $additionalInfo
+        */
+       public function setAdditionalInfo($additionalInfo) {
+               $this->additionalInfo = $additionalInfo;
+               $this->setAdditionalInformation(unserialize($additionalInfo));
+       }
+
+       /**
+        * @return string
+        */
+       public function getAdditionalInfo() {
+               return $this->additionalInfo;
+       }
+
+       /**
+        * @param string $locationInfo
+        */
+       public function setLocationInfo($locationInfo) {
+               $this->locationInfo = $locationInfo;
+               $this->setLocation(unserialize($locationInfo));
+       }
+
+       /**
+        * @return string
+        */
+       public function getLocationInfo() {
+               return $this->locationInfo;
+       }
+
+       /**
+        * Get the migration status
+        *
+        * @return integer
+        */
+       public function getMigrationStatus() {
+               return $this->migrationStatus;
+       }
+
+       /**
+        * Set the migration status
+        *
+        * @param integer $migrationStatus
+        *
+        * @return void
+        */
+       public function setMigrationStatus($migrationStatus) {
+               $this->migrationStatus = $migrationStatus;
+       }
+
+}
diff --git a/Classes/Domain/Model/IssueLocation/Configuration.php b/Classes/Domain/Model/IssueLocation/Configuration.php
new file mode 100644 (file)
index 0000000..9057a02
--- /dev/null
@@ -0,0 +1,168 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Domain_Interface_CheckProcessor
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Domain_Model_IssueLocation_Configuration implements Tx_Smoothmigration_Domain_Interface_IssueLocation {
+
+
+       const TYPE_TCA = 1;
+       const TYPE_PHP = 2;
+       const TYPE_TYPOSCRIPT = 4;
+       const TYPE_PAGETS = 8;
+       const TYPE_EXTENSIONCONFIGURATION = 16;
+       const TYPE_DATABASE = 32;
+       const TYPE_DATABASESERVER = 46;
+
+       /**
+        * @var integer
+        */
+       protected $type;
+
+       /**
+        * @var string
+        */
+       protected $path;
+
+       /**
+        * @var mixed
+        */
+       protected $currentValue;
+
+       /**
+        * @var Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation
+        */
+       protected $physicalLocation;
+
+       /**
+        * Creates ID which identifies the occurence of that issue
+        *
+        * @return string
+        */
+       public function createIssueIdentifier() {
+               return md5($this->type . '-' . $this->path) .
+                       ($this->physicalLocation !== NULL ? $this->physicalLocation->createIssueIdentifier() : '');
+       }
+
+       /**
+        * @param integer $type
+        * @param string $path
+        * @param string $currentValue
+        * @param Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation $location
+        */
+       public function __construct($type, $path, $currentValue = '', Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation $location = NULL) {
+               $this->type = $type;
+               $this->path = $path;
+               $this->currentValue = $currentValue;
+               $this->physicalLocation = $location;
+       }
+
+       /**
+        * @param mixed $currentValue
+        *
+        * @return void
+        */
+       public function setCurrentValue($currentValue) {
+               $this->currentValue = $currentValue;
+       }
+
+       /**
+        * @return mixed
+        */
+       public function getCurrentValue() {
+               return $this->currentValue;
+       }
+
+       /**
+        * @param string $path
+        *
+        * @return void
+        */
+       public function setPath($path) {
+               $this->path = $path;
+       }
+
+       /**
+        * @return string
+        */
+       public function getPath() {
+               return $this->path;
+       }
+
+       /**
+        * @param \Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation $physicalLocation
+        *
+        * @return void
+        */
+       public function setPhysicalLocation(Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation $physicalLocation) {
+               $this->physicalLocation = $physicalLocation;
+       }
+
+       /**
+        * @return \Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation
+        */
+       public function getPhysicalLocation() {
+               return $this->physicalLocation;
+       }
+
+       /**
+        * @param int $type
+        *
+        * @return void
+        */
+       public function setType($type) {
+               $this->type = $type;
+       }
+
+       /**
+        * @return int
+        */
+       public function getType() {
+               return $this->type;
+       }
+
+       /**
+        * Developers want to group by Extension/not by test,
+        * implement that later
+        *
+        * @return string|NULL
+        */
+       public function getExtension() {
+               if ($this->physicalLocation !== NULL) {
+                       return $this->physicalLocation->getExtension();
+               } else {
+                       return NULL;
+               }
+       }
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/IssueLocation/Database.php b/Classes/Domain/Model/IssueLocation/Database.php
new file mode 100644 (file)
index 0000000..edad0ef
--- /dev/null
@@ -0,0 +1,151 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Domain_Interface_CheckProcessor
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Domain_Model_IssueLocation_Database extends Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation {
+
+       /**
+        * @var string
+        */
+       protected $database;
+
+       /**
+        * @var string
+        */
+       protected $table;
+
+       /**
+        * @var integer
+        */
+       protected $record;
+
+       /**
+        * @var string
+        */
+       protected $field;
+
+       /**
+        * Creates ID which identifies the occurence of that issue
+        *
+        * @return string
+        */
+       public function createIssueIdentifier() {
+               return $this->database . ':' . $this->table . ':' . $this->record . ':' . $this->field;
+       }
+
+       /**
+        * @param string $database
+        * @param string $table
+        * @param integer $recordUid
+        * @param string $field
+        */
+       public function __construct($database, $table = NULL, $recordUid = NULL, $field = NULL) {
+               $this->database = $database;
+               $this->table = $table;
+               $this->record = $recordUid;
+               $this->field = $field;
+       }
+
+       /**
+        *
+        * @return string|NULL
+        */
+       public function getExtension() {
+               return 'Database: ' . $this->getDatabase();
+       }
+
+       /**
+        * @param string $field
+        * @return $this to allow for chaining
+        */
+       public function setField($field) {
+               $this->field = $field;
+               return $this;
+       }
+
+       /**
+        * @return string
+        */
+       public function getField() {
+               return $this->field;
+       }
+
+       /**
+        * @param int $record
+        * @return $this to allow for chaining
+        */
+       public function setRecord($record) {
+               $this->record = $record;
+               return $this;
+       }
+
+       /**
+        * @return int
+        */
+       public function getRecord() {
+               return $this->record;
+       }
+
+       /**
+        * @param string $table
+        * @return $this to allow for chaining
+        */
+       public function setTable($table) {
+               $this->table = $table;
+               return $this;
+       }
+
+       /**
+        * @return string
+        */
+       public function getTable() {
+               return $this->table;
+       }
+
+       /**
+        * @param string $database
+        * @return $this to allow for chaining
+        */
+       public function setDatabase($database) {
+               $this->database = $database;
+               return $this;
+       }
+
+       /**
+        * @return string
+        */
+       public function getDatabase() {
+               return $this->database;
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/IssueLocation/Extension.php b/Classes/Domain/Model/IssueLocation/Extension.php
new file mode 100644 (file)
index 0000000..df0c362
--- /dev/null
@@ -0,0 +1,134 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * Class Tx_Smoothmigration_Domain_Model_IssueLocation_Extension
+ *
+ * @author Michiel Roos
+ */
+class Tx_Smoothmigration_Domain_Model_IssueLocation_Extension
+       extends Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation {
+
+       /**
+        * Extension Name
+        *
+        * @var string
+        */
+       protected $extensionName = '';
+
+       /**
+        * Minimum version
+        *
+        * @var string
+        */
+       protected $minimumVersion = '';
+
+       /**
+        * Maximum version
+        *
+        * @var string
+        */
+       protected $maximumVersion = '';
+
+       /**
+        * @param string $extension
+        * @param string $minimumVersion
+        * @param string $maximumVersion
+        */
+       public function __construct($extension, $minimumVersion = '0.0.0', $maximumVersion = '0.0.0') {
+               $this->extensionName = $extension;
+               $this->minimumVersion = $minimumVersion;
+               $this->maximumVersion = $maximumVersion;
+       }
+
+       /**
+        * Creates ID which identifies the occurence of that issue
+        *
+        * @return string
+        */
+       public function createIssueIdentifier() {
+               return md5($this->extensionName . '/' . $this->minimumVersion . '-' . $this->maximumVersion);
+       }
+
+       /**
+        *
+        * @return string
+        */
+       public function getExtension() {
+               return $this->getExtensionName();
+       }
+
+       /**
+        * @param string $extensionName
+        *
+        * @return $this to allow for chaining
+        */
+       public function setExtensionName($extensionName) {
+               $this->extensionName = $extensionName;
+               return $this;
+       }
+
+       /**
+        * @return string
+        */
+       public function getExtensionName() {
+               return $this->extensionName;
+       }
+
+       /**
+        * @param string $maximumVersion
+        *
+        * @return $this to allow for chaining
+        */
+       public function setMaximumVersion($maximumVersion) {
+               $this->maximumVersion = $maximumVersion;
+               return $this;
+       }
+
+       /**
+        * @return string
+        */
+       public function getMaximumVersion() {
+               return $this->maximumVersion;
+       }
+
+       /**
+        * @param string $minimumVersion
+        *
+        * @return $this to allow for chaining
+        */
+       public function setMinimumVersion($minimumVersion) {
+               $this->minimumVersion = $minimumVersion;
+               return $this;
+       }
+
+       /**
+        * @return string
+        */
+       public function getMinimumVersion() {
+               return $this->minimumVersion;
+       }
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/IssueLocation/File.php b/Classes/Domain/Model/IssueLocation/File.php
new file mode 100644 (file)
index 0000000..2bc7c4c
--- /dev/null
@@ -0,0 +1,162 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Domain_Interface_CheckProcessor
+ *
+ * @author Steffen Ritter
+ */
+class Tx_Smoothmigration_Domain_Model_IssueLocation_File extends Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation {
+
+       /**
+        * Extension Name file is located
+        * __ROOT for relative PATH_site
+        *
+        * @var string
+        */
+       protected $extensionName = '__ROOT';
+
+       /**
+        * Path relative to extension or __ROOT
+        *
+        * @var string
+        */
+       protected $filePath;
+
+       /**
+        * Line number the issue has been found in
+        *
+        * @var integer
+        */
+       protected $lineNumber;
+
+       /**
+        * The string found on the given line causing the issue
+        *
+        * @var string
+        */
+       protected $matchedString;
+
+       /**
+        * @param string $extension
+        * @param string $path
+        * @param integer $lineNumber
+        * @param string $matchedString
+        */
+       public function __construct($extension, $path, $lineNumber = -1, $matchedString = '') {
+               $this->extensionName = $extension;
+               $this->filePath = $path;
+               $this->lineNumber = $lineNumber;
+               $this->matchedString = $matchedString;
+       }
+
+       /**
+        * Creates ID which identifies the occurence of that issue
+        *
+        * @return string
+        */
+       public function createIssueIdentifier() {
+               return md5($this->extensionName . '/' . $this->filePath . '-' . $this->lineNumber);
+       }
+
+       /**
+        * @param string $extensionName
+        *
+        * @return void
+        */
+       public function setExtensionName($extensionName) {
+               $this->extensionName = $extensionName;
+       }
+
+       /**
+        * @return string
+        */
+       public function getExtensionName() {
+               return $this->extensionName;
+       }
+
+       /**
+        * @param string $filePath
+        *
+        * @return void
+        */
+       public function setFilePath($filePath) {
+               $this->filePath = $filePath;
+       }
+
+       /**
+        * @return string
+        */
+       public function getFilePath() {
+               return $this->filePath;
+       }
+
+       /**
+        * @param int $lineNumber
+        *
+        * @return void
+        */
+       public function setLineNumber($lineNumber) {
+               $this->lineNumber = $lineNumber;
+       }
+
+       /**
+        * @return int
+        */
+       public function getLineNumber() {
+               return $this->lineNumber;
+       }
+
+       /**
+        *
+        * @return string|NULL
+        */
+       public function getExtension() {
+               return $this->getExtensionName() == '__ROOT' ? NULL : $this->getExtensionName();
+       }
+
+       /**
+        * Get the matched string
+        *
+        * @return string
+        */
+       public function getMatchedString() {
+               return $this->matchedString;
+       }
+
+       /**
+        * Set the matches string
+        *
+        * @param string $matchedString
+        * @return void
+        */
+       public function setMatchedString($matchedString) {
+               $this->matchedString = $matchedString;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Model/IssueLocation/PhysicalLocation.php b/Classes/Domain/Model/IssueLocation/PhysicalLocation.php
new file mode 100644 (file)
index 0000000..1c4bd08
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems <steffen.ritter@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Domain_Interface_CheckProcessor
+ *
+ * @author Steffen Ritter
+ */
+abstract class Tx_Smoothmigration_Domain_Model_IssueLocation_PhysicalLocation implements Tx_Smoothmigration_Domain_Interface_IssueLocation {
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/Classes/Domain/Repository/DeprecationRepository.php b/Classes/Domain/Repository/DeprecationRepository.php
new file mode 100644 (file)
index 0000000..84d862d
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/**
+ *  Copyright notice
+ *
+ *  ⓒ 2014 Michiel Roos <michiel@maxserv.nl>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is free
+ *  software; you can redistribute it and/or modify it under the terms of the
+ *  GNU General Public License as published by the Free Software Foundation;
+ *  either version 2 of the License, or (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ *  more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ */
+
+/**
+ * A Deprecation Repository
+ *
+ */
+class Tx_Smoothmigration_Domain_Repository_DeprecationRepository extends Tx_Extbase_Persistence_Repository {
+
+       /**
+        * Find replacements by Class and Method
+        *
+        * @param $class
+        * @param $method
+        * @return \Tx_Smoothmigration_Domain_Model_Deprecation
+        */
+       public function findOneStaticByClassAndMethod($class, $method) {
+               $result = NULL;
+               $query = $this->createQuery();
+               $queryResult = $query->matching(
+                       $query->logicalAnd(
+                               $query->equals('class', $class),
+                               $query->equals('method', $method),
+                               $query->equals('isStatic', TRUE)
+                       )
+               )->execute();
+               if ($queryResult instanceof Tx_Extbase_Persistence_QueryResultInterface) {
+                       $result = $queryResult->getFirst();
+               } elseif (is_array($queryResult)) {
+                       $result = isset($queryResult[0]) ? $queryResult[0] : NULL;
+               }
+               return $result;
+       }
+}
diff --git a/Classes/Domain/Repository/IssueRepository.php b/Classes/Domain/Repository/IssueRepository.php
new file mode 100644 (file)
index 0000000..23437a2
--- /dev/null
@@ -0,0 +1,219 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Anja Leichsenring <anja.leichsenring@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * An Issue Repository
+ *
+ */
+class Tx_Smoothmigration_Domain_Repository_IssueRepository extends Tx_Extbase_Persistence_Repository {
+
+       /**
+        * Find all grouped by inspection
+        *
+        * @param array $checks The checks to find inspections for
+        *
+        * @return array
+        */
+       public function findAllGroupedByInspection($checks) {
+               $issues = $this->findAll();
+               $groups = array();
+               /** @var Tx_Smoothmigration_Checks_AbstractCheckDefinition $check */
+               foreach ($checks as $check) {
+                       $groups[$check->getIdentifier()] = array();
+               }
+               /** @var Tx_Smoothmigration_Domain_Model_Issue $issue */
+               foreach ($issues as $issue) {
+                       if (!array_key_exists($issue->getInspection(), $groups)) {
+                               $groups[$issue->getInspection()] = array();
+                       }
+                       $groups[$issue->getInspection()][] = $issue;
+               }
+
+               // 4 -> SORT_NATURAL
+               ksort($groups, 4);
+
+               return $groups;
+       }
+
+       /**
+        * Find all issues by inspection and extensionkey
+        *
+        * @param string $inspection
+        * @param string $extensionKey
+        *
+        * @return array
+        */
+       public function findByInspectionAndExtensionKey($inspection, $extensionKey) {
+               $query = $this->createQuery();
+
+               return $query->matching(
+                       $query->logicalAnd(
+                               $query->equals('inspection', $inspection),
+                               $query->equals('extension', $extensionKey)
+                       )
+               )->execute();
+       }
+
+       /**
+        * Find all pending issues grouped by inspection
+        *
+        * @param string $inspection
+        *
+        * @return array
+        */
+       public function findPendingByInspection($inspection) {
+               $query = $this->createQuery();
+
+               return $query->matching(
+                       $query->logicalAnd(
+                               $query->equals('inspection', $inspection),
+                               $query->logicalNot(
+                                       $query->equals('migrationStatus', Tx_Smoothmigration_Domain_Interface_Migration::SUCCESS)
+                               )
+                       )
+               )->execute();
+       }
+
+       /**
+        * Find all pending issues grouped by inspection
+        *
+        * @param string $inspection
+        * @param string $extensionKey
+        *
+        * @return array
+        */
+       public function findPendingByInspectionAndExtensionKey($inspection, $extensionKey) {
+               $query = $this->createQuery();
+
+               return $query->matching(
+                       $query->logicalAnd(
+                               $query->equals('inspection', $inspection),
+                               $query->equals('extension', $extensionKey),
+                               $query->logicalNot(
+                                       $query->equals('migrationStatus', Tx_Smoothmigration_Domain_Interface_Migration::SUCCESS)
+                               )
+                       )
+               )->execute();
+       }
+
+       /**
+        * Find all grouped by extension and inspection
+        *
+        * @return array
+        */
+       public function findAllGroupedByExtensionAndInspection() {
+               $issues = $this->findAll();
+               $groups = array();
+               /** @var Tx_Smoothmigration_Domain_Model_Issue $issue */
+               foreach ($issues as $issue) {
+                       if (!array_key_exists($issue->getExtension(), $groups)) {
+                               $groups[$issue->getExtension()] = array();
+                       }
+                       if (!array_key_exists($issue->getInspection(), $groups[$issue->getExtension()])) {
+                               $groups[$issue->getExtension()][$issue->getInspection()] = array();
+                       }
+                       $groups[$issue->getExtension()][$issue->getInspection()][] = $issue;
+               }
+
+               // 4 -> SORT_NATURAL
+               ksort($groups, 4);
+
+               return $groups;
+       }
+
+       /**
+        * Find by extension and group by inspection
+        *
+        * @param string $extensionKey
+        *
+        * @return array
+        */
+       public function findByExtensionGroupedByInspection($extensionKey = '') {
+               $issues = $this->findByExtension($extensionKey);
+               $groups = array();
+               /** @var Tx_Smoothmigration_Domain_Model_Issue $issue */
+               foreach ($issues as $issue) {
+                       if (!array_key_exists($issue->getExtension(), $groups)) {
+                               $groups[$issue->getExtension()] = array();
+                       }
+                       if (!array_key_exists($issue->getInspection(), $groups[$issue->getExtension()])) {
+                               $groups[$issue->getExtension()][$issue->getInspection()] = array();
+                       }
+                       $groups[$issue->getExtension()][$issue->getInspection()][] = $issue;
+               }
+
+               // 4 -> SORT_NATURAL
+               ksort($groups, 4);
+
+               return $groups;
+       }
+
+       /**
+        * Add an issue
+        *
+        * @param Tx_Smoothmigration_Domain_Model_Issue $object
+        *
+        * @return void
+        */
+       public function add($object) {
+               if ($GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
+                               '*',
+                               'tx_smoothmigration_domain_model_issue',
+                               'inspection = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($object->getInspection(), 'tx_smoothmigration_domain_model_issue') .
+                               ' AND identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($object->getIdentifier(), 'tx_smoothmigration_domain_model_issue')
+                       ) == 0
+               ) {
+                       parent::add($object);
+               }
+       }
+
+       /**
+        * Delete all by inspection
+        *
+        * @param string $inspection
+        *
+        * @return int   $issueCount   count of how many entries were deleted, -1
+        *    on error
+        */
+       public function deleteAllByInspection($inspection) {
+               $issueCount =
+                       $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
+                               '*',
+                               'tx_smoothmigration_domain_model_issue',
+                               'inspection = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($inspection, 'tx_smoothmigration_domain_model_issue')
+                       );
+               if ($issueCount > 0) {
+                       if (!$GLOBALS['TYPO3_DB']->exec_DELETEquery(
+                               'tx_smoothmigration_domain_model_issue',
+                               'inspection = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($inspection, 'tx_smoothmigration_domain_model_issue')
+                       )
+                       ) {
+                               return -1;
+                       }
+               }
+
+               return $issueCount;
+       }
+
+}
diff --git a/Classes/Migrations/AbstractMigrationDefinition.php b/Classes/Migrations/AbstractMigrationDefinition.php
new file mode 100644 (file)
index 0000000..9914385
--- /dev/null
@@ -0,0 +1,195 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Steffen Ritter, rs websystems (steffen.ritter@typo3.org)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Class Tx_Smoothmigration_Migrations_AbstractMigrationDefinition
+ *
+ * @author Steffen Ritter
+ */
+abstract class Tx_Smoothmigration_Migrations_AbstractMigrationDefinition implements Tx_Smoothmigration_Domain_Interface_Migration {
+
+       /**
+        *
+        * @var Tx_Extbase_Object_ObjectManager
+        */
+       protected $objectManager;
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               if (t3lib_div::int_from_ver(TYPO3_version) < 6001000) {
+                       $this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+               } else {
+                       $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\CMS\Extbase\Object\ObjectManager');
+               }
+       }
+
+       /**
+        * Returns the name of the migration
+        *
+        * @return string
+        */
+       public function getTitle() {
+               return $this->getLanguageLabelForMigration('title');
+       }
+
+       /**
+        * Returns a string which describes the migration in one sentence.
+        *
+        * @return string
+        */
+       public function getShortDescription() {
+               return $this->getLanguageLabelForMigration('shortDescription');
+       }
+
+       /**
+        * Returns a string which contains an elaborate description
+        * of what the migration does.
+        *
+        * @return string
+        */
+       public function getDescription() {
+               return $this->getLanguageLabelForMigration('description');
+       }
+
+       /**
+        * Returns the Type of the Migration
+        * One of the Constants Defined in that interface
+        *
+        * @return int
+        */
+       public function getType() {
+               return Tx_Smoothmigration_Domain_Interface_MigrationDescription::TYPE_PHP_CODE;
+       }
+
+       /**
+        * Return the minimum TYPO3 Version the migrations needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMinimalTypo3Version() {
+               return '';
+       }
+
+       /**
+        * Return the maximal TYPO3 Version the migrations needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMaximalTypo3Version() {
+               return '';
+       }
+
+       /**
+        * Return the minimum PHP Version the migrations needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMinimalPhpVersion() {
+               return '';
+       }
+
+       /**
+        * Return the maximal PHP Version the migrations needs to be executed on.
+        *
+        * @return string
+        */
+       public function getMaximalPhpVersion() {
+               return '';
+       }
+
+       /**
+        * Returns an array of php-modules, which need to be available
+       &nb