Skip to content
Extraits de code Groupes Projets
Valider 368c1ac2 rédigé par mattab's avatar mattab
Parcourir les fichiers

Fixes #6695 show git:pull command whenever piwik is deployed from git (push...

Fixes  #6695 show git:pull command whenever piwik is deployed from git (push and commit commands are still shown in development mode only)
parent eb8ecc39
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -336,6 +336,17 @@ class SettingsPiwik
}
}
/**
* Returns true if Piwik is deployed using git
* FAQ: http://piwik.org/faq/how-to-install/faq_18271/
*
* @return bool
*/
public static function isGitDeployment()
{
return file_exists(PIWIK_INCLUDE_PATH . '/.git/HEAD');
}
public static function getCurrentGitBranch()
{
$file = PIWIK_INCLUDE_PATH . '/.git/HEAD';
......@@ -422,4 +433,5 @@ class SettingsPiwik
{
return Config::getInstance()->General['force_ssl'] == 1;
}
}
......@@ -11,6 +11,7 @@ namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Development;
use Piwik\Plugin\ConsoleCommand;
use Piwik\SettingsPiwik;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
......@@ -20,7 +21,7 @@ class GitPull extends ConsoleCommand
{
public function isEnabled()
{
return Development::isEnabled();
return SettingsPiwik::isGitDeployment();
}
protected function configure()
......
......@@ -16,6 +16,7 @@ use Piwik\Plugins\TestRunner\Aws\Instance;
use Piwik\Plugins\TestRunner\Aws\Ssh;
use Piwik\Plugins\TestRunner\Runner\InstanceLauncher;
use Piwik\Plugins\TestRunner\Runner\Remote;
use Piwik\SettingsPiwik;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
......@@ -143,7 +144,7 @@ This feature is still beta and there might be problems with pictures and/or bina
private function getCurrentGitHash()
{
// we should not use 'git' executable unless we are in a git clone
if(!file_exists(PIWIK_INCLUDE_PATH . '/.git/')) {
if(!SettingsPiwik::isGitDeployment()) {
return 'WARN: it does not look like a Piwik repository clone - you must setup Piwik from git to proceed';
}
return trim(`git rev-parse HEAD`);
......
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