Skip to content
Extraits de code Groupes Projets
Valider d9aef0c3 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

a simple parser to get the configured username and password if possible

parent ac33e5ad
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Subproject commit 5ae55908f0aa5112ec9bf4e2913c3a9fc680cfd7 Subproject commit 978394246973b7ad97ae41df6b83cb3ab08a7b93
...@@ -163,6 +163,35 @@ TestingEnvironment.prototype.setupFixture = function (fixtureClass, done) { ...@@ -163,6 +163,35 @@ TestingEnvironment.prototype.setupFixture = function (fixtureClass, done) {
}); });
}; };
TestingEnvironment.prototype.readDbInfoFromConfig = function () {
var username = 'root';
var password = '';
var pathConfigIni = path.join(PIWIK_INCLUDE_PATH, "/config/config.ini.php");
var configFile = fs.read(pathConfigIni);
if (configFile) {
var match = ('' + configFile).match(/password\s?=\s?"(.*)"/);
if (match && match.length) {
password = match[1];
}
match = ('' + configFile).match(/username\s?=\s?"(.*)"/);
if (match && match.length) {
username = match[1];
}
}
return {
username: username,
password: password
}
};
TestingEnvironment.prototype.teardownFixture = function (fixtureClass, done) { TestingEnvironment.prototype.teardownFixture = function (fixtureClass, done) {
if (options['persist-fixture-data'] if (options['persist-fixture-data']
|| !fixtureClass || !fixtureClass
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter