TYPO3 CMS
TYPO3_6-2
Main Page
Related Pages
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
+
Files
File List
+
File Members
+
All
$
(
_
a
c
d
e
f
h
i
l
o
p
r
s
t
u
x
+
Functions
_
a
c
d
e
f
i
l
o
p
r
s
u
x
+
Variables
$
(
_
a
d
e
h
i
p
r
s
t
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
ApplicationContext.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Core\Core
;
3
35
class
ApplicationContext
{
36
42
protected
$contextString
;
43
49
protected
$rootContextString
;
50
56
protected
$parentContext
;
57
64
public
function
__construct
(
$contextString
) {
65
if
(strstr(
$contextString
,
'/'
) === FALSE) {
66
$this->rootContextString =
$contextString
;
67
$this->parentContext = NULL;
68
}
else
{
69
$contextStringParts = explode(
'/'
,
$contextString
);
70
$this->rootContextString = $contextStringParts[0];
71
array_pop($contextStringParts);
72
$this->parentContext =
new
ApplicationContext
(implode(
'/'
, $contextStringParts));
73
}
74
75
if
(!in_array($this->rootContextString, array(
'Development'
,
'Production'
,
'Testing'
))) {
76
throw
new \TYPO3\CMS\Core\Exception(
'The given context "'
.
$contextString
.
'" was not valid. Only allowed are Development, Production and Testing, including their sub-contexts'
, 1335436551);
77
}
78
79
$this->contextString =
$contextString
;
80
}
81
88
public
function
__toString
() {
89
return
$this->contextString
;
90
}
91
98
public
function
isDevelopment
() {
99
return
($this->rootContextString ===
'Development'
);
100
}
101
109
public
function
isProduction
() {
110
return
($this->rootContextString ===
'Production'
);
111
}
112
119
public
function
isTesting
() {
120
return
($this->rootContextString ===
'Testing'
);
121
}
122
129
public
function
getParent
() {
130
return
$this->parentContext
;
131
}
132
}
TYPO3\CMS\Core\Core\ApplicationContext\isDevelopment
isDevelopment()
Definition:
ApplicationContext.php:98
TYPO3\CMS\Core\Core\ApplicationContext\__construct
__construct($contextString)
Definition:
ApplicationContext.php:64
TYPO3\CMS\Core\Core\ApplicationContext\$contextString
$contextString
Definition:
ApplicationContext.php:42
TYPO3\CMS\Core\Core\ApplicationContext\isTesting
isTesting()
Definition:
ApplicationContext.php:119
TYPO3\CMS\Core\Core\ApplicationContext\getParent
getParent()
Definition:
ApplicationContext.php:129
TYPO3\CMS\Core\Core\ApplicationContext\__toString
__toString()
Definition:
ApplicationContext.php:88
TYPO3\CMS\Core\Core\ApplicationContext\isProduction
isProduction()
Definition:
ApplicationContext.php:109
TYPO3\CMS\Core\Core\ApplicationContext\$rootContextString
$rootContextString
Definition:
ApplicationContext.php:49
TYPO3\CMS\Core\Core
Definition:
ApplicationContext.php:2
TYPO3\CMS\Core\Core\ApplicationContext
Definition:
ApplicationContext.php:35
TYPO3\CMS\Core\Core\ApplicationContext\$parentContext
$parentContext
Definition:
ApplicationContext.php:56
typo3
sysext
core
Classes
Core
ApplicationContext.php
Generated on Wed Aug 7 2019 09:52:20 for TYPO3 CMS by
1.8.13