Test Setup Failed
Push — master ( 3c5964...ba530c )
by Simon
15:31
created
Classes/Utility/Typo3Version.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -37,48 +37,48 @@
 block discarded – undo
37 37
  */
38 38
 class Typo3Version
39 39
 {
40
-    /**
41
-     * @var integer $version
42
-     */
43
-    private static $version = null;
40
+	/**
41
+	 * @var integer $version
42
+	 */
43
+	private static $version = null;
44 44
 
45
-    /**
46
-     * Returns the TYPO3 version as integer
47
-     *
48
-     * @return integer
49
-     * @api
50
-     */
51
-    protected static function getBranch()
52
-    {
53
-        if (is_null(self::$version)) {
54
-            self::$version = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch);
55
-        }
56
-        return self::$version;
57
-    }
45
+	/**
46
+	 * Returns the TYPO3 version as integer
47
+	 *
48
+	 * @return integer
49
+	 * @api
50
+	 */
51
+	protected static function getBranch()
52
+	{
53
+		if (is_null(self::$version)) {
54
+			self::$version = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch);
55
+		}
56
+		return self::$version;
57
+	}
58 58
 
59
-    /**
60
-     * Returns TRUE if the current TYPO3 version (or compatibility version) is compatible to the input version
61
-     * Notice that this function compares branches, not versions (4.0.1 would be > 4.0.0 although they use the same compat_version)
62
-     *
63
-     * @param string $branchNumberStr Minimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!)
64
-     * @return bool Returns TRUE if this setup is compatible with the provided version number
65
-     * @todo Still needs a function to convert versions to branches
66
-     */
67
-    public static function isVersion($branchNumberStr)
68
-    {
69
-        return (self::getBranch() == VersionNumberUtility::convertVersionNumberToInteger($branchNumberStr));
70
-    }
59
+	/**
60
+	 * Returns TRUE if the current TYPO3 version (or compatibility version) is compatible to the input version
61
+	 * Notice that this function compares branches, not versions (4.0.1 would be > 4.0.0 although they use the same compat_version)
62
+	 *
63
+	 * @param string $branchNumberStr Minimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!)
64
+	 * @return bool Returns TRUE if this setup is compatible with the provided version number
65
+	 * @todo Still needs a function to convert versions to branches
66
+	 */
67
+	public static function isVersion($branchNumberStr)
68
+	{
69
+		return (self::getBranch() == VersionNumberUtility::convertVersionNumberToInteger($branchNumberStr));
70
+	}
71 71
 
72
-    /**
73
-     * Returns TRUE if the current TYPO3 version (or compatibility version) is compatible to the input version
74
-     * Notice that this function compares branches, not versions (4.0.1 would be > 4.0.0 although they use the same compat_version)
75
-     *
76
-     * @param string $branchNumberStr Minimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!)
77
-     * @return bool Returns TRUE if this setup is compatible with the provided version number
78
-     * @todo Still needs a function to convert versions to branches
79
-     */
80
-    public static function isCompatVersion($branchNumberStr)
81
-    {
82
-        return (self::getBranch() >= VersionNumberUtility::convertVersionNumberToInteger($branchNumberStr));
83
-    }
72
+	/**
73
+	 * Returns TRUE if the current TYPO3 version (or compatibility version) is compatible to the input version
74
+	 * Notice that this function compares branches, not versions (4.0.1 would be > 4.0.0 although they use the same compat_version)
75
+	 *
76
+	 * @param string $branchNumberStr Minimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!)
77
+	 * @return bool Returns TRUE if this setup is compatible with the provided version number
78
+	 * @todo Still needs a function to convert versions to branches
79
+	 */
80
+	public static function isCompatVersion($branchNumberStr)
81
+	{
82
+		return (self::getBranch() >= VersionNumberUtility::convertVersionNumberToInteger($branchNumberStr));
83
+	}
84 84
 }
Please login to merge, or discard this patch.
Classes/Utility/Typo3Provider.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -32,45 +32,45 @@
 block discarded – undo
32 32
  */
33 33
 class Typo3Provider
