// Installer optimization

This commit is contained in:
Damien Metzger
2013-11-18 12:12:14 +01:00
parent 68c8e9da57
commit 5ef4b8eddc
7 changed files with 151 additions and 9 deletions

View File

@@ -321,13 +321,16 @@ abstract class InstallControllerHttp
*/
public function getPhone()
{
if (InstallSession::getInstance()->support_phone != null)
return InstallSession::getInstance()->support_phone;
if ($this->phone === null)
{
$this->phone = $this->language->getInformation('phone', false);
if ($iframe = Tools::file_get_contents('http://api.prestashop.com/iframe/install.php?lang='.$this->language->getLanguageIso()))
if ($iframe = Tools::file_get_contents('http://api.prestashop.com/iframe/install.php?lang='.$this->language->getLanguageIso(), false, null, 3))
if (preg_match('/<img.+alt="([^"]+)".*>/Ui', $iframe, $matches) && isset($matches[1]))
$this->phone = $matches[1];
}
InstallSession::getInstance()->support_phone = $this->phone;
return $this->phone;
}