@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if( ! defined( 'TYPO3_MODE' ) ) { |
|
| 3 | +if( !defined( 'TYPO3_MODE' ) ) { |
|
| 4 | 4 | die ( 'Access denied.' ); |
| 5 | 5 | } |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'TYPO3_MODE' ) ) { |
|
| 3 | +if( !defined( 'TYPO3_MODE' ) ) { |
|
| 4 | 4 | die ( 'Access denied.' ); |
| 5 | 5 | } |
| 6 | 6 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | ->setMethods( array( 'getFields' ) )->getMock(); |
| 61 | 61 | |
| 62 | 62 | $mock->expects( $this->once() )->method( 'getFields' ) |
| 63 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
| 63 | + ->will( $this->throwException( new \RuntimeException() ) ); |
|
| 64 | 64 | |
| 65 | 65 | $result = $mock->getAdditionalFields( $taskInfo, $mock, $module ); |
| 66 | 66 | |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | ->setMethods( array( 'getFields' ) )->getMock(); |
| 57 | 57 | |
| 58 | 58 | $mock->expects( $this->once() )->method( 'getFields' ) |
| 59 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
| 59 | + ->will( $this->throwException( new \RuntimeException() ) ); |
|
| 60 | 60 | |
| 61 | 61 | $result = $mock->getAdditionalFields( $taskInfo, $mock, $module ); |
| 62 | 62 | |
@@ -208,7 +208,7 @@ |
||
| 208 | 208 | $string = '<option value="%1$s" %2$s %3$s>%4$s</option>'; |
| 209 | 209 | $html .= sprintf( $string, $item->getCode(), $active, $disabled, $prefix . $item->getLabel() ); |
| 210 | 210 | |
| 211 | - $html .= $this->getSiteOptions( $item->getChildren(), $selected, $level+1 ); |
|
| 211 | + $html .= $this->getSiteOptions( $item->getChildren(), $selected, $level + 1 ); |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | return $html; |
@@ -37,9 +37,12 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function getAdditionalFields( array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
| 39 | 39 | { |
| 40 | - try { |
|
| 40 | + try |
|
| 41 | + { |
|
| 41 | 42 | return $this->getFields( $taskInfo, $task, $parentObject ); |
| 42 | - } catch( \Exception $e ) { |
|
| 43 | + } |
|
| 44 | + catch( \Exception $e ) |
|
| 45 | + { |
|
| 43 | 46 | $parentObject->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
| 44 | 47 | } |
| 45 | 48 | |
@@ -72,9 +75,12 @@ discard block |
||
| 72 | 75 | */ |
| 73 | 76 | public function validateAdditionalFields( array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
| 74 | 77 | { |
| 75 | - try { |
|
| 78 | + try |
|
| 79 | + { |
|
| 76 | 80 | return $this->validateFields( $submittedData, $parentObject ); |
| 77 | - } catch( \Exception $e ) { |
|
| 81 | + } |
|
| 82 | + catch( \Exception $e ) |
|
| 83 | + { |
|
| 78 | 84 | $parentObject->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
| 79 | 85 | } |
| 80 | 86 | |
@@ -37,9 +37,12 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function getAdditionalFields( array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
| 39 | 39 | { |
| 40 | - try { |
|
| 40 | + try |
|
| 41 | + { |
|
| 41 | 42 | return $this->getFields( $taskInfo, $task, $parentObject ); |
| 42 | - } catch( \Exception $e ) { |
|
| 43 | + } |
|
| 44 | + catch( \Exception $e ) |
|
| 45 | + { |
|
| 43 | 46 | $parentObject->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
| 44 | 47 | } |
| 45 | 48 | |
@@ -72,9 +75,12 @@ discard block |
||
| 72 | 75 | */ |
| 73 | 76 | public function validateAdditionalFields( array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
| 74 | 77 | { |
| 75 | - try { |
|
| 78 | + try |
|
| 79 | + { |
|
| 76 | 80 | return $this->validateFields( $submittedData, $parentObject ); |
| 77 | - } catch( \Exception $e ) { |
|
| 81 | + } |
|
| 82 | + catch( \Exception $e ) |
|
| 83 | + { |
|
| 78 | 84 | $parentObject->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
| 79 | 85 | } |
| 80 | 86 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| 151 | - return ['sqlString' => $sql ]; |
|
| 151 | + return ['sqlString' => $sql]; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $ctx->setCache( new \Aimeos\MW\Cache\None() ); |
| 193 | 193 | |
| 194 | 194 | // Reset before child processes are spawned to avoid lost DB connections afterwards (TYPO3 9.4 and above) |
| 195 | - if ( php_sapi_name() === 'cli' && class_exists( '\TYPO3\CMS\Core\Database\ConnectionPool' ) |
|
| 195 | + if( php_sapi_name() === 'cli' && class_exists( '\TYPO3\CMS\Core\Database\ConnectionPool' ) |
|
| 196 | 196 | && method_exists( '\TYPO3\CMS\Core\Database\ConnectionPool', 'resetConnections' ) ) |
| 197 | 197 | { |
| 198 | 198 | $ctx->setProcess( new \Aimeos\MW\Process\Pcntl( \Aimeos\Aimeos\Base::getExtConfig( 'pcntlMax', 4 ) ) ); |
@@ -70,8 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $object = $objectManager->get( 'TYPO3\CMS\Core\Configuration\ExtensionConfiguration' ); // TYPO3 9 |
| 72 | 72 | $demo = $object->get( 'aimeos', 'useDemoData' ); |
| 73 | - } |
|
| 74 | - else |
|
| 73 | + } else |
|
| 75 | 74 | { |
| 76 | 75 | $object = $objectManager->get( 'TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility' ); // TYPO3 7+8 |
| 77 | 76 | |
@@ -94,8 +93,7 @@ discard block |
||
| 94 | 93 | if( class_exists( '\TYPO3\CMS\Core\Configuration\ExtensionConfiguration' ) ) |
| 95 | 94 | { |
| 96 | 95 | $object->set( 'aimeos', 'useDemoData', '' ); |
| 97 | - } |
|
| 98 | - else |
|
| 96 | + } else |
|
| 99 | 97 | { |
| 100 | 98 | $conf['useDemoData'] = ''; |
| 101 | 99 | $object->writeConfiguration( $conf, 'aimeos' ); |
@@ -200,15 +198,18 @@ discard block |
||
| 200 | 198 | $ctx->setProcess( new \Aimeos\MW\Process\None() ); |
| 201 | 199 | } |
| 202 | 200 | |
| 203 | - if( class_exists( '\TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory' ) ) // TYPO3 9+ |
|
| 201 | + if( class_exists( '\TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory' ) ) { |
|
| 202 | + // TYPO3 9+ |
|
| 204 | 203 | { |
| 205 | 204 | $factory = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory' ); |
| 206 | - $ctx->setHasherTypo3( $factory->getDefaultHashInstance( 'FE' ) ); |
|
| 207 | 205 | } |
| 208 | - elseif( class_exists( '\TYPO3\CMS\Saltedpasswords\Salt\SaltFactory' ) ) // TYPO3 7/8 |
|
| 206 | + $ctx->setHasherTypo3( $factory->getDefaultHashInstance( 'FE' ) ); |
|
| 207 | + } elseif( class_exists( '\TYPO3\CMS\Saltedpasswords\Salt\SaltFactory' ) ) { |
|
| 208 | + // TYPO3 7/8 |
|
| 209 | 209 | { |
| 210 | 210 | $ctx->setHasherTypo3( \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance() ); |
| 211 | 211 | } |
| 212 | + } |
|
| 212 | 213 | |
| 213 | 214 | return $ctx; |
| 214 | 215 | } |
@@ -83,9 +83,12 @@ |
||
| 83 | 83 | { |
| 84 | 84 | $localeManager = \Aimeos\MShop::create( $context, 'locale' ); |
| 85 | 85 | |
| 86 | - try { |
|
| 86 | + try |
|
| 87 | + { |
|
| 87 | 88 | $localeItem = $localeManager->bootstrap( $site, '', '', false, null, true ); |
| 88 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
| 89 | + } |
|
| 90 | + catch( \Aimeos\MShop\Exception $e ) |
|
| 91 | + { |
|
| 89 | 92 | $localeItem = $localeManager->createItem(); |
| 90 | 93 | } |
| 91 | 94 | |