34 34
 {
35
-    /**
36
-     * @var string $name
37
-     */
38
-    private static $name = null;
35
+	/**
36
+	 * @var string $name
37
+	 */
38
+	private static $name = null;
39 39
 
40
-    /**
41
-     * Returns the trimmed and lowered provider name loaded by getenv.
42
-     *
43
-     * @return string
44
-     * @api
45
-     */
46
-    public static function getName()
47
-    {
48
-        if (is_null(self::$name)) {
49
-            self::$name = trim(mb_strtolower(getenv('TYPO3_PROVIDER') ?: (getenv('REDIRECT_TYPO3_PROVIDER') ?: '')));
50
-        }
40
+	/**
41
+	 * Returns the trimmed and lowered provider name loaded by getenv.
42
+	 *
43
+	 * @return string
44
+	 * @api
45
+	 */
46
+	public static function getName()
47
+	{
48
+		if (is_null(self::$name)) {
49
+			self::$name = trim(mb_strtolower(getenv('TYPO3_PROVIDER') ?: (getenv('REDIRECT_TYPO3_PROVIDER') ?: '')));
50
+		}
51 51
 
52
-        return self::$name;
53
-    }
52
+		return self::$name;
53
+	}
54 54
 
55
-    /**
56
-     * Returns TRUE if $providerName equals the loaded name.
57
-     *
58
-     * @return bool
59
-     * @api
60
-     */
61
-    public static function isProvider($providerName)
62
-    {
63
-        return self::getName() === trim(mb_strtolower($providerName));
64
-    }
55
+	/**
56
+	 * Returns TRUE if $providerName equals the loaded name.
57
+	 *
58
+	 * @return bool
59
+	 * @api
60
+	 */
61
+	public static function isProvider($providerName)
62
+	{
63
+		return self::getName() === trim(mb_strtolower($providerName));
64
+	}
65 65
 
66
-    /**
67
-     * Returns TRUE if the provider is Gilbertsoft
68
-     *
69
-     * @return bool
70
-     * @api
71
-     */
72
-    public static function isGilbertsoft()
73
-    {
74
-        return self::isProvider('Gilbertsoft');
75
-    }
66
+	/**
67
+	 * Returns TRUE if the provider is Gilbertsoft
68
+	 *
69
+	 * @return bool
70
+	 * @api
71
+	 */
72
+	public static function isGilbertsoft()
73
+	{
74
+		return self::isProvider('Gilbertsoft');
75
+	}
76 76
 }
Please login to merge, or discard this patch.
Classes/Extension/AbstractConfigurator.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -37,77 +37,77 @@
 block discarded – undo
37 37
  */
38 38
 abstract class AbstractConfigurator implements ConfiguratorInterface
39 39
 {
40
-    /**
41
-     * @see Typo3Mode::isFrontend()
42
-     */
43
-    protected static function isFrontend()
44
-    {
45
-        return Typo3Mode::isFrontend();
46
-    }
40
+	/**
41
+	 * @see Typo3Mode::isFrontend()
42
+	 */
43
+	protected static function isFrontend()
44
+	{
45
+		return Typo3Mode::isFrontend();
46
+	}
47 47
 
48
-    /**
49
-     * @see Typo3Mode::isBackend()
50
-     */
51
-    protected static function isBackend()
52
-    {
53
-        return Typo3Mode::isBackend();
54
-    }
48
+	/**
49
+	 * @see Typo3Mode::isBackend()
50
+	 */
51
+	protected static function isBackend()
52
+	{
53
+		return Typo3Mode::isBackend();
54
+	}
55 55
 
56
-    /**
57
-     * @see Typo3Mode::isCli()
58
-     */
59
-    protected static function isCli()
60
-    {
61
-        return Typo3Mode::isCli();
62
-    }
56
+	/**
57
+	 * @see Typo3Mode::isCli()
58
+	 */
59
+	protected static function isCli()
60
+	{
61
+		return Typo3Mode::isCli();
62
+	}
63 63
 
64
-    /**
65
-     * @see Typo3Mode::isAjax()
66
-     */
67
-    protected static function isAjax()
68
-    {
69
-        return Typo3Mode::isAjax();
70
-    }
64
+	/**
65
+	 * @see Typo3Mode::isAjax()
66
+	 */
67
+	protected static function isAjax()
68
+	{
69
+		return Typo3Mode::isAjax();
70
+	}
71 71
 
72
-    /**
73
-     * @see Typo3Mode::isInstall()
74
-     */
75
-    protected static function isInstall()
76
-    {
77
-        return Typo3Mode::isInstall();
78
-    }
72
+	/**
73
+	 * @see Typo3Mode::isInstall()
74
+	 */
75
+	protected static function isInstall()
76
+	{
77
+		return Typo3Mode::isInstall();
78
+	}
79 79
 
80
-    /**
81
-     * @see Typo3Version::isVersion()
82
-     */
83
-    protected static function isVersion($branchNumberStr)
84
-    {
85
-        return Typo3Version::isVersion($branchNumberStr);
86
-    }
80
+	/**
81
+	 * @see Typo3Version::isVersion()
82
+	 */
83
+	protected static function isVersion($branchNumberStr)
84
+	{
85
+		return Typo3Version::isVersion($branchNumberStr);
86
+	}
87 87
 
88
-    /**
89
-     * @see Typo3Version::isCompatVersion()
90
-     */
91
-    protected static function isCompatVersion($branchNumberStr)
92
-    {
93
-        return Typo3Version::isCompatVersion($branchNumberStr);
94
-    }
88
+	/**
89
+	 * @see Typo3Version::isCompatVersion()
90
+	 */
91
+	protected static function isCompatVersion($branchNumberStr)
92
+	{
93
+		return Typo3Version::isCompatVersion($branchNumberStr);
94
+	}
95 95
 
96
-    /**
97
-     * Called from ext_localconf.php, to be implemented in derrived classes.
98
-     *
99
-     * @param string $extensionKey Extension key
100
-     * @return void
101
-     * @api
102
-     */
103
-    abstract public static function localconf($extensionKey);
96
+	/**
97
+	 * Called from ext_localconf.php, to be implemented in derrived classes.
98
+	 *
99
+	 * @param string $extensionKey Extension key
100
+	 * @return void
101
+	 * @api
102
+	 */
103
+	abstract public static function localconf($extensionKey);
104 104
 
105
-    /**
106
-     * Called from ext_tables.php, to be implemented in derrived classes.
107
-     *
108
-     * @param string $extensionKey Extension key
109
-     * @return void
110
-     * @api
111
-     */
112
-    abstract public static function tables($extensionKey);
105
+	/**
106
+	 * Called from ext_tables.php, to be implemented in derrived classes.
107
+	 *
108
+	 * @param string $extensionKey Extension key
109
+	 * @return void
110
+	 * @api
111
+	 */
112
+	abstract public static function tables($extensionKey);
113 113
 }
