Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/b-7.3.x' into b-8.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
liulka-oxid committed Nov 19, 2024
2 parents 8ebd064 + 3aa822f commit c6e82d5
Show file tree
Hide file tree
Showing 23 changed files with 115 additions and 18 deletions.
6 changes: 6 additions & 0 deletions source/Core/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,17 @@ class Config extends \OxidEsales\Eshop\Core\Base
* Shops install directory
*
* @var string
*
* @deprecated will be removed in next major, use environment variables instead
*/
protected $sShopDir = null;

/**
* Shops compile directory
*
* @var string
*
* @deprecated will be removed in next major, use environment variables instead
*/
protected $sCompileDir = null;

Expand Down Expand Up @@ -867,6 +871,8 @@ public function getShopUrl($lang = null, $admin = null)
/**
* Returns config sSSLShopURL or sMallSSLShopURL if secondary shop
*
* @deprecated since v8.0 use getShopUrl instead
*
* @param int $lang language (default is null)
*
* @return string
Expand Down
8 changes: 2 additions & 6 deletions source/Core/Exception/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ public function handleUncaughtException(\Throwable $exception)
}

/**
* Report the exception and in case that iDebug is not set, redirect to maintenance page.
* Special methods are used here as the normal exception handling routines always need a database connection and
* this would create a loop.
*
* @param \OxidEsales\Eshop\Core\Exception\DatabaseException $exception Exception to handle
* @deprecated method will be removed in next major, use handleUncaughtException directly
*/
public function handleDatabaseException(\OxidEsales\Eshop\Core\Exception\DatabaseException $exception)
{
Expand All @@ -81,7 +77,7 @@ public function handleDatabaseException(\OxidEsales\Eshop\Core\Exception\Databas


/**
* Exit the application with error status 1
* @deprecated method will be removed in next major, use PHP function directly
*/
protected function exitApplication()
{
Expand Down
8 changes: 8 additions & 0 deletions source/Core/ShopControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ protected function handleCookieException($exception)
}

/**
* @deprecated will be removed in next major, standard execution handling will be used.
*
* Handle database exceptions
* There is still space for improving this as a similar exception handling for database exceptions may be done in
* \OxidEsales\EshopCommunity\Core\Config::init() and the current method may not be executed
Expand Down Expand Up @@ -732,6 +734,8 @@ protected function logException(\Exception $exception)
}

/**
* @deprecated will be removed in next major, standard execution handling will be used.
*
* Notify the shop owner about database connection problems.
*
* This method forms part of the exception handling process. Any further exceptions must be caught.
Expand All @@ -757,6 +761,8 @@ protected function reportDatabaseConnectionException(DatabaseConnectionException
}

/**
* @deprecated will be removed in next major, standard execution handling will be used.
*
* Return true, if a message was already sent within a given threshold.
*
* This method forms part of the exception handling process. Any further exceptions must be caught.
Expand All @@ -781,6 +787,8 @@ protected function messageWasSentWithinThreshold()
}

/**
* @deprecated will be removed in next major, standard execution handling will be used.
*
* Send an offline warning to the shop owner.
* Currently an email is sent to the email address configured as 'sAdminEmail' in the eShop config file.
*
Expand Down
2 changes: 2 additions & 0 deletions source/Core/ViewConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,8 @@ public function getBasketTimeLeft()
* true if blocks javascript code be enabled in templates
*
* @return bool
*
* @deprecated function will be removed in next major version
*/
public function isTplBlocksDebugMode()
{
Expand Down
21 changes: 21 additions & 0 deletions source/Internal/Framework/Database/ConnectionFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/

declare(strict_types=1);

namespace OxidEsales\EshopCommunity\Internal\Framework\Database;

use Doctrine\DBAL\Driver\Connection;
use OxidEsales\Eshop\Core\DatabaseProvider;

class ConnectionFactory implements ConnectionFactoryInterface
{
public function create(): Connection
{
return DatabaseProvider::getDb()->getPublicConnection();
}
}
15 changes: 15 additions & 0 deletions source/Internal/Framework/Database/ConnectionFactoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/

namespace OxidEsales\EshopCommunity\Internal\Framework\Database;

use Doctrine\DBAL\Driver\Connection;

interface ConnectionFactoryInterface
{
public function create(): Connection;
}
3 changes: 3 additions & 0 deletions source/Internal/Framework/Database/ConnectionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
use Doctrine\DBAL\Connection;
use OxidEsales\Eshop\Core\DatabaseProvider;

/**
* @deprecated will be removed in next major, use ConnectionFactory instead
*/
class ConnectionProvider implements ConnectionProviderInterface
{
public function get(): Connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
* See LICENSE file for license details.
*/

declare(strict_types=1);

namespace OxidEsales\EshopCommunity\Internal\Framework\Database;

use Doctrine\DBAL\Connection;

/**
* @deprecated will be removed in next major, use ConnectionFactoryInterface instead
*/
interface ConnectionProviderInterface
{
public function get(): Connection;
Expand Down
3 changes: 3 additions & 0 deletions source/Internal/Framework/Database/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

namespace OxidEsales\EshopCommunity\Internal\Framework\Database;

/**
* @deprecated will be removed in next major, use methods from \Doctrine\DBAL\Driver\Connection directly
*/
class TransactionService implements TransactionServiceInterface
{
public function __construct(private ConnectionProviderInterface $connectionProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
* See LICENSE file for license details.
*/

declare(strict_types=1);

namespace OxidEsales\EshopCommunity\Internal\Framework\Database;

/**
* @deprecated will be removed in next major, use methods from \Doctrine\DBAL\Driver\Connection directly
*/
interface TransactionServiceInterface
{
/**
Expand Down
14 changes: 13 additions & 1 deletion source/Internal/Framework/Database/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,22 @@ services:
OxidEsales\EshopCommunity\Internal\Framework\Database\ConnectionProviderInterface:
class: OxidEsales\EshopCommunity\Internal\Framework\Database\ConnectionProvider
public: true
deprecated:
package: 'oxid-esales/oxideshop-ce'
version: '7.2.0'
message: 'The "%service_id%" service is deprecated.'

OxidEsales\EshopCommunity\Internal\Framework\Database\ConnectionFactoryInterface:
class: OxidEsales\EshopCommunity\Internal\Framework\Database\ConnectionFactory
public: true

OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactoryInterface:
class: OxidEsales\EshopCommunity\Internal\Framework\Database\QueryBuilderFactory
public: true

OxidEsales\EshopCommunity\Internal\Framework\Database\TransactionServiceInterface:
class: OxidEsales\EshopCommunity\Internal\Framework\Database\TransactionService
class: OxidEsales\EshopCommunity\Internal\Framework\Database\TransactionService
deprecated:
package: 'oxid-esales/oxideshop-ce'
version: '7.2.0'
message: 'The "%service_id%" service is deprecated.'
3 changes: 3 additions & 0 deletions source/Internal/Framework/FileSystem/FinderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

use Symfony\Component\Finder\Finder;

/**
* @deprecated will be removed in next major, use \Symfony\Component\Finder\Finder::create() instead
*/
class FinderFactory implements FinderFactoryInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
* See LICENSE file for license details.
*/

declare(strict_types=1);

namespace OxidEsales\EshopCommunity\Internal\Framework\FileSystem;

use Symfony\Component\Finder\Finder;

/**
* @deprecated will be removed in next major, use \Symfony\Component\Finder\Finder::create() instead
*/
interface FinderFactoryInterface
{
/**
Expand Down
4 changes: 4 additions & 0 deletions source/Internal/Framework/FileSystem/bootstrap-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ services:

OxidEsales\EshopCommunity\Internal\Framework\FileSystem\FinderFactoryInterface:
class: OxidEsales\EshopCommunity\Internal\Framework\FileSystem\FinderFactory
deprecated:
package: 'oxid-esales/oxideshop-ce'
version: '7.2.0'
message: 'The "%service_id%" service is deprecated.'

OxidEsales\EshopCommunity\Internal\Framework\Storage\FileStorageFactoryInterface:
class: OxidEsales\EshopCommunity\Internal\Framework\Storage\YamlFileStorageFactory
Expand Down
3 changes: 3 additions & 0 deletions source/Internal/Setup/ConfigFile/ConfigFileDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

use OxidEsales\EshopCommunity\Internal\Transition\Utility\BasicContextInterface;

/**
* @deprecated since version 8.0 you can use container parameters
*/
class ConfigFileDao implements ConfigFileDaoInterface
{
private const PLACEHOLDERS = [
Expand Down
3 changes: 3 additions & 0 deletions source/Internal/Setup/ConfigFile/ConfigFileDaoInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

namespace OxidEsales\EshopCommunity\Internal\Setup\ConfigFile;

/**
* @deprecated since version 8.0 you can use container parameters
*/
interface ConfigFileDaoInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

namespace OxidEsales\EshopCommunity\Internal\Setup\ConfigFile;

/**
* @deprecated since version 8.0 the ConfigFile will be removed
*/
class ConfigFileNotFoundException extends \Exception
{
}
3 changes: 3 additions & 0 deletions source/Internal/Setup/ConfigFile/FileNotEditableException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

namespace OxidEsales\EshopCommunity\Internal\Setup\ConfigFile;

/**
* @deprecated since version 8.0 the ConfigFile will be removed
*/
class FileNotEditableException extends \Exception
{
}
3 changes: 2 additions & 1 deletion source/Internal/Setup/Database/Sql/initial_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ INSERT INTO `oxconfig` (`OXID`, `OXSHOPID`, `OXMODULE`, `OXVARNAME`, `OXVARTYPE`
('mla50c74dd79703312ffb8cfd82c3741', 1, '', 'aLanguageURLs', 'arr', 'a:2:{i:0;s:0:\"\";i:1;N;}'),
('mlabefd7ebdb5946e8f3f7e7a953b323', 1, '', 'aLanguageSSLURLs', 'arr', 'a:2:{i:0;s:0:\"\";i:1;N;}'),
('mlae44cdad808d9b994c58540db39e7a', 1, '', 'aLanguages', 'aarr', 'a:2:{s:2:\"de\";s:7:\"Deutsch\";s:2:\"en\";s:7:\"English\";}'),
('omc4555952125c3c2.98253113', 1, '', 'blDisableNavBars', 'bool', '1');
('omc4555952125c3c2.98253113', 1, '', 'blDisableNavBars', 'bool', '1'),
('feb42aecdf7bacc7c76c9d36102da622', 1, '', 'blSkipDebitOldBankInfo', 'bool', '1');

INSERT INTO `oxcontents` (`OXID`, `OXLOADID`, `OXSHOPID`, `OXSNIPPET`, `OXTYPE`, `OXACTIVE`, `OXACTIVE_1`, `OXPOSITION`, `OXTITLE`, `OXCONTENT`, `OXTITLE_1`, `OXCONTENT_1`, `OXACTIVE_2`, `OXTITLE_2`, `OXCONTENT_2`, `OXACTIVE_3`, `OXTITLE_3`, `OXCONTENT_3`, `OXCATID`, `OXFOLDER`, `OXTERMVERSION`) VALUES
('8709e45f31a86909e9f999222e80b1d0', 'oxstdfooter', 1, 1, 0, 1, 1, '', 'Standard Footer', '<div>OXID Online Shop - Alles rund um das Thema Wassersport, Sportbekleidung und Mode </div>', 'standard footer', '<div>OXID Online Shop - All about watersports, sportswear and fashion </div>', 1, '', '', 1, '', '', '30e44ab83fdee7564.23264141', '', ''),
Expand Down
7 changes: 5 additions & 2 deletions source/Internal/Transition/Utility/BasicContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ public function getContainerCacheFilePath(int $shopId): string;
public function getGeneratedServicesFilePath(): string;

/**
* @return string
* @deprecated functionality will be superseded, method will be removed in next major
*/
public function getConfigurableServicesFilePath(): string;

/**
* @deprecated functionality will be superseded, method will be removed in next major
*/
public function getShopConfigurableServicesFilePath(int $shopId): string;

/**
Expand Down Expand Up @@ -92,7 +95,7 @@ public function getProjectConfigurationDirectory(): string;
public function getShopConfigurationDirectory(int $shopId): string;

/**
* @return string
* @deprecated method will be removed in next major, use getProjectConfigurationDirectory() instead
*/
public function getConfigurationDirectoryPath(): string;

Expand Down
2 changes: 2 additions & 0 deletions source/Internal/Transition/Utility/ContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public function getLogFilePath(): string;
public function getRequiredContactFormFields(): array;

/**
* @deprecated method will be removed in next major version
*
* @return bool
*/
public function isEnabledAdminQueryLog(): bool;
Expand Down
3 changes: 3 additions & 0 deletions source/oxfunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function isAdmin()
*
* @param int $iErrorNr error number
* @param string $sErrorText error message
* @deprecated function will be removed in next major
*/
function warningHandler($iErrorNr, $sErrorText)
{
Expand All @@ -39,6 +40,7 @@ function warningHandler($iErrorNr, $sErrorText)
*
* @param mixed $mVar variable
* @param bool $blToFile marker to write log info to file (must be true to log)
* @deprecated function will be removed in next major
*/
function dumpVar($mVar, $blToFile = false)
{
Expand All @@ -59,6 +61,7 @@ function dumpVar($mVar, $blToFile = false)
* prints anything given into a file, for debugging
*
* @param mixed $mVar variable to debug
* @deprecated function will be removed in next major
*/
function debug($mVar)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/Legacy/Core/InputValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function testValidatePaymentInputDataWithCorrectBankCode(): void
{
$testValues = [
'lsbankname' => 'Bank name',
'lsblz' => '12345678',
'lsktonr' => '123456',
'lsblz' => 'DEDEDEFF',
'lsktonr' => 'DE55200800000770876200',
'lsktoinhaber' => 'Hans Mustermann',
];

Expand Down

0 comments on commit c6e82d5

Please sign in to comment.