Skip to content

Commit

Permalink
Merge pull request #177 from remicollet/issue-php82
Browse files Browse the repository at this point in the history
PHP 8.2
  • Loading branch information
laruence authored Jun 25, 2024
2 parents de347c8 + 865d2e0 commit 5258388
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/yar.inc
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,19 @@ PHP;

function yar_server_cleanup() {
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "htdocs";
$dp = opendir($dir);
while (($f = readdir($dp))) {
if (in_array($f, array('.', '..'))) {
continue;
}
$path = $dir . DIRECTORY_SEPARATOR . $f;
if (is_file($path)) {
unlink($path);
if (is_dir($dir)) {
$dp = opendir($dir);
while (($f = readdir($dp))) {
if (in_array($f, array('.', '..'))) {
continue;
}
$path = $dir . DIRECTORY_SEPARATOR . $f;
if (is_file($path)) {
unlink($path);
}
}
rmdir($dir);
}
rmdir($dir);
}

/* For TCP */
Expand Down
4 changes: 4 additions & 0 deletions yar_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
yar_request_t *php_yar_request_instance(zend_string *method, zend_array *parameters, void **options) /* {{{ */ {
yar_request_t *request = emalloc(sizeof(yar_request_t));

#if PHP_VERSION_ID < 80200
if (!BG(mt_rand_is_seeded)) {
#else
if (!RANDOM_G(mt19937_seeded)) {
#endif
php_mt_srand(GENERATE_SEED());
}

Expand Down

0 comments on commit 5258388

Please sign in to comment.