Please login to merge, or discard this patch.
Classes/Extension/ConfiguratorInterface.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -32,21 +32,21 @@
 block discarded – undo
32 32
  */
33 33
 interface ConfiguratorInterface
34 34
 {
35
-    /**
36
-     * Called from ext_localconf.php
37
-     *
38
-     * @param string $extensionKey Extension key
39
-     * @return void
40
-     * @api
41
-     */
42
-    public static function localconf($extensionKey);
35
+	/**
36
+	 * Called from ext_localconf.php
37
+	 *
38
+	 * @param string $extensionKey Extension key
39
+	 * @return void
40
+	 * @api
41
+	 */
42
+	public static function localconf($extensionKey);
43 43
 
44
-    /**
45
-     * Called from ext_tables.php
46
-     *
47
-     * @param string $extensionKey Extension key
48
-     * @return void
49
-     * @api
50
-     */
51
-    public static function tables($extensionKey);
44
+	/**
45
+	 * Called from ext_tables.php
46
+	 *
47
+	 * @param string $extensionKey Extension key
48
+	 * @return void
49
+	 * @api
50
+	 */
51
+	public static function tables($extensionKey);
52 52
 }
Please login to merge, or discard this patch.
Classes/Service/AbstractInstallService.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -35,83 +35,83 @@
 block discarded – undo
35 35
  */
36 36
 abstract class AbstractInstallService
37 37
 {
38
-    /**
39
-     * @var string Extension key
40
-     */
41
-    protected $extensionKey;
38
+	/**
39
+	 * @var string Extension key
40
+	 */
41
+	protected $extensionKey;
42 42
 
43
-    /**
44
-     * Called from ext_localconf.php, to be implemented in derrived classes.
45
-     *
46
-     * @param string $extensionKey Extension key
47
-     * @return null | AbstractInstallService Instance of this class
48
-     */
49
-    public static function registerService($extensionKey)
50
-    {
51
-        if (Typo3Mode::isBackend()) {
52
-            $signalSlot = GeneralUtility::makeInstance(static::class, $extensionKey);
53
-            $signalSlotDispatcher = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
54
-            $signalSlotDispatcher->connect(
55
-                \TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class,
56
-                'afterExtensionInstall',
57
-                $signalSlot,
58
-                'afterInstall'
59
-            );
60
-            $signalSlotDispatcher->connect(
61
-                \TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class,
62
-                'afterExtensionUninstall',
63
-                $signalSlot,
64
-                'afterUninstall'
65
-            );
43
+	/**
44
+	 * Called from ext_localconf.php, to be implemented in derrived classes.
45
+	 *
46
+	 * @param string $extensionKey Extension key
47
+	 * @return null | AbstractInstallService Instance of this class
48
+	 */
49
+	public static function registerService($extensionKey)
50
+	{
51
+		if (Typo3Mode::isBackend()) {
52
+			$signalSlot = GeneralUtility::makeInstance(static::class, $extensionKey);
53
+			$signalSlotDispatcher = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
54
+			$signalSlotDispatcher->connect(
55
+				\TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class,
56
+				'afterExtensionInstall',
57
+				$signalSlot,
58
+				'afterInstall'
59
+			);
60
+			$signalSlotDispatcher->connect(
61
+				\TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class,
62
+				'afterExtensionUninstall',
63
+				$signalSlot,
64
+				'afterUninstall'
65
+			);
66 66
 
67
-            return $signalSlot;
68
-        }
67
+			return $signalSlot;
68
+		}
69 69
 
70
-        return null;
71
-    }
70
+		return null;
71
+	}
72 72
 
73
-    /**
74
-     * Initializes the install service
75
-     *
76
-     * @param string $extensionKey Extension key
77
-     * @throws InvalidArgumentException 
78
-     */
79
-    public function __construct($extensionKey)
80
-    {
81
-        if (!is_string($extensionKey) || empty($extensionKey)) {
82
-            throw new \InvalidArgumentException('$extensionKey must be a non empty string.', 1491494798);
83
-        }
73
+	/**
74
+	 * Initializes the install service
75
+	 *
76
+	 * @param string $extensionKey Extension key
77
+	 * @throws InvalidArgumentException 
78
+	 */
79
+	public function __construct($extensionKey)
80
+	{
81
+		if (!is_string($extensionKey) || empty($extensionKey)) {
82
+			throw new \InvalidArgumentException('$extensionKey must be a non empty string.', 1491494798);
83
+		}
84 84
 
85
-        $this->extensionKey = $extensionKey;
86
-    }
85
+		$this->extensionKey = $extensionKey;
86
+	}
87 87
 
88
-    /**
89
-     * Executes the setup tasks if extension is installed.
90
-     *
91
-     * @param string $extensionKey Installed extension key
92
-     * @return void
93
-     */
94
-    abstract public function afterInstall($extensionKey);
88
+	/**
89
+	 * Executes the setup tasks if extension is installed.
90
+	 *
91
+	 * @param string $extensionKey Installed extension key
92
+	 * @return void
93
+	 */
94
+	abstract public function afterInstall($extensionKey);
95 95
 
96
-    /**
97
-     * Executes the setup tasks if extension is uninstalled.
98
-     *
99
-     * @param string $extensionKey Uninstalled extension key
100
-     * @return void
101
-     */
102
-    abstract public function afterUninstall($extensionKey);
96
+	/**
97
+	 * Executes the setup tasks if extension is uninstalled.
98
+	 *
99
+	 * @param string $extensionKey Uninstalled extension key
100
+	 * @return void
101
+	 */
102
+	abstract public function afterUninstall($extensionKey);
103 103
 
104
-    /**
105
-     * Create a Flash Message and add it to the Queue
106
-     *
107
-     * @param string $message The message.
108
-     * @param string $title Optional message title.
109
-     * @param int $severity Optional severity, must be either of one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
110
-     * @param bool $storeInSession Optional, defines whether the message should be stored in the session or only for one request (default)
111
-     * @return void
112
-     */
113
-    protected function showFlashMessage($message, $title = '', $severity = FlashMessage::OK, $storeInSession = true)
114
-    {
115
-        return FlashMessageUtility::showFlashMessage($this->extensionKey, $message, $title, $severity, $storeInSession);
116
-    }
104
+	/**
105
+	 * Create a Flash Message and add it to the Queue
106
+	 *
107
+	 * @param string $message The message.
108
+	 * @param string $title Optional message title.
109
+	 * @param int $severity Optional severity, must be either of one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
110
+	 * @param bool $storeInSession Optional, defines whether the message should be stored in the session or only for one request (default)
111
+	 * @return void
112
+	 */
113
+	protected function showFlashMessage($message, $title = '', $severity = FlashMessage::OK, $storeInSession = true)
114
+	{
115
+		return FlashMessageUtility::showFlashMessage($this->extensionKey, $message, $title, $severity, $storeInSession);
116
+	}
117 117
 }
