We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 40a75dd + d6a0f62 commit 373964cCopy full SHA for 373964c
CREDITS
@@ -1 +1,2 @@
1
-jwt
+JWT
2
+ZiHang Gao
README.md
@@ -2,7 +2,10 @@
<p><a target="_blank" href="https://jwt.io"><img src="https://jwt.io/img/logo-asset.svg" /></a></p>
3
<p>A PHP extension for <a target="_blank" href="https://tools.ietf.org/html/rfc7519">RFC 7519 OAuth JSON Web Token (JWT)</a></p>
4
<a target="_blank" href="https://travis-ci.org/cdoco/php-jwt" title="Build Status"><img src="https://travis-ci.org/cdoco/php-jwt.svg"></a>
5
- <img src="https://img.shields.io/badge/branch-master-brightgreen.svg?style=flat-square">
+ <img src="https://img.shields.io/badge/PHP-%3E%3D7.0.0-blue.svg">
6
+ <img src="https://img.shields.io/badge/OpenSSL-%3E%3D1.0.1f-blue.svg">
7
+ <img src="https://img.shields.io/badge/branch-master-brightgreen.svg">
8
+ <img src="https://img.shields.io/github/repo-size/cdoco/php-jwt.svg">
9
</div>
10
11
## Requirement
@@ -318,10 +321,10 @@ try {
318
321
## Functions
319
322
320
323
```php
-//encode
-string jwt_encode(array $claims, string $key [, string $algorithm = 'HS256'])
324
+// encode
325
+string jwt_encode(array $payload, string $key [, string $algorithm = 'HS256'])
326
-//decode
327
+// decode
328
array jwt_decode(string $token, string $key [, array $options = ['algorithm' => 'HS256']])
329
```
330
jwt.c
@@ -50,6 +50,18 @@ PHP_JWT_API zend_class_entry *jwt_invalid_sub_cex;
50
51
ZEND_DECLARE_MODULE_GLOBALS(jwt)
52
53
+ZEND_BEGIN_ARG_INFO_EX(arginfo_jwt_encode, 0, 0, 2)
54
+ ZEND_ARG_ARRAY_INFO(0, payload, 1)
55
+ ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1)
56
+ ZEND_ARG_TYPE_INFO(0, alg, IS_STRING, 1)
57
+ZEND_END_ARG_INFO()
58
+
59
+ZEND_BEGIN_ARG_INFO_EX(arginfo_jwt_decode, 0, 0, 2)
60
+ ZEND_ARG_TYPE_INFO(0, token, IS_STRING, 1)
61
62
+ ZEND_ARG_INFO(0, options)
63
64
65
/* string to algorithm */
66
jwt_alg_t jwt_str_alg(const char *alg)
67
{
@@ -618,8 +630,8 @@ PHP_FUNCTION(jwt_decode)
618
630
}
619
631
620
632
const zend_function_entry jwt_functions[] = {
621
- PHP_FE(jwt_encode, NULL)
622
- PHP_FE(jwt_decode, NULL)
633
+ PHP_FE(jwt_encode, arginfo_jwt_encode)
634
+ PHP_FE(jwt_decode, arginfo_jwt_decode)
623
635
PHP_FE_END
624
636
};
625
637
php_jwt.h
@@ -24,7 +24,7 @@
24
extern zend_module_entry jwt_module_entry;
25
#define phpext_jwt_ptr &jwt_module_entry
26
27
-#define PHP_JWT_VERSION "0.2.1" /* Replace with version number for your extension */
+#define PHP_JWT_VERSION "0.2.2" /* Replace with version number for your extension */
28
29
#ifdef PHP_WIN32
30
# define PHP_JWT_API __declspec(dllexport)
0 commit comments