@@ -37,51 +37,51 @@ |
||
37 | 37 | */ |
38 | 38 | abstract class AbstractExtensionConfig implements ExtensionConfigInterface |
39 | 39 | { |
40 | - /** |
|
41 | - * @see Typo3Mode::isBackend() |
|
42 | - */ |
|
43 | - protected static function isBackend() |
|
44 | - { |
|
45 | - return Typo3Mode::isBackend(); |
|
46 | - } |
|
40 | + /** |
|
41 | + * @see Typo3Mode::isBackend() |
|
42 | + */ |
|
43 | + protected static function isBackend() |
|
44 | + { |
|
45 | + return Typo3Mode::isBackend(); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * @see Typo3Mode::isFrontend() |
|
50 | - */ |
|
51 | - protected static function isFrontend() |
|
52 | - { |
|
53 | - return Typo3Mode::isFrontend(); |
|
54 | - } |
|
48 | + /** |
|
49 | + * @see Typo3Mode::isFrontend() |
|
50 | + */ |
|
51 | + protected static function isFrontend() |
|
52 | + { |
|
53 | + return Typo3Mode::isFrontend(); |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * @see Typo3Version::isVersion() |
|
58 | - */ |
|
59 | - protected static function isVersion($branchNumberStr) |
|
60 | - { |
|
61 | - return Typo3Version::isVersion($branchNumberStr); |
|
62 | - } |
|
56 | + /** |
|
57 | + * @see Typo3Version::isVersion() |
|
58 | + */ |
|
59 | + protected static function isVersion($branchNumberStr) |
|
60 | + { |
|
61 | + return Typo3Version::isVersion($branchNumberStr); |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @see Typo3Version::isCompatVersion() |
|
66 | - */ |
|
67 | - protected static function isCompatVersion($branchNumberStr) |
|
68 | - { |
|
69 | - return Typo3Version::isCompatVersion($branchNumberStr); |
|
70 | - } |
|
64 | + /** |
|
65 | + * @see Typo3Version::isCompatVersion() |
|
66 | + */ |
|
67 | + protected static function isCompatVersion($branchNumberStr) |
|
68 | + { |
|
69 | + return Typo3Version::isCompatVersion($branchNumberStr); |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * Called from ext_localconf.php, to be implemented in derrived classes. |
|
74 | - * |
|
75 | - * @return void |
|
76 | - * @api |
|
77 | - */ |
|
78 | - abstract public static function localconf($extKey); |
|
72 | + /** |
|
73 | + * Called from ext_localconf.php, to be implemented in derrived classes. |
|
74 | + * |
|
75 | + * @return void |
|
76 | + * @api |
|
77 | + */ |
|
78 | + abstract public static function localconf($extKey); |
|
79 | 79 | |
80 | - /** |
|
81 | - * Called from ext_tables.php, to be implemented in derrived classes. |
|
82 | - * |
|
83 | - * @return void |
|
84 | - * @api |
|
85 | - */ |
|
86 | - abstract public static function tables($extKey); |
|
80 | + /** |
|
81 | + * Called from ext_tables.php, to be implemented in derrived classes. |
|
82 | + * |
|
83 | + * @return void |
|
84 | + * @api |
|
85 | + */ |
|
86 | + abstract public static function tables($extKey); |
|
87 | 87 | } |
@@ -32,19 +32,19 @@ |
||
32 | 32 | */ |
33 | 33 | interface ExtensionConfigInterface |
34 | 34 | { |
35 | - /** |
|
36 | - * Called from ext_localconf.php |
|
37 | - * |
|
38 | - * @return void |
|
39 | - * @api |
|
40 | - */ |
|
41 | - public static function localconf($extKey); |
|
35 | + /** |
|
36 | + * Called from ext_localconf.php |
|
37 | + * |
|
38 | + * @return void |
|
39 | + * @api |
|
40 | + */ |
|
41 | + public static function localconf($extKey); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Called from ext_tables.php |
|
45 | - * |
|
46 | - * @return void |
|
47 | - * @api |
|
48 | - */ |
|
49 | - public static function tables($extKey); |
|
43 | + /** |
|
44 | + * Called from ext_tables.php |
|
45 | + * |
|
46 | + * @return void |
|
47 | + * @api |
|
48 | + */ |
|
49 | + public static function tables($extKey); |
|
50 | 50 | } |
@@ -37,48 +37,48 @@ |
||
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 | } |
@@ -32,80 +32,80 @@ |
||
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 called in frontend mode. |
|
48 | - * |
|
49 | - * @return bool |
|
50 | - * @api |
|
51 | - */ |
|
52 | - public static function isFrontend() |
|
53 | - { |
|
54 | - return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE); |
|
55 | - } |
|
46 | + /** |
|
47 | + * Returns TRUE if called in frontend mode. |
|
48 | + * |
|
49 | + * @return bool |
|
50 | + * @api |
|
51 | + */ |
|
52 | + public static function isFrontend() |
|
53 | + { |
|
54 | + return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * Returns TRUE if called in backend mode. |
|
59 | - * |
|
60 | - * @return bool |
|
61 | - * @api |
|
62 | - */ |
|
63 | - public static function isBackend() |
|
64 | - { |
|
65 | - return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE); |
|
66 | - } |
|
57 | + /** |
|
58 | + * Returns TRUE if called in backend mode. |
|
59 | + * |
|
60 | + * @return bool |
|
61 | + * @api |
|
62 | + */ |
|
63 | + public static function isBackend() |
|
64 | + { |
|
65 | + return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE); |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * Returns TRUE if called in CLI mode. |
|
70 | - * |
|
71 | - * @return bool |
|
72 | - * @api |
|
73 | - */ |
|
74 | - public static function isCli() |
|
75 | - { |
|
76 | - return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI); |
|
77 | - } |
|
68 | + /** |
|
69 | + * Returns TRUE if called in CLI mode. |
|
70 | + * |
|
71 | + * @return bool |
|
72 | + * @api |
|
73 | + */ |
|
74 | + public static function isCli() |
|
75 | + { |
|
76 | + return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI); |
|
77 | + } |
|
78 | 78 | |
79 | - /** |
|
80 | - * Returns TRUE if called in ajax mode. |
|
81 | - * |
|
82 | - * @return bool |
|
83 | - * @api |
|
84 | - */ |
|
85 | - public static function isAjax() |
|
86 | - { |
|
87 | - return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX); |
|
88 | - } |
|
79 | + /** |
|
80 | + * Returns TRUE if called in ajax mode. |
|
81 | + * |
|
82 | + * @return bool |
|
83 | + * @api |
|
84 | + */ |
|
85 | + public static function isAjax() |
|
86 | + { |
|
87 | + return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX); |
|
88 | + } |
|
89 | 89 | |
90 | - /** |
|
91 | - * Returns TRUE if called in install mode. |
|
92 | - * |
|
93 | - * @return bool |
|
94 | - * @api |
|
95 | - */ |
|
96 | - public static function isInstall() |
|
97 | - { |
|
98 | - return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL); |
|
99 | - } |
|
90 | + /** |
|
91 | + * Returns TRUE if called in install mode. |
|
92 | + * |
|
93 | + * @return bool |
|
94 | + * @api |
|
95 | + */ |
|
96 | + public static function isInstall() |
|
97 | + { |
|
98 | + return self::checkMode() && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL); |
|
99 | + } |
|
100 | 100 | |
101 | - /** |
|
102 | - * Returns TRUE if called in composer mode. |
|
103 | - * |
|
104 | - * @return bool |
|
105 | - * @api |
|
106 | - */ |
|
107 | - public static function isComposerMode() |
|
108 | - { |
|
109 | - return (defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE); |
|
110 | - } |
|
101 | + /** |
|
102 | + * Returns TRUE if called in composer mode. |
|
103 | + * |
|
104 | + * @return bool |
|
105 | + * @api |
|
106 | + */ |
|
107 | + public static function isComposerMode() |
|
108 | + { |
|
109 | + return (defined('TYPO3_COMPOSER_MODE') && TYPO3_COMPOSER_MODE); |
|
110 | + } |
|
111 | 111 | } |
@@ -32,45 +32,45 @@ |
||
32 | 32 | */ |
33 | 33 | class Provider |
34 | 34 | { |
35 | - /** |
|
36 | - * @var string |
|
37 | - */ |
|
38 | - protected static $name = null; |
|
35 | + /** |
|
36 | + * @var string |
|
37 | + */ |
|
38 | + protected 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 | } |
@@ -33,53 +33,53 @@ |
||
33 | 33 | */ |
34 | 34 | abstract class AbstractInstallService |
35 | 35 | { |
36 | - /** |
|
37 | - * @var string Extension key |
|
38 | - */ |
|
39 | - protected $extensionKey; |
|
36 | + /** |
|
37 | + * @var string Extension key |
|
38 | + */ |
|
39 | + protected $extensionKey; |
|
40 | 40 | |
41 | - /** |
|
42 | - * Initializes the install service |
|
43 | - * |
|
44 | - * @param string $extensionKey Extension key |
|
45 | - * @throws InvalidArgumentException |
|
46 | - */ |
|
47 | - public function __construct($extensionKey) |
|
48 | - { |
|
49 | - if (!is_string($extensionKey) || empty($extensionKey)) { |
|
50 | - throw new \InvalidArgumentException('$extensionKey must be a non empty string.', 1491494798); |
|
51 | - } |
|
41 | + /** |
|
42 | + * Initializes the install service |
|
43 | + * |
|
44 | + * @param string $extensionKey Extension key |
|
45 | + * @throws InvalidArgumentException |
|
46 | + */ |
|
47 | + public function __construct($extensionKey) |
|
48 | + { |
|
49 | + if (!is_string($extensionKey) || empty($extensionKey)) { |
|
50 | + throw new \InvalidArgumentException('$extensionKey must be a non empty string.', 1491494798); |
|
51 | + } |
|
52 | 52 | |
53 | - $this->extensionKey = $extensionKey; |
|
54 | - } |
|
53 | + $this->extensionKey = $extensionKey; |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * Executes the setup tasks if extension is installed. |
|
58 | - * |
|
59 | - * @param string $extensionKey Installed extension key |
|
60 | - * @return void |
|
61 | - */ |
|
62 | - abstract public function afterInstall($extensionKey); |
|
56 | + /** |
|
57 | + * Executes the setup tasks if extension is installed. |
|
58 | + * |
|
59 | + * @param string $extensionKey Installed extension key |
|
60 | + * @return void |
|
61 | + */ |
|
62 | + abstract public function afterInstall($extensionKey); |
|
63 | 63 | |
64 | - /** |
|
65 | - * Executes the setup tasks if extension is uninstalled. |
|
66 | - * |
|
67 | - * @param string $extensionKey Uninstalled extension key |
|
68 | - * @return void |
|
69 | - */ |
|
70 | - abstract public function afterUninstall($extensionKey); |
|
64 | + /** |
|
65 | + * Executes the setup tasks if extension is uninstalled. |
|
66 | + * |
|
67 | + * @param string $extensionKey Uninstalled extension key |
|
68 | + * @return void |
|
69 | + */ |
|
70 | + abstract public function afterUninstall($extensionKey); |
|
71 | 71 | |
72 | - /** |
|
73 | - * Create a Flash Message and add it to the Queue |
|
74 | - * |
|
75 | - * @param string $message The message. |
|
76 | - * @param string $title Optional message title. |
|
77 | - * @param int $severity Optional severity, must be either of one of \TYPO3\CMS\Core\Messaging\FlashMessage constants |
|
78 | - * @param bool $storeInSession Optional, defines whether the message should be stored in the session or only for one request (default) |
|
79 | - * @return void |
|
80 | - */ |
|
81 | - protected function showFlashMessage($message, $title = '', $severity = FlashMessage::OK, $storeInSession = true) |
|
82 | - { |
|
83 | - return FlashMessageUtility::showFlashMessage($this->extensionKey, $message, $title, $severity, $storeInSession); |
|
84 | - } |
|
72 | + /** |
|
73 | + * Create a Flash Message and add it to the Queue |
|
74 | + * |
|
75 | + * @param string $message The message. |
|
76 | + * @param string $title Optional message title. |
|
77 | + * @param int $severity Optional severity, must be either of one of \TYPO3\CMS\Core\Messaging\FlashMessage constants |
|
78 | + * @param bool $storeInSession Optional, defines whether the message should be stored in the session or only for one request (default) |
|
79 | + * @return void |
|
80 | + */ |
|
81 | + protected function showFlashMessage($message, $title = '', $severity = FlashMessage::OK, $storeInSession = true) |
|
82 | + { |
|
83 | + return FlashMessageUtility::showFlashMessage($this->extensionKey, $message, $title, $severity, $storeInSession); |
|
84 | + } |
|
85 | 85 | } |