-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into simplify-packagexml
- Loading branch information
Showing
12 changed files
with
296 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,18 +16,18 @@ | |
<email>[email protected]</email> | ||
<active>yes</active> | ||
</lead> | ||
<date>2024-01-27</date> | ||
<time>21:38:56</time> | ||
<date>2024-02-04</date> | ||
<time>23:00:16</time> | ||
<version> | ||
<release>1.0.1beta2</release> | ||
<release>1.0.1</release> | ||
<api>1.0</api> | ||
</version> | ||
<stability> | ||
<release>beta</release> | ||
<release>stable</release> | ||
<api>stable</api> | ||
</stability> | ||
<license uri="https://opensource.org/license/apache-2-0/" filesource="LICENSE">Apache 2.0</license> | ||
<notes>See https://github.com/open-telemetry/opentelemetry-php-instrumentation/releases/tag/1.0.1beta2</notes> | ||
<notes>See https://github.com/open-telemetry/opentelemetry-php-instrumentation/releases/tag/1.0.1</notes> | ||
<contents> | ||
<dir baseinstalldir="/" name="/"> | ||
<file baseinstalldir="/" name=".clang-format" role="src"/> | ||
|
@@ -56,6 +56,10 @@ | |
<file name="disable_hook_function_validation.phpt" role="test"/> | ||
<file name="disabled_with_conflicting_extension.phpt" role="test"/> | ||
<file name="expand_params.phpt" role="test"/> | ||
<file name="expand_params_extend.phpt" role="test"/> | ||
<file name="expand_params_extend_internal.phpt" role="test"/> | ||
<file name="expand_params_extend_internal_long.phpt" role="test"/> | ||
<file name="expand_params_extend_limit.phpt" role="test"/> | ||
<file name="expand_params_extra.phpt" role="test"/> | ||
<file name="expand_params_internal.phpt" role="test"/> | ||
<file name="function_closure.phpt" role="test"/> | ||
|
@@ -258,5 +262,19 @@ | |
<license>Apache 2.0</license> | ||
<notes>See https://github.com/open-telemetry/opentelemetry-php-instrumentation/releases/tag/1.0.1beta1</notes> | ||
</release> | ||
<release> | ||
<date>2024-01-27</date> | ||
<time>21:38:56</time> | ||
<version> | ||
<release>1.0.1beta2</release> | ||
<api>1.0</api> | ||
</version> | ||
<stability> | ||
<release>beta</release> | ||
<api>stable</api> | ||
</stability> | ||
<license>Apache 2.0</license> | ||
<notes>See https://github.com/open-telemetry/opentelemetry-php-instrumentation/releases/tag/1.0.1beta2</notes> | ||
</release> | ||
</changelog> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--TEST-- | ||
Check if pre hook can expand params of function when that requires extending the stack | ||
--EXTENSIONS-- | ||
opentelemetry | ||
--INI-- | ||
opentelemetry.allow_stack_extension=On | ||
--FILE-- | ||
<?php | ||
OpenTelemetry\Instrumentation\hook( | ||
null, | ||
'helloWorld', | ||
pre: function($instance, array $params) { | ||
return [$params[0], 'b', 'c', 'd', 'e', 'f', 'g', 'h']; | ||
}, | ||
post: fn() => null | ||
); | ||
|
||
function helloWorld($a, $b) { | ||
var_dump(func_get_args()); | ||
} | ||
helloWorld('a'); | ||
?> | ||
--EXPECTF-- | ||
array(8) { | ||
[0]=> | ||
string(1) "a" | ||
[1]=> | ||
string(1) "b" | ||
[2]=> | ||
string(1) "c" | ||
[3]=> | ||
string(1) "d" | ||
[4]=> | ||
string(1) "e" | ||
[5]=> | ||
string(1) "f" | ||
[6]=> | ||
string(1) "g" | ||
[7]=> | ||
string(1) "h" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
Check if pre hook can expand params of internal function when that requires extending the stack | ||
--SKIPIF-- | ||
<?php if (PHP_VERSION_ID < 80200) die('skip requires PHP >= 8.2'); ?> | ||
--EXTENSIONS-- | ||
opentelemetry | ||
--INI-- | ||
opentelemetry.allow_stack_extension=On | ||
--FILE-- | ||
<?php | ||
OpenTelemetry\Instrumentation\hook( | ||
null, | ||
'array_slice', | ||
pre: function(null $instance, array $params) { | ||
return [$params[0], $params[1], 1, true]; | ||
}, | ||
post: fn() => null | ||
); | ||
|
||
var_dump(array_slice([1,2,3], 1)); | ||
?> | ||
--EXPECTF-- | ||
array(1) { | ||
[1]=> | ||
int(2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--TEST-- | ||
Check if pre hook can expand params of internal function when that requires extending the stack (many params) | ||
--DESCRIPTION-- | ||
This will add MANY extra arguments to an internal function, making it fail with an error. | ||
However, the purpose of this test is to just make sure it does not somehow corrupt the stack | ||
and cause a crash with a large number of extra parameters. | ||
--SKIPIF-- | ||
<?php if (PHP_VERSION_ID < 80200) die('skip requires PHP >= 8.2'); ?> | ||
--EXTENSIONS-- | ||
opentelemetry | ||
--INI-- | ||
opentelemetry.allow_stack_extension=On | ||
--FILE-- | ||
<?php | ||
OpenTelemetry\Instrumentation\hook( | ||
null, | ||
'array_slice', | ||
pre: function(null $instance, array $params) { | ||
return [$params[0], $params[1], 1, true, true, true, true, true, true, true, true, true, true]; | ||
}, | ||
post: fn() => null | ||
); | ||
|
||
var_dump(array_slice([1,2,3], 1)); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught ArgumentCountError: array_slice() expects at most 4 arguments, 13 given in %s | ||
Stack trace: | ||
#0 %s: array_slice(Array, 1, 1, true, true, true, true, true, true, true, true, true, true) | ||
#1 {main} | ||
thrown in %s on line %d |
Oops, something went wrong.