[BUGFIX] Warning: Ambiguous class resolution 55/43955/3
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 9 Oct 2015 21:04:20 +0000 (17:04 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 9 Oct 2015 21:18:29 +0000 (23:18 +0200)
Namespace the ext_update class definitions.

Resolves: #70541
Change-Id: I73591aa55d3b3d1d78d0e869c55f218f2329eccc
Reviewed-on: http://review.typo3.org/43955
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
ChangeLog
Resources/Private/LanguagePackTemplate/class.ext_update.code [new file with mode: 0644]
Resources/Private/LanguagePackTemplate/class.ext_update.php [deleted file]
class.ext_update.php

index 3a2ae70..60be244 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-10-09  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Resolves #70541: Warning: Ambiguous class resolution, because of two ext_update definitions
+
 2015-10-01  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Resolves #59834: Always run the extension update script except on first install of base extension
diff --git a/Resources/Private/LanguagePackTemplate/class.ext_update.code b/Resources/Private/LanguagePackTemplate/class.ext_update.code
new file mode 100644 (file)
index 0000000..51fdec7
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+namespace SJBR\StaticInfoTables###LANG_ISO_CAMEL###;
+
+/*
+ *  Copyright notice
+ *
+ *  (c) 2013-2015 Stanislas Rolland <typo3(arobas)sjbr.ca>
+ *  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!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
+
+/**
+ * Class for updating the db
+ */
+class ext_update
+{
+       /**
+        * Main function, returning the HTML content
+        *
+        * @return string HTML
+        */
+       public function main()
+       {
+               $content = '';
+               $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+
+               // Clear the class cache
+               $classCacheManager = $objectManager->get('SJBR\\StaticInfoTables\\Cache\\ClassCacheManager');
+               $classCacheManager->reBuild();
+
+               // Update the database
+               $databaseUpdateUtility = $objectManager->get('SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility');
+               $databaseUpdateUtility->doUpdate('static_info_tables_###LANG_ISO_LOWER###');
+
+               $content.= '<p>' . LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables') . ' static_info_tables_###LANG_ISO_LOWER###.</p>';
+               return $content;
+       }
+
+       public function access()
+       {
+               return true;
+       }
+}
\ No newline at end of file
diff --git a/Resources/Private/LanguagePackTemplate/class.ext_update.php b/Resources/Private/LanguagePackTemplate/class.ext_update.php
deleted file mode 100644 (file)
index a3db4e9..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2013 Stanislas Rolland <typo3(arobas)sjbr.ca>
-*  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 for updating the db
- */
-class ext_update {
-       /**
-        * Main function, returning the HTML content
-        *
-        * @return string HTML
-        */
-       function main() {
-               $content = '';
-               $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-
-               // Clear the class cache
-               $classCacheManager = $objectManager->get('SJBR\\StaticInfoTables\\Cache\\ClassCacheManager');
-               $classCacheManager->reBuild();
-
-               // Update the database
-               $databaseUpdateUtility = $objectManager->get('SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility');
-               $databaseUpdateUtility->doUpdate('static_info_tables_###LANG_ISO_LOWER###');
-               
-               $content.= '<p>' . \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables') . ' static_info_tables_###LANG_ISO_LOWER###.</p>';
-               return $content;
-       }
-
-       function access() {
-               return true;
-       }
-}
-?>
\ No newline at end of file
index 7f8fe41..a43f35c 100644 (file)
@@ -1,5 +1,7 @@
 <?php
- /***************************************************************
+namespace SJBR\StaticInfoTables;
+
+/*
  *  Copyright notice
  *
  *  (c) 2013-2015 Stanislas Rolland <typo3(arobas)sjbr.ca>
@@ -20,7 +22,7 @@
  *  GNU General Public License for more details.
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
+ */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
@@ -29,7 +31,8 @@ use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 /**
  * Class for updating the db
  */
-class ext_update {
+class ext_update
+{
        /**
         * @var string Name of the extension this controller belongs to
         */
@@ -50,7 +53,8 @@ class ext_update {
         *
         * @return string HTML
         */
-       public function main() {
+       public function main()
+       {
                $content = '';
 
                $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
@@ -94,7 +98,8 @@ class ext_update {
         * @param string $extensionKey
         * @return void
         */
-       protected function processDatabaseUpdates($extensionKey) {
+       protected function processDatabaseUpdates($extensionKey)
+       {
                $extensionSitePath = ExtensionManagementUtility::extPath($extensionKey);
                $extTablesSqlFile = $extensionSitePath . 'ext_tables.sql';
                $extTablesSqlContent = '';
@@ -112,7 +117,8 @@ class ext_update {
         * @param string $extensionSitePath
         * @return void
         */
-       protected function importStaticSqlFile($extensionSitePath) {
+       protected function importStaticSqlFile($extensionSitePath)
+       {
                $extTablesStaticSqlFile = $extensionSitePath . 'ext_tables_static+adt.sql';
                $extTablesStaticSqlContent = '';
                if (file_exists($extTablesStaticSqlFile)) {
@@ -123,7 +129,8 @@ class ext_update {
                }
        }
 
-       public function access() {
-               return TRUE;
+       public function access()
+       {
+               return true;
        }
 }
\ No newline at end of file