Skip to content

Commit

Permalink
[6.0]sync pdo code and fix error (#5366)
Browse files Browse the repository at this point in the history
* sync pdo code and fix error

* fix test
  • Loading branch information
NathanFreeman committed Jun 8, 2024
1 parent d62d292 commit a5ed589
Show file tree
Hide file tree
Showing 18 changed files with 5,965 additions and 18 deletions.
6 changes: 2 additions & 4 deletions ext-src/php_swoole_call_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
+----------------------------------------------------------------------+
*/

#pragma once

#include "php_swoole.h"

#ifdef ZEND_CHECK_STACK_LIMIT
#define HOOK_PHP_CALL_STACK(callback) \
auto __stack_limit = EG(stack_limit); \
auto __stack_base = EG(stack_base); \
void *__stack_limit = EG(stack_limit); \
void *__stack_base = EG(stack_base); \
EG(stack_base) = (void *) 0; \
EG(stack_limit) = (void *) 0; \
callback EG(stack_limit) = __stack_limit; \
Expand Down
16 changes: 8 additions & 8 deletions tests/swoole_runtime/file_hook/bug_4327.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ Swoole\Runtime::enableCoroutine($flags = SWOOLE_HOOK_ALL);

function createDirectories($protocol = "")
{
if (defined('SWOOLE_THREAD')) {
echo "SUCCESS".PHP_EOL;
return;
}

$barrier = Barrier::make();
$first = "$protocol/".rand(0, 1000);
$second = "/".rand(0, 1000);
Expand Down Expand Up @@ -49,9 +44,14 @@ run(function () {
createDirectories("file://");
});

Swoole\Runtime::enableCoroutine(false);
createDirectories();
createDirectories("file://");
if (defined('SWOOLE_THREAD')) {
echo "SUCCESS".PHP_EOL;
} else {
Swoole\Runtime::enableCoroutine(false);
createDirectories();
createDirectories("file://");
}

?>
--EXPECT--
SUCCESS
Expand Down
3 changes: 2 additions & 1 deletion thirdparty/php81/pdo_oci/oci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#define SW_USE_ORACLE_HOOK
#include "php_swoole_oracle.h"

#if PHP_VERSION_ID >= 80100
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300

#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
Expand Down
3 changes: 2 additions & 1 deletion thirdparty/php81/pdo_oci/oci_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#define SW_USE_ORACLE_HOOK
#include "php_swoole_oracle.h"

#if PHP_VERSION_ID >= 80100
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300

#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/php81/pdo_odbc/odbc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define SW_USE_ODBC_HOOK
#include "php_swoole_odbc.h"

#if PHP_VERSION_ID >= 80100
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300

#include "php.h"
#include "php_ini.h"
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/php81/pdo_odbc/odbc_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define SW_USE_ODBC_HOOK
#include "php_swoole_odbc.h"

#if PHP_VERSION_ID >= 80100
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300

#include "php.h"
#include "php_ini.h"
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/php81/pdo_pgsql/pgsql_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define SW_USE_PGSQL_HOOK
#include "php_swoole_pgsql.h"

#if PHP_VERSION_ID >= 80100
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300

#include "php.h"
#include "php_ini.h"
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/php81/pdo_pgsql/pgsql_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define SW_USE_PGSQL_HOOK
#include "php_swoole_pgsql.h"

#if PHP_VERSION_ID >= 80100
#if PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80300

#include "php.h"
#include "php_ini.h"
Expand Down
Loading

0 comments on commit a5ed589

Please sign in to comment.