Please login to merge, or discard this patch.
Classes/Utility/Typo3Mode.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -32,91 +32,91 @@
 block discarded – undo
32 32
  */
33 33
 class Typo3Mode
34 34
 {
35
-    /**
36
-     * Returns TRUE if mode is set.
37
-     *
38
-     * @return bool
39
-     * @api
40
-     */
41
-    public static function checkMode()
42
-    {
43
-        return defined('TYPO3_MODE');
44
-    }
35
+	/**
36
+	 * Returns TRUE if mode is set.
37
+	 *
38
+	 * @return bool
39
+	 * @api
40
+	 */
41
+	public static function checkMode()
42
+	{
43
+		return defined('TYPO3_MODE');
44
+	}
45 45
 
46
-    /**
47
-     * Returns TRUE if request type is set.
48
-     *
49
-     * @return bool
50
-     * @api
51
-     */
52
-    public static function checkRequestType()
53
-    {
54
-        return defined('TYPO3_REQUESTTYPE');
55
-    }
46
+	/**
47
+	 * Returns TRUE if request type is set.
48
+	 *
49
+	 * @return bool
50
+	 * @api
51
+	 */
52
+	public static function checkRequestType()
53
+	{
54
+		return defined('TYPO3_REQUESTTYPE');
55
+	}
56 56
 
57
-    /**
58
-     * Returns TRUE if called in frontend mode.
59
-     *
60
-     * @return bool
61
-     * @api
62
-     */
63
-    public static function isFrontend()
64
-    {
65
-        return (self::checkMode() && (TYPO3_MODE == 'FE')) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE));
66
-    }
57
+	/**
58
+	 * Returns TRUE if called in frontend mode.
59
+	 *
60
+	 * @return bool
61
+	 * @api
62
+	 */
63
+	public static function isFrontend()
64
+	{
65
+		return (self::checkMode() && (TYPO3_MODE == 'FE')) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE));
66
+	}
67 67
 
68
-    /**
69
-     * Returns TRUE if called in backend mode.
70
-     *
71
-     * @return bool
72
-     * @api
73
-     */
74
-    public static function isBackend()
75
-    {
76
-        return (self::checkMode() && (TYPO3_MODE == 'BE')) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE));
77
-    }
68
+	/**
69
+	 * Returns TRUE if called in backend mode.
70
+	 *
71
+	 * @return bool
72
+	 * @api
73
+	 */
74
+	public static function isBackend()
75
+	{
76
+		return (self::checkMode() && (TYPO3_MODE == 'BE')) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE));
77
+	}
78 78
 
79
-    /**
80
-     * Returns TRUE if called in CLI mode.
81
-     *
82
-     * @return bool
83
-     * @api
84
-     */
85
-    public static function isCli()
86
-    {
87
-        return (defined('TYPO3_cliMode') && TYPO3_cliMode === true) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI));
88
-    }
79
+	/**
80
+	 * Returns TRUE if called in CLI mode.
81
+	 *
82
+	 * @return bool
83
+	 * @api
84
+	 */
85
+	public static function isCli()
86
+	{
87
+		return (defined('TYPO3_cliMode') && TYPO3_cliMode === true) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI));
88
+	}
89 89
 
90
-    /**
91
-     * Returns TRUE if called in ajax mode.
92
-     *
93
-     * @return bool
94
-     * @api
95
-     */
96
-    public static function isAjax()
97
-    {
98
-        return ($GLOBALS['TYPO3_AJAX']) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX));
99
-    }
90
+	/**
91
+	 * Returns TRUE if called in ajax mode.
92
+	 *
93
+	 * @return bool
94
+	 * @api
95
+	 */
96
+	public static function isAjax()
97
+	{
98
+		return ($GLOBALS['TYPO3_AJAX']) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX));
99
+	}
100 100
 
101
-    /**
102
-     * Returns TRUE if called in install mode.
103
-     *
104
-     * @return bool
105
-     * @api
106
-     */
107
-    public static function isInstall()
108
-    {
109
-        return (defined('TYPO3_enterInstallScript') && TYPO3_enterInstallScript) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL));
110
-    }
101
+	/**
102
+	 * Returns TRUE if called in install mode.
103
+	 *
104
+	 * @return bool
105
+	 * @api
106
+	 */
107
+	public static function isInstall()
108
+	{
109
+		return (defined('TYPO3_enterInstallScript') && TYPO3_enterInstallScript) || (self::checkRequestType() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL));
110
+	}
111 111
 
112
-    /**
113
-     * Returns TRUE if called in composer mode.
114
-     *
115
-     * @return bool
116
-     * @api
117
-     */
118
-    public static function isComposerMode()
119
-    {
120
-        return (defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE);
121
-    }
112
+	/**
113
+	 * Returns TRUE if called in composer mode.
114
+	 *
115
+	 * @return bool
116
+	 * @api
117
+	 */
118
+	public static function isComposerMode()
119
+	{
120
+		return (defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE);
121
+	}
122 122
 }
Please login to merge, or discard this patch.
ext_emconf.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -22,33 +22,33 @@
 block discarded – undo
22 22
  */
23 23
 
24 24
 $EM_CONF[$_EXTKEY] = [
25
-    'title' => 'GS Library',
26
-    'description' => 'GS Library is a collection of utility functions, base classes and other templates for the usage in other extensions.',
27
-    'version' => '0.0.9',
28
-    'category' => 'misc',
29
-    'constraints' => [
30
-        'depends' => [
31
-            'php' => '7.0.0-7.2.99',
32
-            'typo3' => '8.7.0-9.5.99',
33
-        ],
34
-        'conflicts' => [],
35
-        'suggests' => [],
36
-    ],
37
-    'state' => 'beta',
38
-    'uploadfolder' => 0,
39
-    'createDirs' => '',
40
-    'clearCacheOnLoad' => 0,
41
-    'author' => 'Simon Gilli',
42
-    'author_email' => '[email protected]',
43
-    'author_company' => 'Gilbertsoft',
44
-    'autoload' => [
45
-        'psr-4' => [
46
-            'Gilbertsoft\\Lib\\' => 'Classes',
47
-        ],
48
-    ],
49
-    'autoload-dev' => [
50
-        'psr-4' => [
51
-            'Gilbertsoft\\Lib\\Tests\\' => 'Tests',
52
-        ],
53
-    ],
25
+	'title' => 'GS Library',
26
+	'description' => 'GS Library is a collection of utility functions, base classes and other templates for the usage in other extensions.',
27
+	'version' => '0.0.9',
28
+	'category' => 'misc',
29
+	'constraints' => [
30
+		'depends' => [
31
+			'php' => '7.0.0-7.2.99',
32
+			'typo3' => '8.7.0-9.5.99',
33
+		],
34
+		'conflicts' => [],
35
+		'suggests' => [],
36
+	],
37
+	'state' => 'beta',
38
+	'uploadfolder' => 0,
39
+	'createDirs' => '',
40
+	'clearCacheOnLoad' => 0,
41
+	'author' => 'Simon Gilli',
42
+	'author_email' => '[email protected]',
43
+	'author_company' => 'Gilbertsoft',
44
+	'autoload' => [
45
+		'psr-4' => [
46
+			'Gilbertsoft\\Lib\\' => 'Classes',
47
+		],
48
+	],
49
+	'autoload-dev' => [
50
+		'psr-4' => [
51
+			'Gilbertsoft\\Lib\\Tests\\' => 'Tests',
52
+		],
53
+	],
54 54
 ];
Please login to merge, or discard this patch.
Classes/Utility/StorageRepositoryUtility.php 1 patch
Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -34,135 +34,135 @@
 block discarded – undo
34 34
  */
35 35
 class StorageRepositoryUtility
36 36
 {
37
-    /**
38
-     * @const string Suffix added to storage name
39
-     */
40
-    const STORAGE_SUFFIX = '/ (auto-created)';
41
-
42
-    /**
43
-     * Get the storage repository
44
-     *
45
-     * @return \TYPO3\CMS\Core\Resource\StorageRepository
46
-     */
47
-    public static function getStorageRepository()
48
-    {
49
-        return GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\StorageRepository::class);
50
-    }
51
-
52
-    /**
53
-     * Searches for a local storage.
54
-     *
55
-     * @param string $name Local storage name
56
-     * @return NULL|\TYPO3\CMS\Core\Resource\ResourceStorage
57
-     */
58
-    public static function findLocalStorage($name)
59
-    {
60
-        /** @var $storageObjects \TYPO3\CMS\Core\Resource\ResourceStorage[] */
61
-        $storageObjects = self::getStorageRepository()->findByStorageType('Local');
62
-
63
-        foreach ($storageObjects as $storage) {
64
-            if (isset($storage->getConfiguration()['basePath']) && ($storage->getConfiguration()['basePath'] == rtrim($name, '/') . '/')) {
65
-                return $storage;
66
-            }
67
-        }
68
-
69
-        return null;
70
-    }
71
-
72
-    /**
73
-     * Creates a directory in the web root if it is not existing.
74
-     *
75
-     * @param string $name Relative path to folder from web root, see PHP mkdir() function. Removes trailing slash internally.
76
-     * @return bool TRUE if mkdir went well!
77
-     */
78
-    public static function createDirectoryAtWebRoot($name)
79
-    {
80
-        if (!@is_dir(Environment::getPublicPath() . '/' . $name)) {
81
-            return GeneralUtility::mkdir(Environment::getPublicPath() . '/' . $name);
82
-        }
83
-
84
-        return true;
85
-    }
86
-
87
-    /**
88
-     * Creates a local storage if not exists.
89
-     *
90
-     * @param string $extensionKey
91
-     * @param string $name Local storage name
92
-     * @param string $message Optional message
93
-     * @return NULL|int Uid of the inserted or found record
94
-     * @throws \InvalidArgumentException
95
-     */
96
-    public static function createLocalStorage($extensionKey, $name, $message = '')
97
-    {
98
-        if (!is_string($name) || empty($name)) {
99
-            throw new \InvalidArgumentException('$name must be a non empty string.', 1491681665);
100
-        }
101
-
102
-        if (self::createDirectoryAtWebRoot($name) !== true) {
103
-            FlashMessageUtility::showFlashMessage(
104
-                $extensionKey,
105
-                'Local storage ' . $name . ' could not be created!',
106
-                'Local storage not created',
107
-                FlashMessage::WARNING
108
-            );
109
-
110
-            return null;
111
-        }
112
-
113
-        $addMessage = (is_string($message) && !empty($message) ? ' ' . $message : '');
114
-        /** @var $storage \TYPO3\CMS\Core\Resource\ResourceStorage */
115
-        $storage = self::findLocalStorage($name);
116
-
117
-        if ($storage !== null) {
118
-            FlashMessageUtility::showFlashMessage(
119
-                $extensionKey,
120
-                'Local storage ' . $name . ' was found.' . $addMessage,
121
-                'Local storage found',
122
-                FlashMessage::NOTICE
123
-            );
124
-
125
-            return $storage->getUid();
126
-        }
127
-
128
-        $uid = self::getStorageRepository()->createLocalStorage(
129
-            $name . self::STORAGE_SUFFIX,
130
-            $name,
131
-            'relative',
132
-            'This is the local ' . $name . '/ directory. This storage mount has been created automatically by ' . $extensionKey . '.' . $addMessage,
133
-            false
134
-        );
135
-
136
-        FlashMessageUtility::showFlashMessage(
137
-            $extensionKey,
138
-            'Local storage ' . $name . ' successfully created.' . $addMessage,
139
-            'Local storage created'
140
-        );
141
-
142
-        return $uid;
143
-    }
144
-
145
-    /**
146
-     * Removes a local storage.
147
-     *
148
-     * @param string $extensionKey
149
-     * @param string $name Local storage name
150
-     * @return void
151
-     * @throws \InvalidArgumentException
152
-     */
153
-    public static function removeLocalStorage($extensionKey, $name)
154
-    {
155
-        if (!is_string($name) || empty($name)) {
156
-            throw new \InvalidArgumentException('$name must be a non empty string.', 1491682406);
157
-        }
158
-
159
-        if (self::findLocalStorage($name) !== null) {
160
-            FlashMessageUtility::showFlashMessage(
161
-                $extensionKey,
162
-                'Local storage ' . $name . ' must be removed by an admin from the root line in the backend and web root directory.',
163
-                'Remove local storage',
164
-                FlashMessage::NOTICE
165
-            );
166
-        }
167
-    }
37
+	/**
38
+	 * @const string Suffix added to storage name
39
+	 */
40
+	const STORAGE_SUFFIX = '/ (auto-created)';
41
+
42
+	/**
43
+	 * Get the storage repository
44
+	 *
45
+	 * @return \TYPO3\CMS\Core\Resource\StorageRepository
46
+	 */
47
+	public static function getStorageRepository()
48
+	{
49
+		return GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\StorageRepository::class);
50
+	}
51
+
52
+	/**
53
+	 * Searches for a local storage.
54
+	 *
55
+	 * @param string $name Local storage name
56
+	 * @return NULL|\TYPO3\CMS\Core\Resource\ResourceStorage
57
+	 */
58
+	public static function findLocalStorage($name)
59
+	{
60
+		/** @var $storageObjects \TYPO3\CMS\Core\Resource\ResourceStorage[] */
61
+		$storageObjects = self::getStorageRepository()->findByStorageType('Local');
62
+
63
+		foreach ($storageObjects as $storage) {
64
+			if (isset($storage->getConfiguration()['basePath']) && ($storage->getConfiguration()['basePath'] == rtrim($name, '/') . '/')) {
65
+				return $storage;
66
+			}
67
+		}
68
+
69
+		return null;
70
+	}
71
+
72
+	/**
73
+	 * Creates a directory in the web root if it is not existing.
74
+	 *
75
+	 * @param string $name Relative path to folder from web root, see PHP mkdir() function. Removes trailing slash internally.
76
+	 * @return bool TRUE if mkdir went well!
77
+	 */
78
+	public static function createDirectoryAtWebRoot($name)
79
+	{
80
+		if (!@is_dir(Environment::getPublicPath() . '/' . $name)) {
81
+			return GeneralUtility::mkdir(Environment::getPublicPath() . '/' . $name);
82
+		}
83
+
84
+		return true;
85
+	}
86
+
87
+	/**
88
+	 * Creates a local storage if not exists.
89
+	 *
90
+	 * @param string $extensionKey
91
+	 * @param string $name Local storage name
92
+	 * @param string $message Optional message
93
+	 * @return NULL|int Uid of the inserted or found record
94
+	 * @throws \InvalidArgumentException
95
+	 */
96
+	public static function createLocalStorage($extensionKey, $name, $message = '')
97
+	{
98
+		if (!is_string($name) || empty($name)) {
99
+			throw new \InvalidArgumentException('$name must be a non empty string.', 1491681665);
100
+		}
101
+
102
+		if (self::createDirectoryAtWebRoot($name) !== true) {
103
+			FlashMessageUtility::showFlashMessage(
104
+				$extensionKey,
105
+				'Local storage ' . $name . ' could not be created!',
106
+				'Local storage not created',
107
+				FlashMessage::WARNING
108
+			);
109
+
110
+			return null;
111
+		}
112
+
113
+		$addMessage = (is_string($message) && !empty($message) ? ' ' . $message : '');
114
+		/** @var $storage \TYPO3\CMS\Core\Resource\ResourceStorage */
115
+		$storage = self::findLocalStorage($name);
116
+
117
+		if ($storage !== null) {
118
+			FlashMessageUtility::showFlashMessage(
119
+				$extensionKey,
120
+				'Local storage ' . $name . ' was found.' . $addMessage,
121
+				'Local storage found',
122
+				FlashMessage::NOTICE
123
+			);
124
+
125
+			return $storage->getUid();
126
+		}
127
+
128
+		$uid = self::getStorageRepository()->createLocalStorage(
129
+			$name . self::STORAGE_SUFFIX,
130
+			$name,
131
+			'relative',
132
+			'This is the local ' . $name . '/ directory. This storage mount has been created automatically by ' . $extensionKey . '.' . $addMessage,
133
+			false
134
+		);
135
+
136
+		FlashMessageUtility::showFlashMessage(
137
+			$extensionKey,
138
+			'Local storage ' . $name . ' successfully created.' . $addMessage,
139
+			'Local storage created'
140
+		);
141
+
142
+		return $uid;
143
+	}
144
+
145
+	/**
146
+	 * Removes a local storage.
147
+	 *
148
+	 * @param string $extensionKey
149
+	 * @param string $name Local storage name
150
+	 * @return void
151
+	 * @throws \InvalidArgumentException
152
+	 */
153
+	public static function removeLocalStorage($extensionKey, $name)
154
+	{
155
+		if (!is_string($name) || empty($name)) {
156
+			throw new \InvalidArgumentException('$name must be a non empty string.', 1491682406);
157
+		}
158
+
159
+		if (self::findLocalStorage($name) !== null) {
160
+			FlashMessageUtility::showFlashMessage(
161
+				$extensionKey,
162
+				'Local storage ' . $name . ' must be removed by an admin from the root line in the backend and web root directory.',
163
+				'Remove local storage',
164
+				FlashMessage::NOTICE
165
+			);
166
+		}
167
+	}
168 168
 }
