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
0563a808
Valider
0563a808
rédigé
11 years ago
par
mattab
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Fixing last test
parent
469aa03f
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
core/Tracker.php
+18
-31
18 ajouts, 31 suppressions
core/Tracker.php
piwik.php
+1
-1
1 ajout, 1 suppression
piwik.php
avec
19 ajouts
et
32 suppressions
core/Tracker.php
+
18
−
31
Voir le fichier @
0563a808
...
...
@@ -212,6 +212,7 @@ class Piwik_Tracker
try
{
if
(
$this
->
isVisitValid
())
{
self
::
connectDatabaseIfNotConnected
();
$visit
=
$this
->
getNewVisitObject
();
...
...
@@ -226,6 +227,7 @@ class Piwik_Tracker
printDebug
(
"The request is invalid: empty request, or maybe tracking is disabled in the config.ini.php via record_statistics=0"
);
}
}
catch
(
Piwik_Tracker_Db_Exception
$e
)
{
$this
->
outputTransparentGif
();
printDebug
(
"<b>"
.
$e
->
getMessage
()
.
"</b>"
);
$this
->
exitWithException
(
$e
,
$isAuthenticated
);
}
catch
(
Piwik_Tracker_Visit_Excluded
$e
)
{
...
...
@@ -373,19 +375,29 @@ class Piwik_Tracker
if
(
$this
->
usingBulkTracking
)
{
// when doing bulk tracking we return JSON so the caller will know how many succeeded
$result
=
array
(
'succeeded'
=>
$this
->
countOfLoggedRequests
);
// send error when in debug mode or when authenticated (which happens when doing log importing,
// for example)
if
((
isset
(
$GLOBALS
[
'PIWIK_TRACKER_DEBUG'
])
&&
$GLOBALS
[
'PIWIK_TRACKER_DEBUG'
])
||
$authenticated
)
{
$result
[
'error'
]
=
Piwik_Tracker_GetErrorMessage
(
$e
);
}
echo
Piwik_Common
::
json_encode
(
$result
);
exit
;
}
if
(
isset
(
$GLOBALS
[
'PIWIK_TRACKER_DEBUG'
])
&&
$GLOBALS
[
'PIWIK_TRACKER_DEBUG'
])
{
Piwik_Common
::
sendHeader
(
'Content-Type: text/html; charset=utf-8'
);
$trailer
=
'<span style="color: #888888">Backtrace:<br /><pre>'
.
$e
->
getTraceAsString
()
.
'</pre></span>'
;
$headerPage
=
file_get_contents
(
PIWIK_INCLUDE_PATH
.
'/plugins/Zeitgeist/templates/simpleLayoutHeader.tpl'
);
$footerPage
=
file_get_contents
(
PIWIK_INCLUDE_PATH
.
'/plugins/Zeitgeist/templates/simpleLayoutFooter.tpl'
);
$headerPage
=
str_replace
(
'{$HTML_TITLE}'
,
'Piwik › Error'
,
$headerPage
);
echo
$headerPage
.
'<p>'
.
Piwik_Tracker_GetErrorMessage
(
$e
)
.
'</p>'
.
$trailer
.
$footerPage
;
}
// If not debug, but running authenticated (eg. during log import) then we display raw errors
elseif
(
$authenticated
)
{
Piwik_Common
::
sendHeader
(
'Content-Type: text/html; charset=utf-8'
);
echo
Piwik_Tracker_GetErrorMessage
(
$e
);
}
else
{
Piwik_Tracker_ExitWithException
(
$e
,
$authenticated
);
$this
->
outputTransparentGif
(
);
}
exit
;
}
/**
...
...
@@ -431,7 +443,7 @@ class Piwik_Tracker
case
self
::
STATE_NOSCRIPT_REQUEST
:
case
self
::
STATE_NOTHING_TO_NOTICE
:
default
:
$this
->
outputTransparentGif
();
$this
->
outputTransparentGif
();
printDebug
(
"Nothing to notice => default behaviour"
);
break
;
}
...
...
@@ -749,28 +761,3 @@ function Piwik_Tracker_GetErrorMessage($e)
return
$e
->
getMessage
();
}
}
/**
* Displays exception in a friendly UI and exits.
*
* @param Exception $e
* @param bool $authenticated
*/
function
Piwik_Tracker_ExitWithException
(
$e
,
$authenticated
=
false
)
{
Piwik_Common
::
sendHeader
(
'Content-Type: text/html; charset=utf-8'
);
if
(
isset
(
$GLOBALS
[
'PIWIK_TRACKER_DEBUG'
])
&&
$GLOBALS
[
'PIWIK_TRACKER_DEBUG'
])
{
$trailer
=
'<span style="color: #888888">Backtrace:<br /><pre>'
.
$e
->
getTraceAsString
()
.
'</pre></span>'
;
$headerPage
=
file_get_contents
(
PIWIK_INCLUDE_PATH
.
'/plugins/Zeitgeist/templates/simpleLayoutHeader.tpl'
);
$footerPage
=
file_get_contents
(
PIWIK_INCLUDE_PATH
.
'/plugins/Zeitgeist/templates/simpleLayoutFooter.tpl'
);
$headerPage
=
str_replace
(
'{$HTML_TITLE}'
,
'Piwik › Error'
,
$headerPage
);
echo
$headerPage
.
'<p>'
.
Piwik_Tracker_GetErrorMessage
(
$e
)
.
'</p>'
.
$trailer
.
$footerPage
;
}
// If not debug, but running authenticated (eg. during log import) then we display raw errors
elseif
(
$authenticated
)
{
echo
Piwik_Tracker_GetErrorMessage
(
$e
);
}
exit
;
}
Ce diff est replié.
Cliquez pour l'agrandir.
piwik.php
+
1
−
1
Voir le fichier @
0563a808
...
...
@@ -7,7 +7,7 @@
*
* @package Piwik
*/
$GLOBALS
[
'PIWIK_TRACKER_DEBUG'
]
=
!
false
;
$GLOBALS
[
'PIWIK_TRACKER_DEBUG'
]
=
false
;
$GLOBALS
[
'PIWIK_TRACKER_DEBUG_FORCE_SCHEDULED_TASKS'
]
=
false
;
define
(
'PIWIK_ENABLE_TRACKING'
,
true
);
...
...
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