Skip to content

Commit 7340a46

Browse files
committed
Add GINIT FUNCTION.
1 parent f0ea66f commit 7340a46

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
```shell
1414
$ git clone https://github.com/cdoco/hashids.phpc.git
15-
$ cd hashids.phpc && phpize && ./configure && make && make install
15+
$ cd hashids.phpc
16+
$ phpize && ./configure && make && make install
1617
```
1718

1819
you can set some options in php.ini, or set in the constructor.

hashids.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ static const zend_function_entry hashids_methods[] = {
339339
PHP_FE_END
340340
};
341341

342+
PHP_GINIT_FUNCTION(hashids) {
343+
hashids_globals->salt = NULL;
344+
hashids_globals->min_hash_length = 0;
345+
hashids_globals->alphabet = HASHIDS_DEFAULT_ALPHABET;
346+
}
347+
342348
PHP_MINIT_FUNCTION(hashids)
343349
{
344350
REGISTER_INI_ENTRIES();

0 commit comments

Comments
 (0)