*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
/**
* Upgrade wizard which goes through all files referenced in the tt_content.image filed
* and creates sys_file records as well as sys_file_reference records for the individual usages.
*
* @author Ingmar Schlecht <ingmar@typo3.org>
- * @license http://www.gnu.org/copyleft/gpl.html
- */
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Updates TCEform references from direct file relations to FAL.
*/
-class TceformsUpdateWizard extends \TYPO3\CMS\Install\Updates\AbstractUpdate {
+class TceformsUpdateWizard extends AbstractUpdate {
/**
* @var string
*/
protected $logger;
+ /**
+ * Constructor
+ */
public function __construct() {
/** @var $logManager \TYPO3\CMS\Core\Log\LogManager */
$logManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Log\\LogManager');
/**
* Checks if an update is needed
*
- * @param string &$description: The description for the update
- * @return boolean TRUE if an update is needed, FALSE otherwise
+ * @param string &$description The description for the update
+ * @return boolean TRUE if an update is needed, FALSE otherwise
*/
public function checkForUpdate(&$description) {
$description = 'This update wizard goes through all files that are referenced in the tt_content.image and pages.media / pages_language_overlay.media filed and adds the files to the new File Index.<br />It also moves the files from uploads/ to the fileadmin/_migrated/ path.<br /><br />This update wizard can be called multiple times in case it didn\'t finish after running once.';
- // make this wizard always available
+ // Make this wizard always available
return TRUE;
}
/**
* Performs the database update.
*
- * @param array &$dbQueries: queries done in this update
- * @param mixed &$customMessages: custom messages
- * @return boolean TRUE on success, FALSE on error
+ * @param array &$dbQueries Queries done in this update
+ * @param mixed &$customMessages Custom messages
+ * @return boolean TRUE on success, FALSE on error
*/
public function performUpdate(array &$dbQueries, &$customMessages) {
$this->init();
- // Function below copied from sysext/install/updates/class.tx_coreupdates_imagelink.php
$tables = array(
'tt_content' => array(
'image' => array(
return $result;
}
+ /**
+ * Get records from table
+ *
+ * @param string $table
+ * @param array $relationFields
+ * @return array
+ */
protected function getRecordsFromTable($table, $relationFields) {
$fields = implode(',', array_merge($relationFields, array('uid', 'pid')));
$records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $table, '');
}
-
?>
\ No newline at end of file