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

fixes #4934 should make it work on windows if php.exe is in path

parent 99ff035e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -622,14 +622,31 @@ class Configuration(object):
'../../misc/cron/updatetoken.php'),
)
command = ['php', updatetokenfile]
phpBinary = 'php'
is_windows = sys.platform.startswith('win')
if is_windows:
try:
processWin = subprocess.Popen('where php.exe', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
[stdout, stderr] = processWin.communicate()
if processWin.returncode == 0:
phpBinary = stdout.strip()
else:
fatal_error("We couldn't detect PHP. It might help to add your php.exe to the path or alternatively run the importer using the --login and --password option")
except:
fatal_error("We couldn't detect PHP. You can run the importer using the --login and --password option to fix this issue")
command = [phpBinary, updatetokenfile]
if self.options.enable_testmode:
command.append('--testmode')
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
command = subprocess.list2cmdline(command)
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
[stdout, stderr] = process.communicate()
if process.returncode != 0:
fatal_error("`" + ' '.join(command) + "` failed with error: " + stderr + ".\nReponse code was: " + str(process.returncode))
fatal_error("`" + command + "` failed with error: " + stderr + ".\nReponse code was: " + str(process.returncode) + ". You can alternatively run the importer using the --login and --password option")
filename = stdout
credentials = open(filename, 'r').readline()
......
Subproject commit 4f027bbf82914f27084105333d6cf48b79c21ae9
Subproject commit c9edd879003ca7a9f75d81fe07ec6ff0c2340f91
Subproject commit 72dd8092a95621026ad85d29b79c0283ed18fc04
Subproject commit f6e252d5dc5e3cf004263f7450c2ca55bd2c5a71
Subproject commit 19978cb7cd926ec0fba111ce257b8f0450f34ce8
Subproject commit 2cb15300a88f7ff2a1fc27ef633a1a1f4d5fef09
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