@@ -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,45 +32,45 @@ |
||
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 | } |
@@ -37,77 +37,77 @@ |
||
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 | } |
@@ -32,21 +32,21 @@ |
||
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 | } |
@@ -35,83 +35,83 @@ |
||
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 | } |
@@ -22,33 +22,33 @@ |
||
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.5', |
|
28 | - 'category' => 'misc', |
|
29 | - 'constraints' => [ |
|
30 | - 'depends' => [ |
|
31 | - 'php' => '5.6.0-0.0.0', |
|
32 | - 'typo3' => '6.2.0-8.9.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.5', |
|
28 | + 'category' => 'misc', |
|
29 | + 'constraints' => [ |
|
30 | + 'depends' => [ |
|
31 | + 'php' => '5.6.0-0.0.0', |
|
32 | + 'typo3' => '6.2.0-8.9.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 | ]; |
55 | 55 | \ No newline at end of file |
@@ -32,91 +32,91 @@ |
||
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 | } |