Commit 1182348e authored by Jens Jacobsen's avatar Jens Jacobsen
Browse files

Fix Exception class usage in namespaced class files

parent c54df7ed
Pipeline #945 failed with stages
in 2 minutes and 15 seconds
...@@ -46,7 +46,7 @@ class FileCache implements \TYPO3\CMS\Core\SingletonInterface ...@@ -46,7 +46,7 @@ class FileCache implements \TYPO3\CMS\Core\SingletonInterface
public function setCacheDirectory($cacheDirectory) public function setCacheDirectory($cacheDirectory)
{ {
if (empty($cacheDirectory)) { if (empty($cacheDirectory)) {
throw new Exception('An empty cache directory is not allowed'); throw new \Exception('An empty cache directory is not allowed');
} }
$this->cacheDirectory = \T3o\TerFe2\Utility\File::getAbsoluteDirectory($cacheDirectory); $this->cacheDirectory = \T3o\TerFe2\Utility\File::getAbsoluteDirectory($cacheDirectory);
} }
...@@ -171,7 +171,7 @@ class FileCache implements \TYPO3\CMS\Core\SingletonInterface ...@@ -171,7 +171,7 @@ class FileCache implements \TYPO3\CMS\Core\SingletonInterface
} }
$cacheDirectory = $this->getCacheDirectory(); $cacheDirectory = $this->getCacheDirectory();
if (empty($cacheDirectory)) { if (empty($cacheDirectory)) {
throw new Exception('No cache directory defined'); throw new \Exception('No cache directory defined');
} }
return $cacheDirectory . $filename; return $cacheDirectory . $filename;
} }
......
...@@ -113,7 +113,7 @@ abstract class AbstractTerBasedController extends \T3o\TerFe2\Controller\Abstrac ...@@ -113,7 +113,7 @@ abstract class AbstractTerBasedController extends \T3o\TerFe2\Controller\Abstrac
{ {
// Check the wsdl uri // Check the wsdl uri
if (empty($this->terSettings['wsdl'])) { if (empty($this->terSettings['wsdl'])) {
throw new Exception('No wsdl set to connect to TER server'); throw new \Exception('No wsdl set to connect to TER server');
} }
// Create connection // Create connection
......
...@@ -186,7 +186,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController ...@@ -186,7 +186,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
{ {
if (!empty($extensionKey)) { if (!empty($extensionKey)) {
if (!is_string($extensionKey)) { if (!is_string($extensionKey)) {
throw new Exception('No valid extension key given'); throw new \Exception('No valid extension key given');
} }
$extension = $this->extensionRepository->findOneByExtKey($extensionKey); $extension = $this->extensionRepository->findOneByExtKey($extensionKey);
} }
...@@ -435,7 +435,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController ...@@ -435,7 +435,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
$format = 't3x'; $format = 't3x';
} }
if ($format !== 't3x' && $format !== 'zip') { if ($format !== 't3x' && $format !== 'zip') {
throw new Exception('A download action for the format "' . $format . '" is not implemented'); throw new \Exception('A download action for the format "' . $format . '" is not implemented');
} }
$version = $this->versionRepository->findOneByExtensionAndVersionString($extension, $versionString); $version = $this->versionRepository->findOneByExtensionAndVersionString($extension, $versionString);
...@@ -569,7 +569,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController ...@@ -569,7 +569,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
$files = array(); $files = array();
try { try {
$extensionInfo = \T3o\TerFe2\Utility\Archive::getExtensionDetailsFromZipArchive($fileInfo['tmp_name'], $files); $extensionInfo = \T3o\TerFe2\Utility\Archive::getExtensionDetailsFromZipArchive($fileInfo['tmp_name'], $files);
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->forwardWithError($exception->getMessage(), 'uploadVersion'); $this->forwardWithError($exception->getMessage(), 'uploadVersion');
} }
unlink($fileInfo['tmp_name']); unlink($fileInfo['tmp_name']);
...@@ -594,7 +594,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController ...@@ -594,7 +594,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
if ($result) { if ($result) {
$this->redirect('index', 'Registerkey', NULL, array('uploaded' => TRUE), $this->settings['pages']['manageKeysPID']); $this->redirect('index', 'Registerkey', NULL, array('uploaded' => TRUE), $this->settings['pages']['manageKeysPID']);
} }
} catch (Exception $exception) { } catch (\Exception $exception) {
$this->forwardWithError($exception->getMessage(), 'uploadVersion'); $this->forwardWithError($exception->getMessage(), 'uploadVersion');
} }
$this->forwardWithError($this->translate('msg.createVersionUploadFailed'), 'uploadVersion'); $this->forwardWithError($this->translate('msg.createVersionUploadFailed'), 'uploadVersion');
......
...@@ -69,7 +69,7 @@ class ObjectBuilder implements \TYPO3\CMS\Core\SingletonInterface ...@@ -69,7 +69,7 @@ class ObjectBuilder implements \TYPO3\CMS\Core\SingletonInterface
public function create($className, array $attributes) public function create($className, array $attributes)
{ {
if (empty($className) || empty($attributes)) { if (empty($className) || empty($attributes)) {
throw new Exception('No valid params given to create an object'); throw new \Exception('No valid params given to create an object');
} }
// Check internal cache first // Check internal cache first
...@@ -126,7 +126,7 @@ class ObjectBuilder implements \TYPO3\CMS\Core\SingletonInterface ...@@ -126,7 +126,7 @@ class ObjectBuilder implements \TYPO3\CMS\Core\SingletonInterface
protected function getClassSchema($className) protected function getClassSchema($className)
{ {
if (empty($className)) { if (empty($className)) {
throw new Exception('No valid class name given to create a class schema'); throw new \Exception('No valid class name given to create a class schema');
} }
if (empty($this->classSchemata[$className])) { if (empty($this->classSchemata[$className])) {
$this->classSchemata[$className] = $this->reflectionService->getClassSchema($className); $this->classSchemata[$className] = $this->reflectionService->getClassSchema($className);
......
...@@ -135,7 +135,7 @@ abstract class AbstractPersistence implements \T3o\TerFe2\Persistence\Persistenc ...@@ -135,7 +135,7 @@ abstract class AbstractPersistence implements \T3o\TerFe2\Persistence\Persistenc
public function set($key, $value) public function set($key, $value)
{ {
if (empty($key)) { if (empty($key)) {
throw new Exception('Empty keys are not allowed'); throw new \Exception('Empty keys are not allowed');
} }
if (!$this->isLoaded()) { if (!$this->isLoaded()) {
$this->load(); $this->load();
......
...@@ -39,7 +39,7 @@ class Session extends \T3o\TerFe2\Persistence\AbstractPersistence ...@@ -39,7 +39,7 @@ class Session extends \T3o\TerFe2\Persistence\AbstractPersistence
public function load() public function load()
{ {
if (empty($GLOBALS['TSFE']->fe_user)) { if (empty($GLOBALS['TSFE']->fe_user)) {
throw new Exception('Could not load session without frontend user'); throw new \Exception('Could not load session without frontend user');
} }
if (!$this->isLoaded) { if (!$this->isLoaded) {
$this->content = $GLOBALS['TSFE']->fe_user->getKey('ses', $this->getName()); $this->content = $GLOBALS['TSFE']->fe_user->getKey('ses', $this->getName());
...@@ -56,7 +56,7 @@ class Session extends \T3o\TerFe2\Persistence\AbstractPersistence ...@@ -56,7 +56,7 @@ class Session extends \T3o\TerFe2\Persistence\AbstractPersistence
public function save() public function save()
{ {
if (empty($GLOBALS['TSFE']->fe_user)) { if (empty($GLOBALS['TSFE']->fe_user)) {
throw new Exception('Could not save session without frontend user'); throw new \Exception('Could not save session without frontend user');
} }
$GLOBALS['TSFE']->fe_user->setKey('ses', $this->getName(), $this->content); $GLOBALS['TSFE']->fe_user->setKey('ses', $this->getName(), $this->content);
$GLOBALS['TSFE']->storeSessionData(); $GLOBALS['TSFE']->storeSessionData();
......
...@@ -109,7 +109,7 @@ class FileProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -109,7 +109,7 @@ class FileProvider extends \T3o\TerFe2\Provider\AbstractProvider
// Check if file exists // Check if file exists
if (!\T3o\TerFe2\Utility\File::fileExists($filename)) { if (!\T3o\TerFe2\Utility\File::fileExists($filename)) {
if ($fileType === 't3x' || $fileType === 'zip') { if ($fileType === 't3x' || $fileType === 'zip') {
#throw new Exception('File "' . $filename . '" not found'); #throw new \Exception('File "' . $filename . '" not found');
} }
\T3o\TerFe2\Utility\Log::addMessage('File "' . $filename . '" not found', 'ter_fe2', 2); \T3o\TerFe2\Utility\Log::addMessage('File "' . $filename . '" not found', 'ter_fe2', 2);
...@@ -185,7 +185,7 @@ class FileProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -185,7 +185,7 @@ class FileProvider extends \T3o\TerFe2\Provider\AbstractProvider
protected function getExtensionInfo($extension, $version, $fileHash) protected function getExtensionInfo($extension, $version, $fileHash)
{ {
if (empty($extension) || empty($version) || empty($fileHash)) { if (empty($extension) || empty($version) || empty($fileHash)) {
throw new Exception('Extension key, version and file hash are required to get extension info'); throw new \Exception('Extension key, version and file hash are required to get extension info');
} }
// Fetch file from extension root path // Fetch file from extension root path
......
...@@ -122,7 +122,7 @@ class MirrorProvider extends \T3o\TerFe2\Provider\FileProvider ...@@ -122,7 +122,7 @@ class MirrorProvider extends \T3o\TerFe2\Provider\FileProvider
protected function getExtensionInfo($extension, $version, $fileHash) protected function getExtensionInfo($extension, $version, $fileHash)
{ {
if (empty($extension) || empty($version) || empty($fileHash)) { if (empty($extension) || empty($version) || empty($fileHash)) {
throw new Exception('Extension key, version and file hash are required to get extension info'); throw new \Exception('Extension key, version and file hash are required to get extension info');
} }
// Fetch file from server // Fetch file from server
......
...@@ -61,7 +61,7 @@ class ProviderManager implements \TYPO3\CMS\Core\SingletonInterface ...@@ -61,7 +61,7 @@ class ProviderManager implements \TYPO3\CMS\Core\SingletonInterface
public function getProvider($name) public function getProvider($name)
{ {
if (empty($name)) { if (empty($name)) {
throw new Exception('No empty name allowed for an extension provider'); throw new \Exception('No empty name allowed for an extension provider');
} }
$name = strtolower(trim($name)); $name = strtolower(trim($name));
...@@ -71,17 +71,17 @@ class ProviderManager implements \TYPO3\CMS\Core\SingletonInterface ...@@ -71,17 +71,17 @@ class ProviderManager implements \TYPO3\CMS\Core\SingletonInterface
} }
if (empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders'][$name])) { if (empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders'][$name])) {
throw new Exception('No configuration found for an extension provider with name "' . $name . '"'); throw new \Exception('No configuration found for an extension provider with name "' . $name . '"');
} }
$configuration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders'][$name]; $configuration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ter_fe2']['extensionProviders'][$name];
if (empty($configuration['class'])) { if (empty($configuration['class'])) {
throw new Exception('No class name found in configuration for the extension provider with name "' . $name . '"'); throw new \Exception('No class name found in configuration for the extension provider with name "' . $name . '"');
} }
$provider = $this->objectManager->get($configuration['class']); $provider = $this->objectManager->get($configuration['class']);
if (!($provider instanceof \T3o\TerFe2\Provider\ProviderInterface)) { if (!($provider instanceof \T3o\TerFe2\Provider\ProviderInterface)) {
throw new Exception('Provider "' . $name . '" does not implement the interface "\T3o\TerFe2\Provider\ProviderInterface"'); throw new \Exception('Provider "' . $name . '" does not implement the interface "\T3o\TerFe2\Provider\ProviderInterface"');
} }
if (!empty($configuration['configuration']) && method_exists($provider, 'setConfiguration')) { if (!empty($configuration['configuration']) && method_exists($provider, 'setConfiguration')) {
$provider->setConfiguration($configuration['configuration']); $provider->setConfiguration($configuration['configuration']);
......
...@@ -65,7 +65,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -65,7 +65,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider
public function initializeProvider() public function initializeProvider()
{ {
if (empty($this->configuration['wsdlUrl'])) { if (empty($this->configuration['wsdlUrl'])) {
throw new Exception('No wsdl url configured'); throw new \Exception('No wsdl url configured');
} }
$username = (empty($this->configuration['username']) ? $this->configuration['username'] : ''); $username = (empty($this->configuration['username']) ? $this->configuration['username'] : '');
...@@ -106,7 +106,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -106,7 +106,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider
public function getExtensions($lastRun, $offset, $count) public function getExtensions($lastRun, $offset, $count)
{ {
if (empty($this->getExtensionsFunc)) { if (empty($this->getExtensionsFunc)) {
throw new Exception('No configuration for "getExtensionsFunc" found'); throw new \Exception('No configuration for "getExtensionsFunc" found');
} }
$parameters = array( $parameters = array(
'lastRun' => (int)$lastRun, 'lastRun' => (int)$lastRun,
...@@ -128,7 +128,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -128,7 +128,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider
public function getFileUrl(\T3o\TerFe2\Domain\Model\Version $version, $fileType) public function getFileUrl(\T3o\TerFe2\Domain\Model\Version $version, $fileType)
{ {
if (empty($this->getFileUrlFunc)) { if (empty($this->getFileUrlFunc)) {
throw new Exception('No configuration for "getFileUrlFunc" found'); throw new \Exception('No configuration for "getFileUrlFunc" found');
} }
$parameters = array( $parameters = array(
'extension' => (string)$version->getExtension()->getExtKey(), 'extension' => (string)$version->getExtension()->getExtKey(),
...@@ -137,7 +137,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -137,7 +137,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider
); );
$result = $this->soapService->__call($this->getFileUrlFunc, $parameters); $result = $this->soapService->__call($this->getFileUrlFunc, $parameters);
if (empty($result['url'])) { if (empty($result['url'])) {
throw new Exception('Could not get url to file from soap server'); throw new \Exception('Could not get url to file from soap server');
} }
return (string)$result['url']; return (string)$result['url'];
} }
...@@ -153,7 +153,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -153,7 +153,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider
public function getFileName(\T3o\TerFe2\Domain\Model\Version $version, $fileType) public function getFileName(\T3o\TerFe2\Domain\Model\Version $version, $fileType)
{ {
if (empty($this->getFileNameFunc)) { if (empty($this->getFileNameFunc)) {
throw new Exception('No configuration for "getFileNameFunc" found'); throw new \Exception('No configuration for "getFileNameFunc" found');
} }
$parameters = array( $parameters = array(
'extension' => (string)$version->getExtension()->getExtKey(), 'extension' => (string)$version->getExtension()->getExtKey(),
...@@ -162,7 +162,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -162,7 +162,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider
); );
$result = $this->soapService->__call($this->getFileNameFunc, $parameters); $result = $this->soapService->__call($this->getFileNameFunc, $parameters);
if (empty($result['filename'])) { if (empty($result['filename'])) {
throw new Exception('Could not get filename from soap server'); throw new \Exception('Could not get filename from soap server');
} }
return (string)$result['filename']; return (string)$result['filename'];
} }
...@@ -177,7 +177,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -177,7 +177,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider
public function getVersionDetails(\T3o\TerFe2\Domain\Model\Version $version) public function getVersionDetails(\T3o\TerFe2\Domain\Model\Version $version)
{ {
if (empty($this->getVersionDetailsFunc)) { if (empty($this->getVersionDetailsFunc)) {
throw new Exception('No configuration for "getVersionDetailsFunc" found'); throw new \Exception('No configuration for "getVersionDetailsFunc" found');
} }
$parameters = array( $parameters = array(
'extension' => (string)$version->getExtension()->getExtKey(), 'extension' => (string)$version->getExtension()->getExtKey(),
...@@ -185,7 +185,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider ...@@ -185,7 +185,7 @@ class SoapProvider extends \T3o\TerFe2\Provider\AbstractProvider
); );
$result = $this->soapService->__call($this->getVersionDetailsFunc, $parameters); $result = $this->soapService->__call($this->getVersionDetailsFunc, $parameters);
if (empty($result) || !is_array($result)) { if (empty($result) || !is_array($result)) {
throw new Exception('Could not get version details from soap server'); throw new \Exception('Could not get version details from soap server');
} }
return $result; return $result;
} }
......
...@@ -77,7 +77,7 @@ class Documentation implements \TYPO3\CMS\Core\SingletonInterface ...@@ -77,7 +77,7 @@ class Documentation implements \TYPO3\CMS\Core\SingletonInterface
public function getDocumentationLink($extensionKey, $versionString) public function getDocumentationLink($extensionKey, $versionString)
{ {
if (empty($extensionKey) || empty($versionString)) { if (empty($extensionKey) || empty($versionString)) {
throw new Exception('Extension key and version string are required to build a documentation url'); throw new \Exception('Extension key and version string are required to build a documentation url');
} }
$manualExists = isset($this->docsInformation->$extensionKey); $manualExists = isset($this->docsInformation->$extensionKey);
......
...@@ -164,7 +164,7 @@ class Mirror implements \TYPO3\CMS\Core\SingletonInterface ...@@ -164,7 +164,7 @@ class Mirror implements \TYPO3\CMS\Core\SingletonInterface
$mirrors = $repositoryUtility->getMirrors(TRUE)->getMirrors(); $mirrors = $repositoryUtility->getMirrors(TRUE)->getMirrors();
unset($repositoryUtility); unset($repositoryUtility);
if (!is_array($mirrors)) { if (!is_array($mirrors)) {
throw new Exception('No mirrors found'); throw new \Exception('No mirrors found');
} }
} }
...@@ -187,7 +187,7 @@ class Mirror implements \TYPO3\CMS\Core\SingletonInterface ...@@ -187,7 +187,7 @@ class Mirror implements \TYPO3\CMS\Core\SingletonInterface
public function getUrlToFile($filename) public function getUrlToFile($filename)
{ {
if (empty($filename)) { if (empty($filename)) {
throw new Exception('No filename given to generate url'); throw new \Exception('No filename given to generate url');
} }
// Get first mirror url // Get first mirror url
...@@ -199,7 +199,7 @@ class Mirror implements \TYPO3\CMS\Core\SingletonInterface ...@@ -199,7 +199,7 @@ class Mirror implements \TYPO3\CMS\Core\SingletonInterface
while (!\T3o\TerFe2\Utility\File::fileExists($mirrorUrl . $filename)) { while (!\T3o\TerFe2\Utility\File::fileExists($mirrorUrl . $filename)) {
$attempts++; $attempts++;
if ($attempts > $maxAttempts) { if ($attempts > $maxAttempts) {
// throw new Exception('File "' . $filename . '" could not be found on ' . $maxAttempts . ' mirrors, break'); // throw new \Exception('File "' . $filename . '" could not be found on ' . $maxAttempts . ' mirrors, break');
// break; // break;
return ''; return '';
} }
...@@ -228,7 +228,7 @@ class Mirror implements \TYPO3\CMS\Core\SingletonInterface ...@@ -228,7 +228,7 @@ class Mirror implements \TYPO3\CMS\Core\SingletonInterface
} }
if (empty($content)) { if (empty($content)) {
throw new Exception('Could not fetch file "' . $filename . '" from mirror server'); throw new \Exception('Could not fetch file "' . $filename . '" from mirror server');
} }
return (string)$content; return (string)$content;
......
...@@ -61,11 +61,11 @@ class Soap implements \TYPO3\CMS\Core\SingletonInterface ...@@ -61,11 +61,11 @@ class Soap implements \TYPO3\CMS\Core\SingletonInterface
{ {
if (empty($wsdlUrl)) { if (empty($wsdlUrl)) {
throw new Exception('No valid wsdl URL given'); throw new \Exception('No valid wsdl URL given');
} }
if (!class_exists('SoapClient')) { if (!class_exists('SoapClient')) {
throw new Exception('PHP SOAP extension not available'); throw new \Exception('PHP SOAP extension not available');
} }
$this->wsdlUrl = $wsdlUrl; $this->wsdlUrl = $wsdlUrl;
...@@ -170,7 +170,7 @@ class Soap implements \TYPO3\CMS\Core\SingletonInterface ...@@ -170,7 +170,7 @@ class Soap implements \TYPO3\CMS\Core\SingletonInterface
// // Check for existing connection // // Check for existing connection
// if (empty($this->soapConnection)) { // if (empty($this->soapConnection)) {
// throw new Exception('Create SOAP connection first'); // throw new \Exception('Create SOAP connection first');
// } // }
// Call given method // Call given method
...@@ -183,7 +183,7 @@ class Soap implements \TYPO3\CMS\Core\SingletonInterface ...@@ -183,7 +183,7 @@ class Soap implements \TYPO3\CMS\Core\SingletonInterface
// Check for errors // Check for errors
if (is_soap_fault($response)) { if (is_soap_fault($response)) {
throw new Exception('Could not call function "' . $methodName . '" on soap server'); throw new \Exception('Could not call function "' . $methodName . '" on soap server');
} }
return $this->convertObjectToArray($response); return $this->convertObjectToArray($response);
......
...@@ -69,7 +69,7 @@ class CreateExtensionFilesTask extends \T3o\TerFe2\Task\AbstractTask ...@@ -69,7 +69,7 @@ class CreateExtensionFilesTask extends \T3o\TerFe2\Task\AbstractTask
$this->persistenceManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class); $this->persistenceManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager::class);
if (empty($this->setup['settings.']['mediaRootPath'])) { if (empty($this->setup['settings.']['mediaRootPath'])) {
throw new Exception('Please configure "plugin.tx_terfe2.settings.mediaRootPath" in TypoScript setup'); throw new \Exception('Please configure "plugin.tx_terfe2.settings.mediaRootPath" in TypoScript setup');
} }
$this->mediaRootPath = $this->setup['settings.']['mediaRootPath']; $this->mediaRootPath = $this->setup['settings.']['mediaRootPath'];
} }
...@@ -200,7 +200,7 @@ class CreateExtensionFilesTask extends \T3o\TerFe2\Task\AbstractTask ...@@ -200,7 +200,7 @@ class CreateExtensionFilesTask extends \T3o\TerFe2\Task\AbstractTask
} }
$images = \T3o\TerFe2\Service\Image::processImages($imageFiles, $this->setup['settings.'][$imageSize . 'Image']); $images = \T3o\TerFe2\Service\Image::processImages($imageFiles, $this->setup['settings.'][$imageSize . 'Image']);
if (empty($images)) { if (empty($images)) {
throw new Exception('Could not create image files'); throw new \Exception('Could not create image files');
} }
} }
......
...@@ -103,12 +103,12 @@ class UpdateExtensionListTask extends \T3o\TerFe2\Task\AbstractTask ...@@ -103,12 +103,12 @@ class UpdateExtensionListTask extends \T3o\TerFe2\Task\AbstractTask
{ {
// Check static setup // Check static setup
if (empty($this->setup['settings.'])) { if (empty($this->setup['settings.'])) {
throw new Exception('Please include static setup "TER Frontend - Default Configuration (ter_fe2)" on root page'); throw new \Exception('Please include static setup "TER Frontend - Default Configuration (ter_fe2)" on root page');
} }
// Check storage page // Check storage page
if (!$this->storagePageConfigured()) { if (!$this->storagePageConfigured()) {
throw new Exception('Please configure "plugin.tx_terfe2.persistence.storagePid" in TypoScript setup'); throw new \Exception('Please configure "plugin.tx_terfe2.persistence.storagePid" in TypoScript setup');
} }
// Get extension structure from provider // Get extension structure from provider
......
...@@ -42,7 +42,7 @@ class Archive ...@@ -42,7 +42,7 @@ class Archive
public static function createZipArchive($filename, array $files, $overwrite = FALSE) public static function createZipArchive($filename, array $files, $overwrite = FALSE)
{ {
if (!class_exists('ZipArchive')) { if (!class_exists('ZipArchive')) {
throw new Exception('Please make sure that php zip extension is installed'); throw new \Exception('Please make sure that php zip extension is installed');
} }
// Check if file already exists // Check if file already exists
...@@ -54,7 +54,7 @@ class Archive ...@@ -54,7 +54,7 @@ class Archive
$createMode = ($overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE); $createMode = ($overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE);
$zipArchive = new ZipArchive(); $zipArchive = new ZipArchive();
if (empty($zipArchive) || !$zipArchive->open($filename, $createMode)) { if (empty($zipArchive) || !$zipArchive->open($filename, $createMode)) {
throw new Exception('Could not open ZIP file to write'); throw new \Exception('Could not open ZIP file to write');
} }
// Add files // Add files
...@@ -63,13 +63,13 @@ class Archive ...@@ -63,13 +63,13 @@ class Archive
continue; continue;
} }
if (!$zipArchive->addFromString($path, (string)$content)) { if (!$zipArchive->addFromString($path, (string)$content)) {
throw new Exception('Could not write file "' . $path . '" into ZIP file'); throw new \Exception('Could not write file "' . $path . '" into ZIP file');