Please login to merge, or discard this patch.
Classes/Utility/FlashMessageUtility.php 1 patch
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -34,76 +34,76 @@
 block discarded – undo
34 34
  */
35 35
 class FlashMessageUtility
36 36
 {
37
-    /**
38
-     * @var \TYPO3\CMS\Core\Messaging\FlashMessageService
39
-     */
40
-    protected static $flashMessageService = null;
41
-    /**
42
-     * Returns the Flash Message Service
43
-     *
44
-     * @return \TYPO3\CMS\Core\Messaging\FlashMessageService
45
-     */
46
-    public static function getFlashMessageService()
47
-    {
48
-        if (self::$flashMessageService === null) {
49
-            // cache the object for performance-reasons
50
-            self::$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
51
-        }
52
-        return self::$flashMessageService;
53
-    }
37
+	/**
38
+	 * @var \TYPO3\CMS\Core\Messaging\FlashMessageService
39
+	 */
40
+	protected static $flashMessageService = null;
41
+	/**
42
+	 * Returns the Flash Message Service
43
+	 *
44
+	 * @return \TYPO3\CMS\Core\Messaging\FlashMessageService
45
+	 */
46
+	public static function getFlashMessageService()
47
+	{
48
+		if (self::$flashMessageService === null) {
49
+			// cache the object for performance-reasons
50
+			self::$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
51
+		}
52
+		return self::$flashMessageService;
53
+	}
54 54
 
55
-    /**
56
-     * Returns the Flash Message Queue
57
-     *
58
-     * @param string $extensionKey
59
-     * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue
60
-     * @throws \InvalidArgumentException
61
-     */
62
-    public static function getFlashMessageQueue($extensionKey)
63
-    {
64
-        if (!is_string($extensionKey) || empty($extensionKey)) {
65
-            throw new \InvalidArgumentException('$extensionKey must be a non empty string.', 1491502264);
66
-        }
67
-        return self::getFlashMessageService()->getMessageQueueByIdentifier('gslib.flashmessages.' . $extensionKey);
68
-    }
55
+	/**
56
+	 * Returns the Flash Message Queue
57
+	 *
58
+	 * @param string $extensionKey
59
+	 * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue
60
+	 * @throws \InvalidArgumentException
61
+	 */
62
+	public static function getFlashMessageQueue($extensionKey)
63
+	{
64
+		if (!is_string($extensionKey) || empty($extensionKey)) {
65
+			throw new \InvalidArgumentException('$extensionKey must be a non empty string.', 1491502264);
66
+		}
67
+		return self::getFlashMessageService()->getMessageQueueByIdentifier('gslib.flashmessages.' . $extensionKey);
68
+	}
69 69
 
70
-    /**
71
-     * Adds a Flash Message to the Flash Message Queue
72
-     *
73
-     * @param \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage
74
-     * @param string $extensionKey
75
-     * @return void
76
-     */
77
-    public static function addFlashMessageToQueue(FlashMessage $flashMessage, $extensionKey)
78
-    {
79
-        if ($flashMessage) {
80
-            self::getFlashMessageQueue($extensionKey)->enqueue($flashMessage);
81
-        }
82
-    }
70
+	/**
71
+	 * Adds a Flash Message to the Flash Message Queue
72
+	 *
73
+	 * @param \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage
74
+	 * @param string $extensionKey
75
+	 * @return void
76
+	 */
77
+	public static function addFlashMessageToQueue(FlashMessage $flashMessage, $extensionKey)
78
+	{
79
+		if ($flashMessage) {
80
+			self::getFlashMessageQueue($extensionKey)->enqueue($flashMessage);
81
+		}
82
+	}
83 83
 
84
-    /**
85
-     * Create a Flash Message and add it to the Queue
86
-     *
87
-     * @param string $extensionKey
88
-     * @param string $message The message.
89
-     * @param string $title Optional message title.
90
-     * @param int $severity Optional severity, must be either of one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
91
-     * @param bool $storeInSession Optional, defines whether the message should be stored in the session or only for one request (default)
92
-     * @return void
93
-     */
94
-    public static function showFlashMessage($extensionKey, $message, $title = '', $severity = FlashMessage::OK, $storeInSession = true)
95
-    {
96
-        if (is_string($message) || !empty($message)) {
97
-            self::addFlashMessageToQueue(
98
-                GeneralUtility::makeInstance(
99
-                    FlashMessage::class,
100
-                    $message,
101
-                    $title,
102
-                    $severity,
103
-                    $storeInSession
104
-                ), 
105
-                $extensionKey
106
-            );
107
-        }
108
-    }
84
+	/**
85
+	 * Create a Flash Message and add it to the Queue
86
+	 *
87
+	 * @param string $extensionKey
88
+	 * @param string $message The message.
89
+	 * @param string $title Optional message title.
90
+	 * @param int $severity Optional severity, must be either of one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
91
+	 * @param bool $storeInSession Optional, defines whether the message should be stored in the session or only for one request (default)
92
+	 * @return void
93
+	 */
94
+	public static function showFlashMessage($extensionKey, $message, $title = '', $severity = FlashMessage::OK, $storeInSession = true)
95
+	{
96
+		if (is_string($message) || !empty($message)) {
97
+			self::addFlashMessageToQueue(
98
+				GeneralUtility::makeInstance(
99
+					FlashMessage::class,
100
+					$message,
101
+					$title,
102
+					$severity,
103
+					$storeInSession
104
+				), 
105
+				$extensionKey
106
+			);
107
+		}
108
+	}
109 109
 }
Please login to merge, or discard this patch.