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
fe448b1b
Valider
fe448b1b
rédigé
8 years ago
par
mattab
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Refs #10331 #10283
parent
474fe969
Aucune branche associée trouvée
Aucune étiquette associée trouvée
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/Application/Kernel/EnvironmentValidator.php
+2
-1
2 ajouts, 1 suppression
core/Application/Kernel/EnvironmentValidator.php
piwik.php
+5
-1
5 ajouts, 1 suppression
piwik.php
tests/PHPUnit/System/EnvironmentValidationTest.php
+14
-5
14 ajouts, 5 suppressions
tests/PHPUnit/System/EnvironmentValidationTest.php
avec
21 ajouts
et
7 suppressions
core/Application/Kernel/EnvironmentValidator.php
+
2
−
1
Voir le fichier @
fe448b1b
...
...
@@ -9,6 +9,7 @@
namespace
Piwik\Application\Kernel
;
use
Piwik\Common
;
use
Piwik\Exception\NotYetInstalledException
;
use
Piwik\Filechecks
;
use
Piwik\Piwik
;
use
Piwik\SettingsPiwik
;
...
...
@@ -50,7 +51,7 @@ class EnvironmentValidator
if
(
SettingsServer
::
isTrackerApiRequest
())
{
// if Piwik is not installed yet, the piwik.php should do nothing and not return an error
throw
new
\
Exception
(
"As Piwik is not installed yet, the Tracking API will
now
exit without error."
);
throw
new
NotYetInstalled
Exception
(
"As Piwik is not installed yet, the Tracking API
cannot proceed and
will exit without error."
);
}
if
(
Common
::
isPhpCliMode
())
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
piwik.php
+
5
−
1
Voir le fichier @
fe448b1b
...
...
@@ -52,7 +52,11 @@ require_once PIWIK_INCLUDE_PATH . '/core/Cookie.php';
SettingsServer
::
setIsTrackerApiRequest
();
$environment
=
new
\Piwik\Application\Environment
(
'tracker'
);
$environment
->
init
();
try
{
$environment
->
init
();
}
catch
(
\Piwik\Exception\NotYetInstalledException
$e
)
{
die
(
$e
->
getMessage
());
}
Tracker
::
loadTrackerEnvironment
();
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
tests/PHPUnit/System/EnvironmentValidationTest.php
+
14
−
5
Voir le fichier @
fe448b1b
...
...
@@ -56,7 +56,7 @@ class EnvironmentValidationTest extends SystemTestCase
$this
->
simulateAbsentConfigFile
(
'config.ini.php'
);
$output
=
$this
->
triggerPiwikFrom
(
'tracker'
);
$this
->
assertContains
(
'As Piwik is not installed yet, the Tracking API will
now
exit without error'
,
$output
);
$this
->
assertContains
(
'As Piwik is not installed yet, the Tracking API
cannot proceed and
will exit without error
.
'
,
$output
);
}
public
function
test_NoLocalConfigFile_TriggersError_inConsole
()
...
...
@@ -191,17 +191,24 @@ class EnvironmentValidationTest extends SystemTestCase
private
function
sendRequestToTracker
()
{
return
$this
->
curl
(
Fixture
::
getRootUrl
()
.
'tests/PHPUnit/proxy/piwik.php?idsite=1&rec=1&action_name=something'
);
list
(
$response
,
$info
)
=
$this
->
curl
(
Fixture
::
getRootUrl
()
.
'tests/PHPUnit/proxy/piwik.php?idsite=1&rec=1&action_name=something'
);
// Check Tracker requests return 200
$this
->
assertEquals
(
200
,
$info
[
"http_code"
],
'Ok response'
);
return
$response
;
}
private
function
sendRequestToWeb
()
{
return
$this
->
curl
(
Fixture
::
getRootUrl
()
.
'tests/PHPUnit/proxy/index.php'
);
list
(
$response
,
$info
)
=
$this
->
curl
(
Fixture
::
getRootUrl
()
.
'tests/PHPUnit/proxy/index.php'
);
return
$response
;
}
private
function
sendArchiveWebRequest
()
{
return
$this
->
curl
(
Fixture
::
getRootUrl
()
.
'tests/PHPUnit/proxy/archive.php?token_auth='
.
Fixture
::
getTokenAuth
());
list
(
$response
,
$info
)
=
$this
->
curl
(
Fixture
::
getRootUrl
()
.
'tests/PHPUnit/proxy/archive.php?token_auth='
.
Fixture
::
getTokenAuth
());
return
$response
;
}
private
function
startConsoleProcess
()
...
...
@@ -226,8 +233,10 @@ class EnvironmentValidationTest extends SystemTestCase
$headerSize
=
curl_getinfo
(
$ch
,
CURLINFO_HEADER_SIZE
);
$response
=
substr
(
$response
,
$headerSize
);
$responseInfo
=
curl_getinfo
(
$ch
);
curl_close
(
$ch
);
return
$response
;
return
array
(
$response
,
$responseInfo
)
;
}
}
\ No newline at end of file
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