Skip to content

Commit

Permalink
Trying w/docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandro committed Jan 27, 2024
1 parent 374ef44 commit 0c55e0e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
rts-version: ['1.4.13', '1.6.19', '1.8.10']
rts-version: ['1.4.13', '1.6.19', '1.8.12']
steps:
- uses: actions/checkout@v3
- uses: adambirds/[email protected]
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ RUN apt-get -y upgrade && \
apt-get update && \
apt-get install -yqq zip git wget

RUN pecl install igbinary redis ${XDEBUG_PACKAGE} && \
docker-php-ext-enable igbinary redis xdebug
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions igbinary redis xdebug

RUN wget https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar -q && \
mv composer.phar /usr/bin/composer && \
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ services:
dockerfile: Dockerfile
context: .
args:
PHP_VERSION: ${PHP_VERSION}
PHP_VERSION: ${PHP_VERSION-7.4}
entrypoint: sleep infinity
volumes:
- .:/app
- ./docker/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
php-rts-redis:
image: redislabs/redistimeseries:${RTS_VERSION}
image: redislabs/redistimeseries:${RTS_VERSION-1.4.13}
2 changes: 1 addition & 1 deletion run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e

composer install --no-progress --prefer-dist --optimize-autoloader
./vendor/bin/phpunit --coverage-text
#./vendor/bin/psalm
./vendor/bin/psalm
11 changes: 7 additions & 4 deletions src/Client/RedisClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public function executeCommand(array $params)
private function authenticate(?string $username, ?string $password): void
{
try {
if ($password) {
if ($username) {
if ($password !== null) {
if ($username !== null) {
// Calling auth() with an array throws a TypeError in some cases
/**
* @noinspection PhpMethodParametersCountMismatchInspection
Expand All @@ -104,13 +104,16 @@ private function authenticate(?string $username, ?string $password): void
}
if ($result === false) {
throw new RedisAuthenticationException(sprintf(
'Failure authenticating user %s', $username ?: 'default'
'Failure authenticating user %s',
$username === null ? 'default' : $username
));
}
}
} /** @noinspection PhpRedundantCatchClauseInspection */ catch (RedisException $e) {
throw new RedisAuthenticationException(sprintf(
'Failure authenticating user %s: %s', $username ?: 'default', $e->getMessage()
'Failure authenticating user %s: %s',
$username === null ? 'default' : $username,
$e->getMessage()
));
}
}
Expand Down

0 comments on commit 0c55e0e

Please sign in to comment.