Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
S
stats-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
stats-facil
Validations
fa4ae233
Valider
fa4ae233
rédigé
il y a 10 ans
par
sgiehl
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
fixed device detector cache; added fallback for old windows short codes
parent
20c994ca
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Étiquettes contenant la validation
Aucune requête de fusion associée trouvée
Modifications
3
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
core/DeviceDetectorCache.php
+24
-3
24 ajouts, 3 suppressions
core/DeviceDetectorCache.php
plugins/DevicesDetection/Visitor.php
+1
-1
1 ajout, 1 suppression
plugins/DevicesDetection/Visitor.php
plugins/DevicesDetection/functions.php
+13
-0
13 ajouts, 0 suppression
plugins/DevicesDetection/functions.php
avec
38 ajouts
et
4 suppressions
core/DeviceDetectorCache.php
+
24
−
3
Voir le fichier @
fa4ae233
...
@@ -18,7 +18,7 @@ use Exception;
...
@@ -18,7 +18,7 @@ use Exception;
*
*
* Static caching speeds up multiple detections in one request, which is the case when sending bulk requests
* Static caching speeds up multiple detections in one request, which is the case when sending bulk requests
*/
*/
class
DeviceDetectorCache
implements
\DeviceDetector\Cache\Cache
Interface
class
DeviceDetectorCache
implements
\DeviceDetector\Cache\Cache
{
{
protected
static
$staticCache
=
array
();
protected
static
$staticCache
=
array
();
...
@@ -37,7 +37,7 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\CacheInterface
...
@@ -37,7 +37,7 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\CacheInterface
* @param string $id The cache entry ID
* @param string $id The cache entry ID
* @return array|bool False on error, or array the cache content
* @return array|bool False on error, or array the cache content
*/
*/
public
function
g
et
(
$id
)
public
function
f
et
ch
(
$id
)
{
{
if
(
empty
(
$id
))
{
if
(
empty
(
$id
))
{
return
false
;
return
false
;
...
@@ -58,7 +58,7 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\CacheInterface
...
@@ -58,7 +58,7 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\CacheInterface
* @throws \Exception
* @throws \Exception
* @return bool True if the entry was succesfully stored
* @return bool True if the entry was succesfully stored
*/
*/
public
function
se
t
(
$id
,
$content
)
public
function
s
av
e
(
$id
,
$content
,
$ttl
=
0
)
{
{
if
(
empty
(
$id
))
{
if
(
empty
(
$id
))
{
return
false
;
return
false
;
...
@@ -69,4 +69,25 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\CacheInterface
...
@@ -69,4 +69,25 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\CacheInterface
return
$this
->
cache
->
save
(
$id
,
$content
,
$this
->
ttl
);
return
$this
->
cache
->
save
(
$id
,
$content
,
$this
->
ttl
);
}
}
public
function
contains
(
$id
)
{
return
!
empty
(
self
::
$staticCache
[
$id
])
&&
$this
->
cache
->
contains
(
$id
);
}
public
function
delete
(
$id
)
{
if
(
empty
(
$id
))
{
return
false
;
}
unset
(
self
::
$staticCache
[
$id
]);
return
$this
->
cache
->
delete
(
$id
);
}
public
function
flushAll
()
{
return
$this
->
cache
->
flushAll
();
}
}
}
Ce diff est replié.
Cliquez pour l'agrandir.
plugins/DevicesDetection/Visitor.php
+
1
−
1
Voir le fichier @
fa4ae233
...
@@ -31,7 +31,7 @@ class Visitor
...
@@ -31,7 +31,7 @@ class Visitor
public
function
getOperatingSystem
()
public
function
getOperatingSystem
()
{
{
return
getOsFullName
(
$this
->
details
[
'config_os'
]);
return
getOsFullName
(
$this
->
details
[
'config_os'
]
.
";"
.
$this
->
details
[
'config_os_version'
]
);
}
}
public
function
getOperatingSystemIcon
()
public
function
getOperatingSystemIcon
()
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
plugins/DevicesDetection/functions.php
+
13
−
0
Voir le fichier @
fa4ae233
...
@@ -240,6 +240,19 @@ function _mapLegacyOsShortCodes($shortCode)
...
@@ -240,6 +240,19 @@ function _mapLegacyOsShortCodes($shortCode)
'DSI'
=>
'NDS'
,
// Nintendo DSi => Nintendo Mobile
'DSI'
=>
'NDS'
,
// Nintendo DSi => Nintendo Mobile
'PSV'
=>
'PSP'
,
// PlayStation Vita => PlayStation Portable
'PSV'
=>
'PSP'
,
// PlayStation Vita => PlayStation Portable
'MAE'
=>
'SMG'
,
// Maemo => MeeGo
'MAE'
=>
'SMG'
,
// Maemo => MeeGo
'W10'
=>
'WIN'
,
'W2K'
=>
'WIN'
,
'W31'
=>
'WIN'
,
'WI7'
=>
'WIN'
,
'WI8'
=>
'WIN'
,
'W81'
=>
'WIN'
,
'W95'
=>
'WIN'
,
'W98'
=>
'WIN'
,
'WME'
=>
'WIN'
,
'WNT'
=>
'WIN'
,
'WS3'
=>
'WIN'
,
'WVI'
=>
'WIN'
,
'WXP'
=>
'WIN'
,
//'VMS' => '', // OpenVMS => ??
//'VMS' => '', // OpenVMS => ??
);
);
return
array_key_exists
(
$shortCode
,
$legacyShortCodes
)
?
$legacyShortCodes
[
$shortCode
]
:
$shortCode
;
return
array_key_exists
(
$shortCode
,
$legacyShortCodes
)
?
$legacyShortCodes
[
$shortCode
]
:
$shortCode
;
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter