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
Mirrors.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Extensionmanager\Domain\Model
;
3
23
class
Mirrors
extends
\TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
24
30
protected
$mirrors
= array();
31
39
protected
$currentMirror
;
40
47
protected
$isRandomSelection
= TRUE;
48
56
public
function
setSelect
($mirrorId = NULL) {
57
if
(is_null($mirrorId)) {
58
$this->isRandomSelection = TRUE;
59
}
else
{
60
if
(is_int($mirrorId) && $mirrorId >= 1 && $mirrorId <= count($this->mirrors)) {
61
$this->currentMirror = $mirrorId - 1;
62
}
63
}
64
}
65
75
public
function
getMirror
() {
76
$sumMirrors = count($this->mirrors);
77
if
($sumMirrors > 0) {
78
if
(!is_int($this->currentMirror)) {
79
$this->currentMirror = rand(0, $sumMirrors - 1);
80
}
81
return
$this->mirrors[
$this->currentMirror
];
82
}
83
return
NULL;
84
}
85
91
public
function
getMirrorUrl
() {
92
$mirror = $this->
getMirror
();
93
$mirrorUrl = $mirror[
'host'
] . $mirror[
'path'
];
94
return
'https://'
. $mirrorUrl;
95
}
96
104
public
function
getMirrors
() {
105
return
$this->mirrors
;
106
}
107
115
public
function
setMirrors
(array
$mirrors
) {
116
if
(count($mirrors) >= 1) {
117
$this->mirrors =
$mirrors
;
118
}
119
}
120
121
}
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors\getMirrorUrl
getMirrorUrl()
Definition:
Mirrors.php:91
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors\getMirror
getMirror()
Definition:
Mirrors.php:75
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors\setMirrors
setMirrors(array $mirrors)
Definition:
Mirrors.php:115
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors\setSelect
setSelect($mirrorId=NULL)
Definition:
Mirrors.php:56
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors\$currentMirror
$currentMirror
Definition:
Mirrors.php:39
TYPO3\CMS\Extbase\DomainObject\AbstractEntity
Definition:
AbstractEntity.php:20
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors\$mirrors
$mirrors
Definition:
Mirrors.php:30
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors\getMirrors
getMirrors()
Definition:
Mirrors.php:104
TYPO3\CMS\Extensionmanager\Domain\Model
Definition:
ConfigurationCategory.php:2
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors
Definition:
Mirrors.php:23
TYPO3\CMS\Extensionmanager\Domain\Model\Mirrors\$isRandomSelection
$isRandomSelection
Definition:
Mirrors.php:47
typo3
sysext
extensionmanager
Classes
Domain
Model
Mirrors.php
Generated on Wed Aug 7 2019 09:52:26 for TYPO3 CMS by
1.8.13