Skip to content

Commit 2971b47

Browse files
oc-tmuellerclaude
andcommitted
tmp: debug oracle client on php 7.4
To be dropped before merge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
1 parent a87f0ab commit 2971b47

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

.github/workflows/php-unit.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,28 @@ jobs:
8888
run: |
8989
make install-composer-deps
9090
91+
- name: TEMPORARY DEBUG - Oracle client
92+
if: startsWith(matrix.database,'oracle:')
93+
env:
94+
DSN: "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=FREEPDB1)))"
95+
run: |
96+
php -r 'echo "oci8: ", phpversion("oci8"), "\n";'
97+
php -i | grep -iE "oracle|instant" || true
98+
ls -l /opt/hostedtoolcache/setup-php/*/instantclient* 2>/dev/null || true
99+
ldd "$(php -r 'echo ini_get("extension_dir");')/oci8.so" || true
100+
echo "--- raw tcp to 1521 ---"
101+
timeout 10 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/1521' && echo "tcp ok" || echo "tcp failed"
102+
echo "--- oci_connect (60s budget) ---"
103+
timeout -s KILL 60 php -d display_errors=1 -r '
104+
$t = microtime(true);
105+
$c = @oci_connect("owncloud", "owncloud", getenv("DSN"));
106+
printf("connect=%s after %.1fs\n", $c ? "OK" : "FAIL", microtime(true) - $t);
107+
if (!$c) { print_r(oci_error()); exit(1); }
108+
$s = oci_parse($c, "select banner from v\$version");
109+
oci_execute($s);
110+
print_r(oci_fetch_row($s));
111+
' || echo "EXIT=$? (124/137 means it hung)"
112+
91113
- name: Install Server
92114
env:
93115
DATA_DIRECTORY: ${{ github.workspace }}/data
@@ -126,7 +148,31 @@ jobs:
126148
--database-pass=${DB_PASSWORD}"
127149
fi
128150
129-
php occ ${install_cmd}
151+
if [[ "${DB_TYPE}" == "oci" ]]; then
152+
export DSN="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=${DB_HOST})(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=${ORACLE_SERVICE_NAME})))"
153+
timeout -s KILL 1800 php occ ${install_cmd} &
154+
INSTALL_PID=$!
155+
START=$(date +%s)
156+
while kill -0 $INSTALL_PID 2>/dev/null; do
157+
sleep 20
158+
php -r '
159+
$c = @oci_connect("owncloud", "owncloud", getenv("DSN"));
160+
if (!$c) { echo " (no connection)\n"; exit; }
161+
$s = oci_parse($c, "select count(*) from user_objects where object_type = :t");
162+
$t = "TABLE"; oci_bind_by_name($s, ":t", $t); oci_execute($s);
163+
$tables = oci_fetch_row($s)[0];
164+
$s = oci_parse($c, "select object_name, object_type from user_objects order by created desc, object_id desc fetch first 3 rows only");
165+
oci_execute($s);
166+
$last = [];
167+
while ($r = oci_fetch_row($s)) { $last[] = $r[1] . " " . $r[0]; }
168+
printf(" tables=%d newest=[%s]\n", $tables, implode(", ", $last));
169+
' || true
170+
echo " elapsed=$(( $(date +%s) - START ))s"
171+
done
172+
wait $INSTALL_PID
173+
else
174+
php occ ${install_cmd}
175+
fi
130176
echo "enabling apps"
131177
php occ app:enable files_sharing
132178
php occ app:enable files_trashbin

0 commit comments

Comments
 (0)