Skip to content

Commit 27b077f

Browse files
committed
Remove cf-helper-php from test fixtures
Composer 2.9.8 blocks packages with known security advisories by default. The cf-helper-php 1.6.x dependency pulls in filp/whoops ~1.1 and symfony/yaml ~2.5, both flagged with advisories, causing staging failures in the phpredis and amqp module tests. Remove cf-helper-php from both fixtures since the tests only verify that PHP extensions (ext-redis, ext-amqp) load correctly. Simplify the phpredis index.php to connect directly to localhost instead of using CfHelper to parse VCAP_SERVICES (no Redis service is bound in tests).
1 parent a825da5 commit 27b077f

3 files changed

Lines changed: 6 additions & 28 deletions

File tree

fixtures/with_amqp/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"require": {
3-
"ext-amqp": "*",
4-
"cloudfoundry-community/cf-helper-php": "1.6.*"
3+
"ext-amqp": "*"
54
}
65
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"require": {
33
"ext-redis": "*",
4-
"ext-igbinary": "*",
5-
"cloudfoundry-community/cf-helper-php": "1.6.*"
4+
"ext-igbinary": "*"
65
}
76
}

fixtures/with_phpredis/index.php

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,13 @@
55
<body>
66
<h1>This page initiates a Redis connection and displays Redis info via the phpredis client.</h1>
77
<?php
8-
require_once 'vendor/autoload.php';
9-
use CfCommunity\CfHelper\CfHelper;
10-
$cfHelper = CfHelper::getInstance();
11-
12-
# Try to fetch Redis VCAP_SERVICES values
13-
$serviceManager = $cfHelper->getServiceManager();
14-
$redisService = $serviceManager->getService('.*redis.*');
15-
16-
$defaultUrl = "localhost";
17-
$defaulPort = 6379;
18-
$defaulPassword = "password";
19-
20-
# Prevent PHP Errors if no service is bound
21-
if (is_null($redisService)){
22-
$redisUrl = $defaultUrl;
23-
$redisPort = $defaulPort;
24-
$redisPassword = $defaulPassword;
25-
}
26-
else {
27-
$redisUrl = $redisService->getValue('hostname');
28-
$redisPort = $redisService->getValue('port');
29-
$redisPassword = $redisService->getValue('password');
30-
}
8+
$redisUrl = "localhost";
9+
$redisPort = 6379;
10+
$redisPassword = "password";
3111

3212
print "<p>RedisUrl: $redisUrl</p>";
3313
print "<p>RedisPort: $redisPort</p>";
34-
print "<p>RedisUrl: redacted</p>";
14+
print "<p>RedisPassword: redacted</p>";
3515

3616
# Establish Redis connection and authenticate
3717
$redis = new Redis();

0 commit comments

Comments
 (0)