This commit is contained in:
Yuri Kuznetsov
2020-05-01 14:56:49 +03:00
10 changed files with 126 additions and 38 deletions
+9 -9
View File
@@ -1,21 +1,21 @@
## EspoCRM
<a href='https://www.espocrm.com'>EspoCRM is an Open Source CRM</a> (Customer Relationship Management) software that allows you to see, enter and evaluate all your company relationships regardless of the type. People, companies or opportunities - all in an easy and intuitive interface.
[EspoCRM is an Open Source CRM](https://www.espocrm.com) (Customer Relationship Management) software that allows you to see, enter and evaluate all your company relationships regardless of the type. People, companies or opportunities - all in an easy and intuitive interface.
It's a web application with a frontend designed as a single page application based on backbone.js and a REST API backend written in PHP.
It's a web application with a frontend designed as a single page application and REST API backend written in PHP.
Download the latest release from our [website](https://www.espocrm.com).
[Download](https://www.espocrm.com/download/) the latest release from our website.
### Requirements
* PHP 7.2 and later (with pdo, json, gd, openssl, zip, imap, mbstring, curl extensions);
* MySQL 5.7 (and later), or MariaDB 10.1 (and later).
For more information about server configuration see [this article](https://www.espocrm.com/documentation/administration/server-configuration/).
For more information about server configuration see [this article](https://docs.espocrm.com/administration/server-configuration/).
### Documentation
Documentation for administrators, users and developers is available [here](https://www.espocrm.com/documentation/).
Documentation for administrators, users and developers is available [here](https://docs.espocrm.com).
### How to report a bug
@@ -23,13 +23,13 @@ Create an issue [here](https://github.com/espocrm/espocrm/issues) or post on our
### How to install a stable version
[Download](https://www.espocrm.com/download/) the latest version. See the [instructions](https://www.espocrm.com/documentation/administration/installation/) about installation.
[Download](https://www.espocrm.com/download/) the latest version. See the [instructions](https://docs.espocrm.com/administration/installation/) about installation.
### Development
* [Getting started](https://github.com/espocrm/documentation/blob/master/development/how-to-start.md)
* [Running tests](https://github.com/espocrm/documentation/blob/master/development/tests.md)
* [Making translation](https://github.com/espocrm/documentation/blob/master/development/translation.md)
* [Getting started](https://docs.espocrm.com/development/how-to-start)
* [Running tests](https://docs.espocrm.com/development/tests)
* [Making translation](https://docs.espocrm.com/development/translation)
### How to contribute
+1 -1
View File
@@ -6,4 +6,4 @@ If you believe you have discovered a vulnerability in EspoCRM please contacts us
## Supported versions
For severe vulnerabilities we provide fixes for 5 minor versions (the second number in the version string) back from the current stable version.
For severe vulnerabilities we provide fixes for 2 minor versions (the second number in the version string) back from the current stable version. Separate patches or manual fix guidelines will be provided for more old versions.
@@ -261,6 +261,8 @@ class Upgrade extends Base
try {
foreach ($stepList as $stepName) {
fwrite(\STDOUT, ".");
$upgradeManager = $this->getUpgradeManager(true);
$upgradeManager->runInstallStep($stepName, ['id' => $upgradeId]);
}
@@ -277,8 +279,9 @@ class Upgrade extends Base
$phpExecutablePath = $this->getPhpExecutablePath();
foreach ($stepList as $stepName) {
$command = $phpExecutablePath . " command.php upgrade-step --step=". ucfirst($stepName) ." --id=". $upgradeId;
fwrite(\STDOUT, ".");
$command = $phpExecutablePath . " command.php upgrade-step --step=". ucfirst($stepName) ." --id=". $upgradeId;
$shellResult = shell_exec($command);
if ($shellResult !== 'true') {
$GLOBALS['log']->error('Upgrade Error: ' . $shellResult);
@@ -29,7 +29,7 @@
namespace Espo\Core\Utils\Database\DBAL\FieldTypes;
class JsonArrayType extends \Doctrine\DBAL\Types\TextType
class JsonArrayType extends TextType
{
const JSON_ARRAY = 'jsonArray';
@@ -37,10 +37,4 @@ class JsonArrayType extends \Doctrine\DBAL\Types\TextType
{
return self::JSON_ARRAY;
}
public static function getDbTypeName()
{
return 'TEXT';
}
}
@@ -29,7 +29,7 @@
namespace Espo\Core\Utils\Database\DBAL\FieldTypes;
class JsonObjectType extends \Doctrine\DBAL\Types\TextType
class JsonObjectType extends TextType
{
const JSON_OBJECT = 'jsonObject';
@@ -37,10 +37,4 @@ class JsonObjectType extends \Doctrine\DBAL\Types\TextType
{
return self::JSON_OBJECT;
}
public static function getDbTypeName()
{
return 'TEXT';
}
}
@@ -0,0 +1,52 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2020 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EspoCRM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Utils\Database\DBAL\FieldTypes;
use Doctrine\DBAL\Platforms\AbstractPlatform;
class LongtextType extends TextType
{
const LONGTEXT = 'longtext';
public function getName()
{
return self::LONGTEXT;
}
public static function getDbTypeName()
{
return 'longtext';
}
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return 'LONGTEXT';
}
}
@@ -0,0 +1,45 @@
<?php
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2020 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EspoCRM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
namespace Espo\Core\Utils\Database\DBAL\FieldTypes;
use Doctrine\DBAL\Platforms\AbstractPlatform;
class TextType extends \Doctrine\DBAL\Types\TextType
{
public static function getDbTypeName()
{
return 'mediumtext';
}
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return 'MEDIUMTEXT';
}
}
@@ -39,6 +39,7 @@ class Comparator extends \Doctrine\DBAL\Schema\Comparator
public function diffColumn(Column $column1, Column $column2)
{
$changedProperties = array();
if ( $column1->getType() != $column2->getType() ) {
//espo: fix problem with executing query for custom types
@@ -82,15 +83,6 @@ class Comparator extends \Doctrine\DBAL\Schema\Comparator
}
}
if ($column1->getType() instanceof \Doctrine\DBAL\Types\TextType) {
$length1 = $column1->getLength() ?: 16777215/* mediumtext length*/;
$length2 = $column2->getLength() ?: 16777215;
if ($length1 != -1 && $length2 != -1 && $length2 > $length1) {
$changedProperties[] = 'length';
}
}
if ($column1->getType() instanceof \Doctrine\DBAL\Types\DecimalType) {
if (($column1->getPrecision()?:10) != ($column2->getPrecision()?:10)) {
$changedProperties[] = 'precision';
@@ -124,7 +116,7 @@ class Comparator extends \Doctrine\DBAL\Schema\Comparator
$changedProperties = array_merge($changedProperties, $diffKeys);
/** Espo: do not change a field length while changing other parameters */
/** Espo: do not change a field length downwards */
if (!empty($changedProperties) && !in_array('length', $changedProperties) && $column1->getType() instanceof \Doctrine\DBAL\Types\StringType) {
$length1 = $column1->getLength() ?: 255;
$length2 = $column2->getLength() ?: 255;
@@ -134,6 +126,15 @@ class Comparator extends \Doctrine\DBAL\Schema\Comparator
$column2->setLength($length1);
}
}
if (in_array('type', $changedProperties) && $column1->getType() instanceof \Doctrine\DBAL\Types\TextType && isset($column1DbTypeName) && isset($column2DbTypeName)) {
$constName1 = '\Espo\Core\Utils\Database\DBAL\Platforms\MySqlPlatform::LENGTH_LIMIT_' . strtoupper($column1DbTypeName);
$constName2 = '\Espo\Core\Utils\Database\DBAL\Platforms\MySqlPlatform::LENGTH_LIMIT_' . strtoupper($column2DbTypeName);
if (defined($constName1) && defined($constName2) && constant($constName1) >= constant($constName2)) {
$changedProperties = array_diff($changedProperties, ['type']);
}
}
/** Espo: end */
return $changedProperties;
@@ -209,7 +209,7 @@ class MySqlSchemaManager extends \Doctrine\DBAL\Schema\MySqlSchemaManager
case 'text':
case 'mediumtext':
case 'longtext':
$length = $this->_platform->getClobTypeLength($dbType);
$length = null;
break;
/* Espo: end */
}
@@ -46,8 +46,7 @@ return [
'type' => 'id',
],
'data' => [
'type' => 'text',
'len' => 16777216,
'type' => 'text'
]
]
],