Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: NestTransactionsWithSavepoints argument #5

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apk add --no-cache \
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer

RUN apk add --no-cache --virtual .phpize_deps $PHPIZE_DEPS && \
pecl install xdebug 3 && \
pecl install xdebug-3.1.1 && \
docker-php-ext-enable xdebug && \
rm -rf /usr/share/php7 && \
rm -rf /tmp/pear && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ logs:

.PHONY: tests
tests:
docker-compose run --rm -u ${UID}:${GID} ${DOCKER_PHP_SERVICE} phpunit
docker-compose run --rm -u ${UID}:${GID} ${DOCKER_PHP_SERVICE} phpunit
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@
"pccomponentes/coding-standard": "^1.0",
"phpunit/phpunit": "^9",
"dg/bypass-finals": "^1.1"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.7'
services:
php:
build: .
Expand Down
6 changes: 5 additions & 1 deletion src/Driver/DBAL/DBALTransactionalConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ final class DBALTransactionalConnection implements TransactionalConnection
{
private Connection $DBALConnection;

public function __construct(Connection $DBALConnection)
public function __construct(Connection $DBALConnection, bool $nestTransactionsWithSavepoints = false)
{
$this->DBALConnection = $DBALConnection;

if (true === $nestTransactionsWithSavepoints) {
$this->DBALConnection->setNestTransactionsWithSavepoints(true);
}
}

public function beginTransaction(): void
Expand Down