Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
edae416
Fixed ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO macro
Fleshgrinder May 14, 2017
76e1a20
Test cases for UUIDParsingException
Fleshgrinder May 23, 2017
7e13b7f
Test cases for UUID
Fleshgrinder May 23, 2017
9e0e146
Added UUIDParsingException stub
Fleshgrinder May 23, 2017
1fde914
Added extended garbage test case
Fleshgrinder May 23, 2017
9c416eb
Added sorting test case
Fleshgrinder May 23, 2017
72dc6f8
Added UUID stub
Fleshgrinder May 23, 2017
7743aa0
Implemented UUID and UUIDParsingException
Fleshgrinder May 23, 2017
8f85dff
Fixed encoding and line endings
Fleshgrinder May 23, 2017
6e8707d
Removed TRUE and FALSE usages
Fleshgrinder May 23, 2017
d6dc0f9
Reverted whitespace change
Fleshgrinder May 23, 2017
92f0ce6
Changed encoding back to ANSI
Fleshgrinder May 23, 2017
e139136
Merge branch 'bugfix/arg-info-return-obj-macro' into rfc/uuid
Fleshgrinder May 23, 2017
7324eb4
Merge remote-tracking branch 'upstream/master' into rfc/uuid
Fleshgrinder May 24, 2017
a6b1ceb
C89 compatibility: moved decls to top
Fleshgrinder May 24, 2017
18bf284
Renamed UUIDParsingException to UUIDParseException
Fleshgrinder May 24, 2017
edf2bd3
Removed PHP_METHODs from header file
Fleshgrinder May 24, 2017
d2e5641
Moved argument and function decls out of MINIT
Fleshgrinder May 24, 2017
aa5530c
Removed custom ArgumentCountErrors
Fleshgrinder May 24, 2017
dce8a1c
Moved arg info to their methods
Fleshgrinder May 25, 2017
49aed4f
Added zend_parse_parameters_none
Fleshgrinder May 25, 2017
5b69abe
Extended documentation
Fleshgrinder May 25, 2017
02fa17b
Removed SPL check (always there)
Fleshgrinder May 25, 2017
23bc822
Removed leading backslashes
Fleshgrinder May 25, 2017
44f71c8
Use static value in test
Fleshgrinder May 25, 2017
ecd18cc
Fixed formatting
Fleshgrinder May 25, 2017
b4b9008
Use static value for test
Fleshgrinder May 25, 2017
9ceae1d
Removed ArgumentCountError test cases
Fleshgrinder May 25, 2017
5fdfe2d
Added isNil test cases
Fleshgrinder May 25, 2017
6fe8478
Merge remote-tracking branch 'upstream/master' into rfc/uuid
Fleshgrinder May 25, 2017
9b240c7
Changed parameter parsing to throw
Fleshgrinder May 26, 2017
ea59cfa
Added ArgumentCountError throw annotations to stubs
Fleshgrinder May 26, 2017
d72e2ae
Formatting of PhpDoc
Fleshgrinder May 26, 2017
d078ae9
Merge remote-tracking branch 'upstream/master' into rfc/uuid
Fleshgrinder May 27, 2017
1efeba3
Removed custom macros
Fleshgrinder May 27, 2017
d281e24
Use self instead of UUID
Fleshgrinder May 28, 2017
0e31760
Removed hard coded class name
Fleshgrinder May 28, 2017
9930148
Merge remote-tracking branch 'upstream/master' into rfc/uuid
Fleshgrinder May 28, 2017
c0d4635
Verify type after deserialization
Fleshgrinder May 28, 2017
d1dc0c5
Moved inlinable declaration to header
Fleshgrinder May 28, 2017
0cff5f1
Use struct wrappers around arrays
Fleshgrinder May 28, 2017
a36bd49
Numbers are easier to read
Fleshgrinder May 28, 2017
942d117
Verify property value upon access
Fleshgrinder May 28, 2017
a0158ee
Avoid copy of arguments
Fleshgrinder May 28, 2017
6b97a18
Duplicated everything again
Fleshgrinder May 28, 2017
7e94490
Changed const values to be static
Fleshgrinder May 28, 2017
2fe2133
Made namespaces & nil into functions
Fleshgrinder May 29, 2017
55a21f2
Merge remote-tracking branch 'upstream/master' into rfc/uuid
Fleshgrinder May 29, 2017
441dfb0
Added C++ compatibility
Fleshgrinder May 29, 2017
cf94293
Made all references absolute
Fleshgrinder May 29, 2017
1f67ef0
Moved UUID to PHP\Std namespace
Fleshgrinder May 29, 2017
4fcb326
Fixed gcc errors + warnings
Fleshgrinder May 29, 2017
694e367
Merge branch 'rfc/uuid' into rfc/uuid-namespaced
Fleshgrinder May 29, 2017
b1ac4de
Consistenly use unsigned char everywhere
Fleshgrinder May 29, 2017
0c88212
Merge branch 'rfc/uuid' into rfc/uuid-namespaced
Fleshgrinder May 29, 2017
2ab7c5a
Use char instead of uchar for sprintf
Fleshgrinder May 29, 2017
c5a7b11
Merge branch 'rfc/uuid' into rfc/uuid-namespaced
Fleshgrinder May 29, 2017
92e0a28
More signes changes according to gcc
Fleshgrinder May 29, 2017
d846250
Merge branch 'rfc/uuid' into rfc/uuid-namespaced
Fleshgrinder May 29, 2017
ee74c59
More sign changes according to gcc
Fleshgrinder May 29, 2017
7e2d8c8
More sign warnings from gcc
Fleshgrinder May 29, 2017
03c1627
Fixed all remaining errors + warnings
Fleshgrinder May 31, 2017
2981802
Merge branch 'rfc/uuid' into rfc/uuid-namespaced
Fleshgrinder May 31, 2017
c4596b9
Fixed failing reflection test
Fleshgrinder May 31, 2017
c1067c9
Extended documentation
Fleshgrinder Jun 1, 2017
757f432
Merge branch 'rfc/uuid' into rfc/uuid-namespaced
Fleshgrinder Jun 1, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 59 additions & 4 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,67 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_ARG_VARIADIC_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, ZEND_TYPE_ENCODE(type_hint, allow_null), pass_by_ref, 1 },
#define ZEND_ARG_VARIADIC_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, ZEND_TYPE_ENCODE_CLASS_CONST(#classname, allow_null), pass_by_ref, 1 },


