Skip to content

Commit ea27765

Browse files
authored
Merge pull request #68 from moufmouf/update_functions
Updating functions list with new documentation
2 parents 204aef2 + 6ec9a70 commit ea27765

26 files changed

+849
-221
lines changed

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"generated/msql.php",
5353
"generated/mssql.php",
5454
"generated/mysql.php",
55+
"generated/mysqli.php",
5556
"generated/mysqlndMs.php",
5657
"generated/mysqlndQc.php",
5758
"generated/network.php",
@@ -78,6 +79,7 @@
7879
"generated/solr.php",
7980
"generated/spl.php",
8081
"generated/sqlsrv.php",
82+
"generated/ssdeep.php",
8183
"generated/ssh2.php",
8284
"generated/stats.php",
8385
"generated/stream.php",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
namespace Safe\Exceptions;
3+
4+
class MysqliException extends AbstractSafeException
5+
{
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
namespace Safe\Exceptions;
3+
4+
class SsdeepException extends AbstractSafeException
5+
{
6+
}

generated/array.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,42 @@ function array_multisort(array &$array1, $array1_sort_order = SORT_ASC, $array1_
102102
}
103103

104104

105+
/**
106+
* Searches haystack for needle.
107+
*
108+
* @param mixed $needle The searched value.
109+
*
110+
* If needle is a string, the comparison is done
111+
* in a case-sensitive manner.
112+
* @param array $haystack The array.
113+
* @param bool $strict If the third parameter strict is set to TRUE
114+
* then the array_search function will search for
115+
* identical elements in the
116+
* haystack. This means it will also perform a
117+
* strict type comparison of the
118+
* needle in the haystack,
119+
* and objects must be the same instance.
120+
* @return int|string Returns the key for needle if it is found in the
121+
* array, FALSE otherwise.
122+
*
123+
* If needle is found in haystack
124+
* more than once, the first matching key is returned. To return the keys for
125+
* all matching values, use array_keys with the optional
126+
* search_value parameter instead.
127+
* @throws ArrayException
128+
*
129+
*/
130+
function array_search($needle, array $haystack, bool $strict = false)
131+
{
132+
error_clear_last();
133+
$result = \array_search($needle, $haystack, $strict);
134+
if ($result === false) {
135+
throw ArrayException::createFromPhpError();
136+
}
137+
return $result;
138+
}
139+
140+
105141
/**
106142
* Applies the user-defined callback function to each
107143
* element of the array. This function will recurse

generated/filesystem.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,8 @@ function fopen(string $filename, string $mode, bool $use_include_path = false, $
755755
* @param string $enclosure The optional enclosure parameter sets the field
756756
* enclosure (one character only).
757757
* @param string $escape_char The optional escape_char parameter sets the
758-
* escape character (one character only).
758+
* escape character (at most one character).
759+
* An empty string ("") disables the proprietary escape mechanism.
759760
* @return int Returns the length of the written string .
760761
* @throws FilesystemException
761762
*
@@ -1305,10 +1306,6 @@ function tempnam(string $dir, string $prefix): string
13051306
* the file handle returned by tmpfile), or when the
13061307
* script ends.
13071308
*
1308-
* For details, consult your system documentation on the
1309-
* tmpfile(3) function, as well as the
1310-
* stdio.h header file.
1311-
*
13121309
* @return resource Returns a file handle, similar to the one returned by
13131310
* fopen, for the new file .
13141311
* @throws FilesystemException

generated/filter.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,55 @@ function filter_has_var(int $type, string $variable_name): void
2424
}
2525

2626

27+
/**
28+
* This function is useful for retrieving many values without
29+
* repetitively calling filter_input.
30+
*
31+
* @param int $type One of INPUT_GET, INPUT_POST,
32+
* INPUT_COOKIE, INPUT_SERVER, or
33+
* INPUT_ENV.
34+
* @param int|array $definition An array defining the arguments. A valid key is a string
35+
* containing a variable name and a valid value is either a filter type, or an array
36+
* optionally specifying the filter, flags and options. If the value is an
37+
* array, valid keys are filter which specifies the
38+
* filter type,
39+
* flags which specifies any flags that apply to the
40+
* filter, and options which specifies any options that
41+
* apply to the filter. See the example below for a better understanding.
42+
*
43+
* This parameter can be also an integer holding a filter constant. Then all values in the
44+
* input array are filtered by this filter.
45+
* @param bool $add_empty Add missing keys as NULL to the return value.
46+
* @return mixed An array containing the values of the requested variables on success.
47+
* If the input array designated by type is not populated,
48+
* the function returns NULL if the FILTER_NULL_ON_FAILURE
49+
* flag is not given, or FALSE otherwise. For other failures, FALSE is returned.
50+
*
51+
* An array value will be FALSE if the filter fails, or NULL if
52+
* the variable is not set. Or if the flag FILTER_NULL_ON_FAILURE
53+
* is used, it returns FALSE if the variable is not set and NULL if the filter
54+
* fails. If the add_empty parameter is FALSE, no array
55+
* element will be added for unset variables.
56+
* @throws FilterException
57+
*
58+
*/
59+
function filter_input_array(int $type, $definition = null, bool $add_empty = true)
60+
{
61+
error_clear_last();
62+
if ($add_empty !== true) {
63+
$result = \filter_input_array($type, $definition, $add_empty);
64+
} elseif ($definition !== null) {
65+
$result = \filter_input_array($type, $definition);
66+
} else {
67+
$result = \filter_input_array($type);
68+
}
69+
if ($result === false) {
70+
throw FilterException::createFromPhpError();
71+
}
72+
return $result;
73+
}
74+
75+
2776
/**
2877
* This function is useful for retrieving many values without
2978
* repetitively calling filter_var.

generated/funchand.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,16 @@ function forward_static_call_array(callable $function, array $parameters)
8787
* @param callable $function The function or method to be called. This parameter may be an array,
8888
* with the name of the class, and the method, or a string, with a function
8989
* name.
90-
* @param mixed $parameter Zero or more parameters to be passed to the function.
91-
* @param mixed $params
90+
* @param mixed $params Zero or more parameters to be passed to the function.
9291
* @return mixed Returns the function result, .
9392
* @throws FunchandException
9493
*
9594
*/
96-
function forward_static_call(callable $function, $parameter = null, ...$params)
95+
function forward_static_call(callable $function, ...$params)
9796
{
9897
error_clear_last();
9998
if ($params !== []) {
100-
$result = \forward_static_call($function, $parameter, ...$params);
101-
} elseif ($parameter !== null) {
102-
$result = \forward_static_call($function, $parameter);
99+
$result = \forward_static_call($function, ...$params);
103100
} else {
104101
$result = \forward_static_call($function);
105102
}
@@ -115,18 +112,15 @@ function forward_static_call(callable $function, $parameter = null, ...$params)
115112
*
116113
* @param callable $function The function name as a string, or an array consisting of an object and
117114
* a method.
118-
* @param mixed $arg
119115
* @param mixed $params
120116
* @throws FunchandException
121117
*
122118
*/
123-
function register_tick_function(callable $function, $arg = null, ...$params): void
119+
function register_tick_function(callable $function, ...$params): void
124120
{
125121
error_clear_last();
126122
if ($params !== []) {
127-
$result = \register_tick_function($function, $arg, ...$params);
128-
} elseif ($arg !== null) {
129-
$result = \register_tick_function($function, $arg);
123+
$result = \register_tick_function($function, ...$params);
130124
} else {
131125
$result = \register_tick_function($function);
132126
}

generated/functionsList.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'apcu_sma_info',
2828
'array_combine',
2929
'array_multisort',
30+
'array_search',
3031
'array_walk_recursive',
3132
'arsort',
3233
'asort',
@@ -171,6 +172,7 @@
171172
'touch',
172173
'unlink',
173174
'filter_has_var',
175+
'filter_input_array',
174176
'filter_var_array',
175177
'fastcgi_finish_request',
176178
'ftp_alloc',
@@ -296,8 +298,11 @@
296298
'imageopenpolygon',
297299
'imagepng',
298300
'imagepolygon',
301+
'imagepsencodefont',
302+
'imagepsextendfont',
303+
'imagepsfreefont',
304+
'imagepsslantfont',
299305
'imagerectangle',
300-
'imageresolution',
301306
'imagerotate',
302307
'imagesavealpha',
303308
'imagescale',
@@ -379,11 +384,14 @@
379384
'inotify_rm_watch',
380385
'json_encode',
381386
'json_last_error_msg',
387+
'ldap_add_ext',
382388
'ldap_add',
389+
'ldap_bind_ext',
383390
'ldap_bind',
384391
'ldap_control_paged_result_response',
385392
'ldap_control_paged_result',
386393
'ldap_count_entries',
394+
'ldap_delete_ext',
387395
'ldap_delete',
388396
'ldap_exop_passwd',
389397
'ldap_exop_whoami',
@@ -399,14 +407,18 @@
399407
'ldap_get_values_len',
400408
'ldap_get_values',
401409
'ldap_list',
410+
'ldap_mod_add_ext',
402411
'ldap_mod_add',
412+
'ldap_mod_del_ext',
403413
'ldap_mod_del',
414+
'ldap_mod_replace_ext',
404415
'ldap_mod_replace',
405416
'ldap_modify_batch',
406417
'ldap_next_attribute',
407418
'ldap_parse_exop',
408419
'ldap_parse_result',
409420
'ldap_read',
421+
'ldap_rename_ext',
410422
'ldap_rename',
411423
'ldap_sasl_bind',
412424
'ldap_search',
@@ -431,6 +443,7 @@
431443
'event_priority_set',
432444
'event_set',
433445
'event_timer_set',
446+
'libxml_get_last_error',
434447
'libxml_set_external_entity_loader',
435448
'lzf_compress',
436449
'lzf_decompress',
@@ -486,6 +499,7 @@
486499
'mssql_data_seek',
487500
'mssql_field_length',
488501
'mssql_field_name',
502+
'mssql_field_seek',
489503
'mssql_field_type',
490504
'mssql_free_result',
491505
'mssql_free_statement',
@@ -524,6 +538,8 @@
524538
'mysql_tablename',
525539
'mysql_thread_id',
526540
'mysql_unbuffered_query',
541+
'mysqli_get_cache_stats',
542+
'mysqli_get_client_stats',
527543
'mysqlnd_ms_dump_servers',
528544
'mysqlnd_ms_fabric_select_global',
529545
'mysqlnd_ms_fabric_select_shard',
@@ -568,8 +584,10 @@
568584
'oci_rollback',
569585
'oci_server_version',
570586
'oci_set_action',
587+
'oci_set_call_timeout',
571588
'oci_set_client_identifier',
572589
'oci_set_client_info',
590+
'oci_set_db_operation',
573591
'oci_set_edition',
574592
'oci_set_module_name',
575593
'oci_set_prefetch',
@@ -906,16 +924,22 @@
906924
'spl_autoload_unregister',
907925
'sqlsrv_begin_transaction',
908926
'sqlsrv_cancel',
927+
'sqlsrv_client_info',
909928
'sqlsrv_close',
910929
'sqlsrv_commit',
911930
'sqlsrv_configure',
912931
'sqlsrv_execute',
913932
'sqlsrv_free_stmt',
933+
'sqlsrv_get_field',
914934
'sqlsrv_next_result',
935+
'sqlsrv_num_fields',
915936
'sqlsrv_num_rows',
916937
'sqlsrv_prepare',
917938
'sqlsrv_query',
918939
'sqlsrv_rollback',
940+
'ssdeep_fuzzy_compare',
941+
'ssdeep_fuzzy_hash_filename',
942+
'ssdeep_fuzzy_hash',
919943
'ssh2_auth_agent',
920944
'ssh2_auth_hostbased_file',
921945
'ssh2_auth_password',
@@ -962,7 +986,9 @@
962986
'convert_uudecode',
963987
'convert_uuencode',
964988
'hex2bin',
989+
'md5_file',
965990
'metaphone',
991+
'sha1_file',
966992
'sprintf',
967993
'substr',
968994
'swoole_async_write',

0 commit comments

Comments
 (0)