From d908da46cb0bb9a79cca6809033d37b2b07e1e1a Mon Sep 17 00:00:00 2001 From: Taras Machyshyn Date: Wed, 17 Sep 2014 17:31:49 +0300 Subject: [PATCH] add helper about RewriteBase into .htaccess --- install/core/Installer.php | 1 - install/core/SystemHelper.php | 40 ++++++++++++++++++++++------ install/core/i18n/de_DE/install.json | 5 ++-- install/core/i18n/en_US/install.json | 5 ++-- install/core/i18n/es_ES/install.json | 7 ++--- install/core/i18n/fr_FR/install.json | 5 ++-- install/core/i18n/nl_NL/install.json | 5 ++-- install/core/i18n/pl_PL/install.json | 5 ++-- install/core/i18n/ro_RO/install.json | 5 ++-- install/core/i18n/tr_TR/install.json | 7 ++--- install/core/i18n/vi_VN/install.json | 5 ++-- install/core/tpl/errors.tpl | 1 + install/core/tpl/step3.tpl | 1 + install/index.php | 2 +- install/js/install.js | 29 +++++++++++++++++--- 15 files changed, 90 insertions(+), 33 deletions(-) diff --git a/install/core/Installer.php b/install/core/Installer.php index 67b0ec060f..cd3a454a85 100644 --- a/install/core/Installer.php +++ b/install/core/Installer.php @@ -99,7 +99,6 @@ class Installer return $this->getConfig()->get('version'); } - protected function auth() { if (!$this->isAuth) { diff --git a/install/core/SystemHelper.php b/install/core/SystemHelper.php index 74cb6f8fa8..a2d2581c80 100644 --- a/install/core/SystemHelper.php +++ b/install/core/SystemHelper.php @@ -26,6 +26,7 @@ class SystemHelper extends \Espo\Core\Utils\System protected $requirements = array( 'phpVersion' => '5.4', + 'MySQLVersion' => '5.1', 'exts' => array( 'json', @@ -34,7 +35,9 @@ class SystemHelper extends \Espo\Core\Utils\System ), ); - protected $modRewriteUrl = '/api/v1/Metadata'; + protected $apiPath = '/api/v1'; + + protected $modRewriteUrl = '/Metadata'; protected $writableDir = 'data'; @@ -55,7 +58,6 @@ class SystemHelper extends \Espo\Core\Utils\System return $this->writableDir; } - public function checkRequirements() { $result['success'] = true; @@ -77,6 +79,17 @@ class SystemHelper extends \Espo\Core\Utils\System return $result; } + protected function getMySQLVersion($pdoConnection) + { + $sth = $pdoConnection->prepare("SHOW VARIABLES LIKE 'version'"); + $sth->execute(); + $res = $sth->fetch(PDO::FETCH_NUM); + + $version = empty($res[1]) ? null : $res[1]; + + return $version; + } + public function checkDbConnection($hostName, $port, $dbUserName, $dbUserPass, $dbName, $dbDriver = 'pdo_mysql', $isCreateDatabase = true) { $result['success'] = true; @@ -98,7 +111,6 @@ class SystemHelper extends \Espo\Core\Utils\System try { $dsn = "mysql:host={$hostName};" . ((!empty($port)) ? "port={$port};" : '') . "dbname={$dbName}"; $dbh = new PDO($dsn, $dbUserName, $dbUserPass); - $dbh = null; } catch (PDOException $e) { $result['errors']['dbConnect']['errorCode'] = $e->getCode(); @@ -106,9 +118,18 @@ class SystemHelper extends \Espo\Core\Utils\System $result['success'] = false; } - /** try to create a database */ - if ($isCreateDatabase && !$result['success'] && $result['errors']['dbConnect']['errorCode'] == '1049') { + /** Check MySQL Version */ + if ($result['success']) { + $currentMySQLVersion = $this->getMySQLVersion($dbh); + if (isset($currentMySQLVersion) && version_compare($currentMySQLVersion, $this->requirements['MySQLVersion']) == -1) { + $result['errors']['MySQLVersion'] = $this->requirements['MySQLVersion']; + $result['success'] = false; + } + } + /** try to create a database */ + if ($isCreateDatabase && !$result['success'] && $result['errors']['dbConnect']['errorCode'] == '1049') + { $dsn = "mysql:host={$hostName};" . ((!empty($port)) ? "port={$port}" : ''); $pdo = new PDO($dsn, $dbUserName, $dbUserPass); @@ -125,8 +146,6 @@ class SystemHelper extends \Espo\Core\Utils\System } /** END: try to create a database */ - - break; } @@ -148,9 +167,14 @@ class SystemHelper extends \Espo\Core\Utils\System return $baseUrl; } + public function getApiPath() + { + return $this->apiPath; + } + public function getModRewriteUrl() { - return $this->modRewriteUrl; + return $this->apiPath . $this->modRewriteUrl; } public function getChownCommand($path, $isSudo = false, $isCd = true) diff --git a/install/core/i18n/de_DE/install.json b/install/core/i18n/de_DE/install.json index f58e194158..a7d6d4ada6 100644 --- a/install/core/i18n/de_DE/install.json +++ b/install/core/i18n/de_DE/install.json @@ -64,6 +64,7 @@ "Bad init Permission": "Zugriff verweigert für Verzeichnis \"{*}\". Bitte setzen Sie 775 für \"{*}\" oder führen Sie dieses Kommando in einem Terminal Fenster aus
{C}<\/b><\/pre> Operation nicht erlaubt? Versuchen Sie das: {CSU}",
 		"Some errors occurred!": "Es sind Fehler passiert!",
 		"phpVersion": "Ihre PHP Version wird von EspoCRM nicht unterstützt. Bitte aktualisieren Sie zumindest auf {minVersion}",
+		"MySQLVersion": "Ihre MySQL Version wird von EspoCRM nicht unterstützt. Bitte aktualisieren Sie zumindest auf {minVersion}",
 		"The PHP extension was not found...": "Die {extName}<\/b> PHP Erweiterung wurde nicht gefunden...",
 		"All Settings correct": "Alle Einstellungen sind korrekt",
 		"Failed to connect to database": "Konnte nicht zur Datenbank verbinden",
@@ -96,7 +97,7 @@
 		},
 		"modRewriteInstruction": {
 			"apache": {
-				"linux": "

Für die .htaccess Unterstützung ändern\/ergänzen Sie die Server Einstellungen innerhalb der <VirtualHost> Sektion (httpd.conf):
<Directory \/PATH_TO_ESPO\/> AllowOverride All<\/b> <\/Directory><\/pre>Dann führen Sie dieses Kommando in einem Terminalfenster aus:
service apache2 restart<\/b><\/pre>
Um \"mod_rewrite\" zu aktivieren führen Sie diese Kommandos in einem Terminalfenster aus:
a2enmod rewrite 
service apache2 restart<\/b><\/pre>", + "linux": "

Um die RewriteBase Pfad hinzufügen, öffnen Sie eine Datei {API_PATH}.htaccess und ändern Sie die folgende Zeile:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

Für die .htaccess Unterstützung ändern\/ergänzen Sie die Server Einstellungen innerhalb der <VirtualHost> Sektion (httpd.conf):
<Directory \/PATH_TO_ESPO\/> AllowOverride All<\/b> <\/Directory><\/pre>Dann führen Sie dieses Kommando in einem Terminalfenster aus:
service apache2 restart<\/b><\/pre>
Um \"mod_rewrite\" zu aktivieren führen Sie diese Kommandos in einem Terminalfenster aus:
a2enmod rewrite 
service apache2 restart<\/b><\/pre>", "windows": "
1. Finden Sie die httpd.conf Datei (normalerweise in einem Verzeichnis conf, config oder ähnlich)
2. Innerhalb der httpd.conf Datei aktivieren Sie die Zeile LoadModule rewrite_module modules\/mod_rewrite.so (entfernen Sie das # Zeichen vom Anfang der Zeile)
3. Stellen Sie sicher, dass die Zeile ClearModuleList nicht auskommentiert ist, genauso wie die Zeile AddModule mod_rewrite.c. <\/pre>" }, "microsoft-iis": { @@ -104,7 +105,7 @@ } }, "modRewriteHelp": { - "apache": "API Fehler: EspoCRM API nicht verfügbar
Mögliches Problem: deaktiviertes \"mod_rewrite\" des Apache Servers oder des .htaccess Supports.", + "apache": "API Fehler: EspoCRM API nicht verfügbar
Mögliches Problem: RewriteBase erforderlich, deaktiviertes \"mod_rewrite\" des Apache Servers oder des .htaccess Supports.", "nginx": "API Error: EspoCRM API nicht verfügbar.
Fügen Sie diesen Code zu Nginx Host Config (innerhalb des \"server\" Blocks) hinzu:
 {0} <\/pre>",
 			"microsoft-iis": "API Fehler: EspoCRM API nicht verfügbar
Mögliches Problem: deaktiviertes \"URL Rewrite\". Bitte überprüfen und aktivieren Sie das \"URL Rewrite\" Modul im IIS Server.", "default": "API Fehler: EspoCRM API nicht verfügbar
Mögliches Problem: deaktiviertes Rewrite Modul. Bitte überprüfen und aktivieren Sie das Rewrite Modul (z.B. mod_rewrite im Apache Server) und die .htaccess Unterstützung." diff --git a/install/core/i18n/en_US/install.json b/install/core/i18n/en_US/install.json index 726f9a999f..2f7a8543c8 100644 --- a/install/core/i18n/en_US/install.json +++ b/install/core/i18n/en_US/install.json @@ -64,6 +64,7 @@ "Bad init Permission": "Permission denied for \"{*}\" directory. Please set 775 for \"{*}\" or just execute this command in the terminal
{C}
\n\tOperation not permitted? Try this one: {CSU}", "Some errors occurred!": "Some errors occurred!", "phpVersion": "Your PHP version is not supported by EspoCRM, please update to PHP {minVersion} at least", + "MySQLVersion": "Your MySQL version is not supported by EspoCRM, please update to MySQL {minVersion} at least", "The PHP extension was not found...": "PHP Error: Extension {extName} is not found.", "All Settings correct": "All Settings are correct", "Failed to connect to database": "Failed to connect to database", @@ -96,7 +97,7 @@ }, "modRewriteInstruction": { "apache": { - "linux": "

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", + "linux": "

To add the RewriteBase path, open a file {API_PATH}.htaccess and change the following line:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", "windows": "
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
\n2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
\n3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.\n
" }, "microsoft-iis": { @@ -104,7 +105,7 @@ } }, "modRewriteHelp": { - "apache": "API Error: EspoCRM API unavailable.
Possible problems: disabled \"mod_rewrite\" in Apache server or .htaccess support.", + "apache": "API Error: EspoCRM API unavailable.
Possible problems: RewriteBase required, disabled \"mod_rewrite\" in Apache server or .htaccess support.", "nginx": "API Error: EspoCRM API unavailable.
Add this code to your Nginx Host Config (inside \"server\" block):
\n
\n{0}\n
", "microsoft-iis": "API Error: EspoCRM API unavailable.
Possible problem: disabled \"URL Rewrite\". Please check and enable \"URL Rewrite\" Module in IIS server", "default": "API Error: EspoCRM API unavailable.
Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support." diff --git a/install/core/i18n/es_ES/install.json b/install/core/i18n/es_ES/install.json index 11ae7b8ff9..19bfa7d2de 100644 --- a/install/core/i18n/es_ES/install.json +++ b/install/core/i18n/es_ES/install.json @@ -62,7 +62,8 @@ "messages": { "Bad init Permission": "Permission denied for \"{*}\" directory. Please set 775 for \"{*}\" or just execute this command in the terminal
{C}
\n\tOperation not permitted? Try this one: {CSU}", "Some errors occurred!": "Some errors occurred!", - "phpVersion": "PHP version should be >= {minVersion}", + "phpVersion": "Your PHP version is not supported by EspoCRM, please update to PHP {minVersion} at least", + "MySQLVersion": "Your MySQL version is not supported by EspoCRM, please update to MySQL {minVersion} at least", "The PHP extension was not found...": "PHP Error: Extension {extName} is not found.", "All Settings correct": "All Settings are correct", "Failed to connect to database": "Failed to connect to database", @@ -95,7 +96,7 @@ }, "modRewriteInstruction": { "apache": { - "linux": "

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", + "linux": "

To add the RewriteBase path, open a file {API_PATH}.htaccess and change the following line:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", "windows": "
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
\n2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
\n3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.\n
" }, "microsoft-iis": { @@ -103,7 +104,7 @@ } }, "modRewriteHelp": { - "apache": "API Error: EspoCRM API unavailable.
Possible problems: disabled \"mod_rewrite\" in Apache server or .htaccess support.", + "apache": "API Error: EspoCRM API unavailable.
Possible problems: RewriteBase required, disabled \"mod_rewrite\" in Apache server or .htaccess support.", "nginx": "API Error: EspoCRM API unavailable.
Add this code to your Nginx Host Config (inside \"server\" block):
\n
\n{0}\n
", "microsoft-iis": "API Error: EspoCRM API unavailable.
Possible problem: disabled \"URL Rewrite\". Please check and enable \"URL Rewrite\" Module in IIS server", "default": "API Error: EspoCRM API unavailable.
Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support." diff --git a/install/core/i18n/fr_FR/install.json b/install/core/i18n/fr_FR/install.json index e658351ad3..ec809d2d69 100644 --- a/install/core/i18n/fr_FR/install.json +++ b/install/core/i18n/fr_FR/install.json @@ -64,6 +64,7 @@ "Bad init Permission": "Permission denied for \"{*}\" directory. Please set 775 for \"{*}\" or just execute this command in the terminal
{C}
\n\tOperation not permitted? Try this one: {CSU}", "Some errors occurred!": "Des erreurs se sont produites !", "phpVersion": "Your PHP version is not supported by EspoCRM, please update to PHP {minVersion} at least", + "MySQLVersion": "Your MySQL version is not supported by EspoCRM, please update to MySQL {minVersion} at least", "The PHP extension was not found...": "L'extension PHP {extName} est introuvable...", "All Settings correct": "Les Paramètres sont corrects", "Failed to connect to database": "Impossible de connecter la base de donnée", @@ -96,7 +97,7 @@ }, "modRewriteInstruction": { "apache": { - "linux": "

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", + "linux": "

To add the RewriteBase path, open a file {API_PATH}.htaccess and change the following line:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", "windows": "
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
\n2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
\n3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.\n
" }, "microsoft-iis": { @@ -104,7 +105,7 @@ } }, "modRewriteHelp": { - "apache": "API Error: EspoCRM API unavailable.
Possible problems: disabled \"mod_rewrite\" in Apache server or .htaccess support.", + "apache": "API Error: EspoCRM API unavailable.
Possible problems: RewriteBase required, disabled \"mod_rewrite\" in Apache server or .htaccess support.", "nginx": "API Error: EspoCRM API unavailable.
Add this code to your Nginx Host Config (inside \"server\" block):
\n
\n{0}\n
", "microsoft-iis": "API Error: EspoCRM API unavailable.
Possible problem: disabled \"URL Rewrite\". Please check and enable \"URL Rewrite\" Module in IIS server", "default": "API Error: EspoCRM API unavailable.
Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support." diff --git a/install/core/i18n/nl_NL/install.json b/install/core/i18n/nl_NL/install.json index 2a48121d5c..0e0fc89667 100644 --- a/install/core/i18n/nl_NL/install.json +++ b/install/core/i18n/nl_NL/install.json @@ -64,6 +64,7 @@ "Bad init Permission": "Permission denied for \"{*}\" directory. Please set 775 for \"{*}\" or just execute this command in the terminal
{C}
\n\tOperation not permitted? Try this one: {CSU}", "Some errors occurred!": "Er zijn fouten gevonden!", "phpVersion": "Uw PHP versie wordt niet ondersteund door EspoCRM, u moet minimaal updaten naar PHP {minVersion}", + "MySQLVersion": "Uw MySQL versie wordt niet ondersteund door EspoCRM, u moet minimaal updaten naar MySQL {minVersion}", "The PHP extension was not found...": "PHP Error: Extension {extName} is not found.", "All Settings correct": "Alle Instellingen zijn juist", "Failed to connect to database": "Kan geen verbinding maken met de database", @@ -96,7 +97,7 @@ }, "modRewriteInstruction": { "apache": { - "linux": "

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", + "linux": "

To add the RewriteBase path, open a file {API_PATH}.htaccess and change the following line:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", "windows": "
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
\n2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
\n3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.\n
" }, "microsoft-iis": { @@ -104,7 +105,7 @@ } }, "modRewriteHelp": { - "apache": "API Error: EspoCRM API niet beschikbaar.
Mogelijke Oorzaak: disabled \"mod_rewrite\" in Apache server of .htaccess ondersteuning.", + "apache": "API Error: EspoCRM API niet beschikbaar.
Mogelijke Oorzaak: RewriteBase vereist, disabled \"mod_rewrite\" in Apache server of .htaccess ondersteuning.", "nginx": "API Error: EspoCRM API unavailable.
Add this code to your Nginx Host Config (inside \"server\" block):
\n
\n{0}\n
", "microsoft-iis": "API Error: EspoCRM API niet beschikbaar.
Mogelijk probleem: disabled \"URL Rewrite\". Controleer en activeer \"URL Rewrite\" Module in IIS server", "default": "API Error: EspoCRM API unavailable.
Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support." diff --git a/install/core/i18n/pl_PL/install.json b/install/core/i18n/pl_PL/install.json index 4af6f65bcf..fb2c82f120 100644 --- a/install/core/i18n/pl_PL/install.json +++ b/install/core/i18n/pl_PL/install.json @@ -64,6 +64,7 @@ "Bad init Permission": "Permission denied for \"{*}\" directory. Please set 775 for \"{*}\" or just execute this command in the terminal
{C}
\n\tOperation not permitted? Try this one: {CSU}", "Some errors occurred!": "Wystapiły błędy!", "phpVersion": "Wersja PHP nie jest wspierana przez EspoCRM, proszę wykonać aktualizację do minimalnej wersji PHP {minVersion}", + "MySQLVersion": "Wersja MySQL nie jest wspierana przez EspoCRM, proszę wykonać aktualizację do minimalnej wersji MySQL {minVersion}", "The PHP extension was not found...": "PHP Error: Extension {extName} is not found.", "All Settings correct": "Wszystkie ustwienia są poprawne", "Failed to connect to database": "Błąd połączenia z bazą danych", @@ -96,7 +97,7 @@ }, "modRewriteInstruction": { "apache": { - "linux": "

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", + "linux": "

To add the RewriteBase path, open a file {API_PATH}.htaccess and change the following line:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", "windows": "
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
\n2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
\n3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.\n
" }, "microsoft-iis": { @@ -104,7 +105,7 @@ } }, "modRewriteHelp": { - "apache": "Błąd API: API jest nie dostępne.
Pradwdopodobnie: wyłączyłeś \"mod_rewrite\" w serwerze Apache lub .htaccess.", + "apache": "Błąd API: API jest nie dostępne.
Pradwdopodobnie: wymagane RewriteBase, wyłączyłeś \"mod_rewrite\" w serwerze Apache lub .htaccess.", "nginx": "API Error: EspoCRM API unavailable.
Add this code to your Nginx Host Config (inside \"server\" block):
\n
\n{0}\n
", "microsoft-iis": "Błąd API: API jest nie dostepne.
Pradopodobnie: wyłączyłeś \"URL Rewrite\". Proszę sprawdź i włącz \"URL Rewrite\" Moduł w IIS serwer", "default": "API Error: EspoCRM API unavailable.
Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support." diff --git a/install/core/i18n/ro_RO/install.json b/install/core/i18n/ro_RO/install.json index ba1fa882ff..0b7cf81fa6 100644 --- a/install/core/i18n/ro_RO/install.json +++ b/install/core/i18n/ro_RO/install.json @@ -64,6 +64,7 @@ "Bad init Permission": "Permission denied for \"{*}\" directory. Please set 775 for \"{*}\" or just execute this command in the terminal
{C}
\n\tOperation not permitted? Try this one: {CSU}", "Some errors occurred!": "Am intampinat erori!", "phpVersion": "Your PHP version is not supported by EspoCRM, please update to PHP {minVersion} at least", + "MySQLVersion": "Your MySQL version is not supported by EspoCRM, please update to MySQL {minVersion} at least", "The PHP extension was not found...": "PHP Error: Extension {extName} is not found.", "All Settings correct": "Toate setarile sunt corecte", "Failed to connect to database": "Nu s-a reusit conectarea la Baza de Date", @@ -96,7 +97,7 @@ }, "modRewriteInstruction": { "apache": { - "linux": "

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", + "linux": "

To add the RewriteBase path, open a file {API_PATH}.htaccess and change the following line:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", "windows": "
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
\n2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
\n3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.\n
" }, "microsoft-iis": { @@ -104,7 +105,7 @@ } }, "modRewriteHelp": { - "apache": "Eroare API: API-ul EspoCRM nu este valabil.
Probleme posibile: este dezactivat \"mod_rewrite\" in server-ul Apache, sau in .htaccess.", + "apache": "Eroare API: API-ul EspoCRM nu este valabil.
Probleme posibile: RewriteBase necesar, este dezactivat \"mod_rewrite\" in server-ul Apache, sau in .htaccess.", "nginx": "API Error: EspoCRM API unavailable.
Add this code to your Nginx Host Config (inside \"server\" block):
\n
\n{0}\n
", "microsoft-iis": "Eroare API: API-ul EspoCRM nu este valabil.
Probleme posibile: este dezactivat \"URL Rewrite\". Verificati si activati modulul \"URL Rewrite\" in server-ul IIS", "default": "API Error: EspoCRM API unavailable.
Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support." diff --git a/install/core/i18n/tr_TR/install.json b/install/core/i18n/tr_TR/install.json index a682174600..248aacf4c1 100644 --- a/install/core/i18n/tr_TR/install.json +++ b/install/core/i18n/tr_TR/install.json @@ -62,7 +62,8 @@ "messages": { "Bad init Permission": "Permission denied for \"{*}\" directory. Please set 775 for \"{*}\" or just execute this command in the terminal
{C}<\/b><\/pre>\n\tOperation not permitted? Try this one: {CSU}",
 		"Some errors occurred!": "Bazı hatalar oluştu!",
-		"Supported php version >=": "Desteklenen Php Sürümü >=",
+		"phpVersion": "Your PHP version is not supported by EspoCRM, please update to PHP {minVersion} at least",
+		"MySQLVersion": "Your MySQL version is not supported by EspoCRM, please update to MySQL {minVersion} at least",
 		"The PHP extension was not found...": "{extName}<\/b> PHP eklentisi bulunamadı...",
 		"All Settings correct": "Tüm ayarlar doğru",
 		"Failed to connect to database": "Veritabanına bağlanma başarısız oldu",
@@ -95,7 +96,7 @@
 		},
 		"modRewriteInstruction": {
 			"apache": {
-				"linux": "

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory \/PATH_TO_ESPO\/>\n AllowOverride All<\/b>\n<\/Directory><\/pre>\n Afterwards run this command in a Terminal:
service apache2 restart<\/b><\/pre>
To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart<\/b><\/pre>", + "linux": "

To add the RewriteBase path, open a file {API_PATH}.htaccess and change the following line:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", "windows": "
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
\n2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules\/mod_rewrite.so (remove the pound '#' sign from in front of the line)
\n3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.\n<\/pre>" }, "microsoft-iis": { @@ -103,7 +104,7 @@ } }, "modRewriteHelp": { - "apache": "API Error: EspoCRM API unavailable.
Possible problems: disabled \"mod_rewrite\" in Apache server or .htaccess support.", + "apache": "API Error: EspoCRM API unavailable.
Possible problems: RewriteBase required, disabled \"mod_rewrite\" in Apache server or .htaccess support.", "nginx": "API Error: EspoCRM API unavailable.
Add this code to your Nginx Host Config (inside \"server\" block):
\n
\n{0}\n
", "microsoft-iis": "API Error: EspoCRM API unavailable.
Possible problem: disabled \"URL Rewrite\". Please check and enable \"URL Rewrite\" Module in IIS server", "default": "API Error: EspoCRM API unavailable.
Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support." diff --git a/install/core/i18n/vi_VN/install.json b/install/core/i18n/vi_VN/install.json index e3ed102324..f2a337901b 100644 --- a/install/core/i18n/vi_VN/install.json +++ b/install/core/i18n/vi_VN/install.json @@ -64,6 +64,7 @@ "Bad init Permission": "Permission denied for \"{*}\" directory. Please set 775 for \"{*}\" or just execute this command in the terminal
{C}
\n\tOperation not permitted? Try this one: {CSU}", "Some errors occurred!": "Đã có lỗi xảy ra!", "phpVersion": "Your PHP version is not supported by EspoCRM, please update to PHP {minVersion} at least", + "MySQLVersion": "Your MySQL version is not supported by EspoCRM, please update to MySQL {minVersion} at least", "The PHP extension was not found...": "Không tìm thấy phần mở rộng {extName} của PHP", "All Settings correct": "cài đặt thành công", "Failed to connect to database": "Không thể kết nối tới csdl", @@ -96,7 +97,7 @@ }, "modRewriteInstruction": { "apache": { - "linux": "

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", + "linux": "

To add the RewriteBase path, open a file {API_PATH}.htaccess and change the following line:
# RewriteBase /
To
RewriteBase {ESPO_PATH}{API_PATH}

To enable .htaccess support add/edit the Server configuration settings inside your <VirtualHost> section (httpd.conf):
<Directory /PATH_TO_ESPO/>\n AllowOverride All\n</Directory>
\n Afterwards run this command in a Terminal:
service apache2 restart

To enable \"mod_rewrite\" run those commands in a Terminal:
a2enmod rewrite 
service apache2 restart
", "windows": "
1. Find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
\n2. Inside the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
\n3. Also find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.\n
" }, "microsoft-iis": { @@ -104,7 +105,7 @@ } }, "modRewriteHelp": { - "apache": "API Error: EspoCRM API unavailable.
Possible problems: disabled \"mod_rewrite\" in Apache server or .htaccess support.", + "apache": "API Error: EspoCRM API unavailable.
Possible problems: RewriteBase required, disabled \"mod_rewrite\" in Apache server or .htaccess support.", "nginx": "API Error: EspoCRM API unavailable.
Add this code to your Nginx Host Config (inside \"server\" block):
\n
\n{0}\n
", "microsoft-iis": "API Error: EspoCRM API unavailable.
Possible problem: disabled \"URL Rewrite\". Please check and enable \"URL Rewrite\" Module in IIS server", "default": "API Error: EspoCRM API unavailable.
Possible problem: disabled Rewrite Module. Please check and enable Rewrite Module in your server (e.g. mod_rewrite in Apache) and .htaccess support." diff --git a/install/core/tpl/errors.tpl b/install/core/tpl/errors.tpl index a0c1383138..0995a1b4f0 100644 --- a/install/core/tpl/errors.tpl +++ b/install/core/tpl/errors.tpl @@ -21,6 +21,7 @@ action: 'errors', langs: {$langsJs}, modRewriteUrl: '{$modRewriteUrl}', + apiPath: '{$apiPath}', serverType: '{$serverType}', OS: '{$OS}' } diff --git a/install/core/tpl/step3.tpl b/install/core/tpl/step3.tpl index b46c791f71..f7e080be98 100644 --- a/install/core/tpl/step3.tpl +++ b/install/core/tpl/step3.tpl @@ -48,6 +48,7 @@ action: 'step3', langs: {$langsJs}, modRewriteUrl: '{$modRewriteUrl}', + apiPath: '{$apiPath}', serverType: '{$serverType}', OS: '{$OS}' } diff --git a/install/index.php b/install/index.php index 3e0ef17933..25b2f12d48 100644 --- a/install/index.php +++ b/install/index.php @@ -98,6 +98,7 @@ switch ($action) { case 'step3': case 'errors': + $smarty->assign("apiPath", $systemHelper->getApiPath()); $modRewriteUrl = $systemHelper->getModRewriteUrl(); $smarty->assign("modRewriteUrl", $modRewriteUrl); $serverType = $systemHelper->getServerType(); @@ -126,7 +127,6 @@ if (!empty($actionFile) && file_exists('install/'.$actionFile)) { include $actionFile; } - if (!empty($actionFile) && file_exists('install/core/tpl/'.$tplName)) { ob_clean(); $smarty->display('index.tpl'); diff --git a/install/js/install.js b/install/js/install.js index 73d4904fda..c2fd0ce00d 100644 --- a/install/js/install.js +++ b/install/js/install.js @@ -35,6 +35,10 @@ var InstallScript = function(opt) { this.modRewriteUrl = opt.modRewriteUrl; } + if (typeof(opt.apiPath) !== 'undefined') { + this.apiPath = opt.apiPath.substr(1) + '/'; + } + if (typeof(opt.serverType) !== 'undefined') { this.serverType = opt.serverType; } @@ -369,6 +373,9 @@ InstallScript.prototype.checkSett = function(opt) { if (typeof(errors.phpVersion) !== 'undefined') { msg += self.getLang('phpVersion', 'messages').replace('{minVersion}', errors.phpVersion) + rowDelim; } + if (typeof(errors.MySQLVersion) !== 'undefined') { + msg += self.getLang('MySQLVersion', 'messages').replace('{minVersion}', errors.MySQLVersion) + rowDelim; + } if (typeof(errors.exts) !== 'undefined') { var exts = errors.exts; @@ -629,10 +636,12 @@ InstallScript.prototype.callbackModRewrite = function(data) { this.checkAction(ajaxData); return; } + ajaxData.success = false; if (typeof(this.langs) !== 'undefined') { ajaxData.errorMsg = (typeof(this.langs['options']['modRewriteHelp'][this.serverType]) !== 'undefined')? this.langs['options']['modRewriteHelp'][this.serverType] : this.langs['options']['modRewriteHelp']['default']; ajaxData.errorMsg += (typeof(this.langs['options']['modRewriteInstruction'][this.serverType]) !== 'undefined' && typeof(this.langs['options']['modRewriteInstruction'][this.serverType][this.OS]) !== 'undefined') ? this.langs['options']['modRewriteInstruction'][this.serverType][this.OS] : ''; + ajaxData.errorMsg = ajaxData.errorMsg.replace("{ESPO_PATH}", this.getEspoPath(true)).replace("{API_PATH}", this.apiPath).replace("{API_PATH}", this.apiPath); } var realCheckIndex = this.checkIndex - 1; if (typeof(this.checkActions[realCheckIndex]) != 'undefined' @@ -666,10 +675,24 @@ InstallScript.prototype.callbackChecking = function(data) { } } +InstallScript.prototype.getEspoPath = function(onlyPath) { + + onlyPath = typeof onlyPath !== 'undefined' ? onlyPath : false; + + var location = window.location.href; + if (onlyPath) { + location = window.location.pathname; + } + + location = location.replace(/install\/?/, ''); + + return location; +} + InstallScript.prototype.goToEspo = function() { - var loc = window.location.href; - loc = loc.replace(/install\/?/, ''); - window.location.replace(loc); + + var location = this.getEspoPath(); + window.location.replace(location); } window.InstallScript = InstallScript;