#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null) \
/**
* Start extended argument information block with an object return type
* declaration.
*
* ## Examples
* ```c
* ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arg_info_f, 0, 0, T, 0)
* ZEND_END_ARG_INFO()
* ```
*
* Above example argument information applied to a function _f_ would result in
* the following PHP function signature:
*
* ```php
* function f(): T {}
* ```
*
* @param[in] name
* of the variable where the argument information should be assigned to.
* @param[in] return_reference
* whether the routine returns by reference (`1`) or not (`0`).
* @param[in] required_num_args
* total amount of required (non-optional) arguments of the routine.
* @param[in] class_name
* of the object that this routine must return.
* @param[in] allow_null
* whether the routine's return type is nullable (`1`) or not (`0`).
* @see ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO
* for routines that do not take any arguments.
*/
#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \
static const zend_internal_arg_info name[] = { \
{ (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(#classname, allow_null), return_reference, 0 },
{ (const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(#class_name, allow_null), return_reference, 0 },

/**
* Start argument information block with return object return type declaration.
*
* ## Examples
* ```c
* ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO(arg_info_f, T, 0)
* ZEND_END_ARG_INFO()
* ```
*
* Above example argument information applied to a function _f_ would result
* in the following PHP function signature:
*
* ```php
* function f(): T {}
* ```
*
* @param[in] name
* of the variable where the argument information should be assigned to.
* @param[in] class_name
* of the object that this routine must return.
* @param[in] allow_null
* whether the routine's return type is nullable (`1`) or not (`0`).
* @see ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX
* which allows the specification of the total amount of required arguments.
*/
#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO(name, class_name, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, 0, -1, class_name, allow_null)
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, 0, -1, class_name, allow_null)

#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
static const zend_internal_arg_info name[] = { \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
ReflectionExtension::getClassNames() method on an extension which actually returns some information
--CREDITS--
Felix De Vliegher <felix.devliegher@gmail.com>
Richard Fussenegger <php@fleshgrinder.com>
--FILE--
<?php
$standard = new ReflectionExtension('standard');
var_dump($standard->getClassNames());
?>
==DONE==
--EXPECTF--
array(4) {
--EXPECT--
array(6) {
[0]=>
%s(22) "__PHP_Incomplete_Class"
string(22) "__PHP_Incomplete_Class"
[1]=>
%s(15) "php_user_filter"
string(15) "php_user_filter"
[2]=>
%s(9) "Directory"
string(9) "Directory"
[3]=>
%s(14) "AssertionError"
string(14) "AssertionError"
[4]=>
string(12) "PHP\Std\UUID"
[5]=>
string(26) "PHP\Std\UUIDParseException"
}
==DONE==
1 change: 1 addition & 0 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -3707,6 +3707,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
#endif

BASIC_MINIT_SUBMODULE(random)
BASIC_MINIT_SUBMODULE(uuid)

return SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32.
http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \
var_unserializer.c ftok.c sha1.c user_filters.c uuencode.c \
filters.c proc_open.c streamsfuncs.c http.c password.c \
random.c,,,
random.c uuid.c,,,
-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)

PHP_ADD_MAKEFILE_FRAGMENT
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
user_filters.c uuencode.c filters.c proc_open.c password.c \
streamsfuncs.c http.c flock_compat.c random.c", false /* never shared */,
streamsfuncs.c http.c flock_compat.c random.c uuid.c", false /* never shared */,
'/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
PHP_INSTALL_HEADERS("", "ext/standard");
if (PHP_MBREGEX != "no") {
Expand Down
4 changes: 4 additions & 0 deletions ext/standard/php_standard.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@
#include "php_type.h"
#include "php_password.h"
#include "php_random.h"
#include "php_uuid.h"

#include "php_version.h"
#define PHP_STANDARD_VERSION PHP_VERSION

/* PHP standard module namespace. */
#define PHP_STD_NAMESPACE PHP_NAMESPACE PHP_NAMESPACE_SEPARATOR "Std"

#define phpext_standard_ptr basic_functions_module_ptr
PHP_MINIT_FUNCTION(standard_filters);
PHP_MSHUTDOWN_FUNCTION(standard_filters);
Expand Down
Loading