-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c758fa
commit 622a18f
Showing
3 changed files
with
93 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
namespace DDTrace\Integrations\Exec { | ||
|
||
/** | ||
* Associates a popen() stream resource with a span so that when the resource is destroyed, the span is updated | ||
* with the exit code and closed. | ||
* | ||
* It is not validated that the stream is actually a popen() stream resource. | ||
* | ||
* Only one span can be associated with a stream resource. A subsequent call replaces the first span. | ||
* | ||
* @internal for use by the exec integration only | ||
* @param resource $stream A stream resource | ||
* @param \DDTrace\SpanData $span The command_execution span to associate | ||
* @return bool true on success or false if the resource is not a stream | ||
*/ | ||
function register_stream($stream, \DDTrace\SpanData $span): bool {} | ||
|
||
/** | ||
* Associates a proc_open() process handle with a span so that when the handle is closed, there is a waitpid() | ||
* call on the child, and the span is updated with the exit code and closed. | ||
* | ||
* Only one call to this function can be made per process handle. A subsequent call has undefined behavior. | ||
* | ||
* @internal for use by the exec integration only | ||
* @param resource $proc_h A process handle | ||
* @param \DDTrace\SpanData $span The command_execution span to associate | ||
* @return bool true on success or false if the resource is not a process handle | ||
*/ | ||
function proc_assoc_span($proc_h, \DDTrace\SpanData $span) : bool {} | ||
|
||
/** | ||
* Retrieves a span previously associated with a process handle by proc_assoc_span(), or | ||
* null if there's none. | ||
* | ||
* @internal for use by the exec integration only | ||
* @param resource $proc_h A process handle | ||
* @return \DDTrace\SpanData|null The associated span, if any. | ||
*/ | ||
function proc_get_span($proc_h) : ?\DDTrace\SpanData {} | ||
|
||
/** | ||
* Retrieves the pid associated with a process handle. | ||
* | ||
* @internal for use by the testes of the exec integration only | ||
* @param resource $proc_h A process handle | ||
* @return int|null The associated span, if any. | ||
*/ | ||
function proc_get_pid($proc_h) : ?int {} | ||
|
||
/** | ||
* Closes the spans associated with live resources opened by popen() and proc_open() | ||
* | ||
* @internal for use by the testes of the exec integration only | ||
* @return bool | ||
*/ | ||
function test_rshutdown() : bool {} | ||
} | ||
|
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,23 @@ | ||
/* This is a generated file, edit the .stub.php file instead. | ||
* Stub hash: 97cc0e5375b6d1d07fa0db5a4dba3e102709674f */ | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_DDTrace_Integrations_Exec_register_stream, 0, 2, _IS_BOOL, 0) | ||
ZEND_ARG_INFO(0, stream) | ||
ZEND_ARG_OBJ_INFO(0, span, DDTrace\\SpanData, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_DDTrace_Integrations_Exec_proc_assoc_span, 0, 2, _IS_BOOL, 0) | ||
ZEND_ARG_INFO(0, proc_h) | ||
ZEND_ARG_OBJ_INFO(0, span, DDTrace\\SpanData, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_DDTrace_Integrations_Exec_proc_get_span, 0, 1, DDTrace\\SpanData, 1) | ||
ZEND_ARG_INFO(0, proc_h) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_DDTrace_Integrations_Exec_proc_get_pid, 0, 1, IS_LONG, 1) | ||
ZEND_ARG_INFO(0, proc_h) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_DDTrace_Integrations_Exec_test_rshutdown, 0, 0, _IS_BOOL, 0) | ||
ZEND_END_ARG_INFO() |