Pastakhov has uploaded a new change for review.
https://gerrit.wikimedia.org/r/181783
Change subject: update for PhpTags version 4.0.0 Hook release 6 (v 3.4.0)
......................................................................
update for PhpTags version 4.0.0 Hook release 6 (v 3.4.0)
Change-Id: Ie3c76c931d12f379fbdf26d07bf34d69c1c62c93
---
A PhpTagsFunctions.json
M PhpTagsFunctions.php
M includes/PhpTagsFunc.php
M includes/PhpTagsFuncUseful.php
M includes/PhpTagsWebRequest.php
M tests/phpunit/!!!firstInit_Test.php
6 files changed, 2,187 insertions(+), 53 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PhpTagsFunctions
refs/changes/83/181783/1
diff --git a/PhpTagsFunctions.json b/PhpTagsFunctions.json
new file mode 100644
index 0000000..1b5b983
--- /dev/null
+++ b/PhpTagsFunctions.json
@@ -0,0 +1,1924 @@
+{
+ "objects": {
+ "WebRequest": {
+ "class": "PhpTagsWebRequest",
+ "STATIC METHODS": {
+ "getArray": {
+ "parameters": [
+ { "type": "string", "name":
"name" },
+ { "type": "array", "name":
"default", "default": "null" }
+ ],
+ "return": "array",
+ "desc": "Get an array or null if the
parameter was not passed. If the parameter is a scalar, it will return an array
with a single element"
+ },
+ "getBool": {
+ "parameters": [
+ { "type": "string", "name":
"name" },
+ { "type": "bool", "name":
"default", "default": "false" }
+ ],
+ "return": "bool",
+ "desc": "Get a boolean or false if the
parameter was not passed"
+ },
+ "getCheck": {
+ "parameters": [
+ { "type": "string", "name":
"name" }
+ ],
+ "return": "bool",
+ "desc": "Return a boolean whether the
parameter was passed, this is useful for checkboxes"
+ },
+ "getCookie": {
+ "parameters": [
+ { "type": "string", "name":
"name" },
+ { "type": "mixed", "name":
"default", "default": "null" }
+ ],
+ "return": "mixed",
+ "desc": "Get a cookie from the $_COOKIE
jar"
+ },
+ "getInt": {
+ "parameters": [
+ { "type": "string", "name":
"name" },
+ { "type": "int", "name":
"default", "default": "0" }
+ ],
+ "return": "int",
+ "desc": "Get an integer or 0 if the
parameter was not passed"
+ },
+ "getText": {
+ "parameters": [
+ { "type": "string", "name":
"name" },
+ { "type": "string", "name":
"default", "default": "" }
+ ],
+ "return": "string",
+ "desc": "Fetch a text string from the
given array or return $default if it's not set"
+ },
+ "getVal": {
+ "parameters": [
+ { "type": "string", "name":
"name" },
+ { "type": "string", "name":
"default", "default": "null" }
+ ],
+ "return": "string",
+ "desc": "Get a scalar or null if the
parameter was not passed"
+ },
+ "getValues": {
+ "parameters": [
+ { "type": "string", "name":
"..." }
+ ],
+ "return": "string",
+ "desc": "Get a scalar or null if the
parameter was not passed"
+ },
+ "wasPosted": {
+ "parameters": [],
+ "return": "bool",
+ "desc": "Returns true if the present
request was reached by a POST operation false otherwise (GET, HEAD)"
+ }
+ }
+ }
+ },
+ "functions": {
+ "array_change_key_case": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" },
+ { "type": "int", "name": "case", "default":
"CASE_LOWER" }
+ ],
+ "return": "array",
+ "desc": "Changes the case of all keys in an array"
+ },
+ "array_chunk": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" },
+ { "type": "int", "name": "size" },
+ { "type": "bool", "name": "preserve_keys",
"default": "false" }
+ ],
+ "return": "array",
+ "desc": "Split an array into chunks"
+ },
+ "array_combine": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "keys" },
+ { "type": "array", "name": "values" }
+ ],
+ "return": "array",
+ "desc": "Creates an array by using one array for keys
and another for its values"
+ },
+ "array_count_values": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" }
+ ],
+ "return": "array",
+ "desc": "Counts all the values of an array"
+ },
+ "array_diff_assoc": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "array2" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Computes the difference of arrays with
additional index check"
+ },
+ "array_diff_key": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "array2" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Computes the difference of arrays using keys
for comparison"
+ },
+ "array_diff": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "array2" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Computes the difference of arrays"
+ },
+ "array_fill_keys": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "keys" },
+ { "type": "mixed", "name": "value" }
+ ],
+ "return": "array",
+ "desc": "Fill an array with values, specifying keys"
+ },
+ "array_fill": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "int", "name": "start_index" },
+ { "type": "int", "name": "num" },
+ { "type": "mixed", "name": "value" }
+ ],
+ "return": "array",
+ "desc": "Fill an array with values"
+ },
+ "array_flip": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" }
+ ],
+ "return": "array",
+ "desc": "Exchanges all keys with their associated
values in an array"
+ },
+ "array_intersect_assoc": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "array2" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Computes the intersection of arrays with
additional index check"
+ },
+ "array_intersect_key": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "array2" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Computes the intersection of arrays using keys
for comparison"
+ },
+ "array_intersect": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "array2" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Computes the intersection of arrays"
+ },
+ "array_key_exists": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "scalar", "name": "key" },
+ { "type": "array", "name": "array" }
+ ],
+ "return": "bool",
+ "desc": "Checks if the given key or index exists in the
array"
+ },
+ "array_keys": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" },
+ { "type": "mixed", "name": "search_value",
"default": "null" },
+ { "type": "bool", "name": "strict", "default":
"false" }
+ ],
+ "return": "array",
+ "desc": "Return all the keys or a subset of the keys of
an array"
+ },
+ "array_merge_recursive": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Merge two or more arrays recursively"
+ },
+ "array_merge": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Merge one or more arrays"
+ },
+ "array_multisort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1",
"refarray": "true" },
+ { "type": "not object", "name":
"array1_sort_order", "refarray": "1", "default": "SORT_ASC" },
+ { "type": "not object", "name":
"array1_sort_flags", "refarray": "1", "default": "SORT_REGULAR" },
+ { "type": "array", "name": "...", "refarray":
"true" }
+ ],
+ "return": "array",
+ "desc": "Sort multiple or multi-dimensional arrays"
+ },
+ "array_pad": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" },
+ { "type": "int", "name": "size" },
+ { "type": "mixed", "name": "value" }
+ ],
+ "return": "array",
+ "desc": "Pad array to the specified length with a value"
+ },
+ "array_pop": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Pop the element off the end of array"
+ },
+ "array_product": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" }
+ ],
+ "return": "number",
+ "desc": "Calculate the product of values in an array"
+ },
+ "array_push": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" },
+ { "type": "mixed", "name": "value1" },
+ { "type": "mixed", "name": "..." }
+ ],
+ "return": "int",
+ "desc": "Push one or more elements onto the end of
array"
+ },
+ "array_rand": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" },
+ { "type": "int", "name": "num", "default": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Pick one or more random entries out of an
array"
+ },
+ "array_replace_recursive": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "array2" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Replaces elements from passed arrays into the
first array recursively"
+ },
+ "array_replace": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array1" },
+ { "type": "array", "name": "array2" },
+ { "type": "array", "name": "..." }
+ ],
+ "return": "array",
+ "desc": "Replaces elements from passed arrays into the
first array"
+ },
+ "array_reverse": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" },
+ { "type": "bool", "name": "preserve_keys",
"default": "false" }
+ ],
+ "return": "array",
+ "desc": "Return an array with elements in reverse order"
+ },
+ "array_search": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "needle" },
+ { "type": "array", "name": "haystack" },
+ { "type": "bool", "name": "strict", "default":
"false" }
+ ],
+ "return": "mixed",
+ "desc": "Searches the array for a given value and
returns the corresponding key if successful"
+ },
+ "array_shift": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Shift an element off the beginning of array"
+ },
+ "array_slice": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" },
+ { "type": "int", "name": "offset" },
+ { "type": "int", "name": "length", "default":
"NULL" },
+ { "type": "bool", "name": "preserve_keys",
"default": "false" }
+ ],
+ "return": "array",
+ "desc": "Extract a slice of the array"
+ },
+ "array_splice": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "input",
"reference": "1" },
+ { "type": "int", "name": "offset" },
+ { "type": "int", "name": "length", "default":
"NULL" },
+ { "type": "mixed", "name": "replacement",
"default": "array()" }
+ ],
+ "return": "array",
+ "desc": "Remove a portion of the array and replace it
with something else"
+ },
+ "array_sum": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" }
+ ],
+ "return": "number",
+ "desc": "Calculate the sum of values in an array"
+ },
+ "array_unique": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" },
+ { "type": "int", "name": "sort_flags",
"default": "SORT_STRING" }
+ ],
+ "return": "array",
+ "desc": "Removes duplicate values from an array"
+ },
+ "array_unshift": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" },
+ { "type": "mixed", "name": "value1" },
+ { "type": "mixed", "name": "..." }
+ ],
+ "return": "int",
+ "desc": "Prepend one or more elements to the beginning
of an array"
+ },
+ "array_values": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array" }
+ ],
+ "return": "array",
+ "desc": "Return all the values of an array"
+ },
+ "arsort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" },
+ { "type": "int", "name": "sort_flags",
"default": "SORT_REGULAR" }
+ ],
+ "return": "bool",
+ "desc": "Sort an array in reverse order and maintain
index association"
+ },
+ "asort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" },
+ { "type": "int", "name": "sort_flags",
"default": "SORT_REGULAR" }
+ ],
+ "return": "bool",
+ "desc": "Sort an array and maintain index association"
+ },
+ "count": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "array_or_countable"
},
+ { "type": "int", "name": "mode", "default":
"COUNT_NORMAL" }
+ ],
+ "return": "int",
+ "desc": "Count all elements in an array, or something
in an object"
+ },
+ "current": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Return the current element in an array"
+ },
+ "each": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "array",
+ "desc": "Return the current key and value pair from an
array and advance the array cursor"
+ },
+ "end": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Set the internal pointer of an array to its
last element"
+ },
+ "in_array": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "needle" },
+ { "type": "array", "name": "haystack" },
+ { "type": "bool", "name": "strict", "default":
"FALSE" }
+ ],
+ "return": "bool",
+ "desc": "Checks if a value exists in an array"
+ },
+ "key_exists": { "alias": "array_key_exists" },
+ "key": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Fetch a key from an array"
+ },
+ "krsort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" },
+ { "type": "int", "name": "sort_flags",
"default": "SORT_REGULAR" }
+ ],
+ "return": "bool",
+ "desc": "Sort an array by key in reverse order"
+ },
+ "ksort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" },
+ { "type": "int", "name": "sort_flags",
"default": "SORT_REGULAR" }
+ ],
+ "return": "bool",
+ "desc": "Sort an array by key"
+ },
+ "natcasesort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "bool",
+ "desc": "Sort an array using a case insensitive
'natural order' algorithm"
+ },
+ "natsort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "bool",
+ "desc": "Sort an array using a 'natural order'
algorithm"
+ },
+ "next": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Advance the internal array pointer of an array"
+ },
+ "pos": { "alias": "current" },
+ "prev": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Rewind the internal array pointer"
+ },
+ "range": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "scalar", "name": "start" },
+ { "type": "scalar", "name": "end" },
+ { "type": "number", "name": "step", "default":
"1" }
+ ],
+ "return": "array",
+ "desc": "Create an array containing a range of elements"
+ },
+ "reset": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "mixed",
+ "desc": "Set the internal pointer of an array to its
first element"
+ },
+ "rsort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" },
+ { "type": "int", "name": "sort_flags",
"default": "SORT_REGULAR" }
+ ],
+ "return": "bool",
+ "desc": "Sort an array in reverse order"
+ },
+ "shuffle": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" }
+ ],
+ "return": "bool",
+ "desc": "Shuffle an array"
+ },
+ "sizeof": { "alias": "count" },
+ "sort": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "array", "name": "array",
"reference": "1" },
+ { "type": "int", "name": "sort_flags",
"default": "SORT_REGULAR" }
+ ],
+ "return": "bool",
+ "desc": "Sort an array"
+ },
+ "preg_filter": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "not object", "name": "pattern" },
+ { "type": "not object", "name": "replacement" },
+ { "type": "not object", "name": "subject" },
+ { "type": "int", "name": "limit", "default":
"-1" },
+ { "type": "int", "name": "count", "reference":
"1", "default": "NULL" }
+ ],
+ "return": "mixed",
+ "desc": "Perform a regular expression search and
replace"
+ },
+ "preg_grep": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "string", "name": "pattern" },
+ { "type": "array", "name": "input" },
+ { "type": "int", "name": "flags", "default":
"0" }
+ ],
+ "return": "array",
+ "desc": "Return array entries that match the pattern"
+ },
+ "preg_last_error": {
+ "class": "PhpTagsFunc",
+ "parameters": [],
+ "return": "int",
+ "desc": "Returns the error code of the last PCRE regex
execution"
+ },
+ "preg_match_all": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "string", "name": "pattern" },
+ { "type": "string", "name": "subject" },
+ { "type": "array", "name": "$matches",
"reference": "1", "default": "NULL" },
+ { "type": "int", "name": "flags", "default":
"PREG_PATTERN_ORDER" },
+ { "type": "int", "name": "offset", "default":
"0" }
+ ],
+ "return": "int",
+ "desc": "Perform a global regular expression match"
+ },
+ "preg_match": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "string", "name": "pattern" },
+ { "type": "string", "name": "subject" },
+ { "type": "array", "name": "$matches",
"reference": "1", "default": "NULL" },
+ { "type": "int", "name": "flags", "default":
"0" },
+ { "type": "int", "name": "offset", "default":
"0" }
+ ],
+ "return": "int",
+ "desc": "Perform a regular expression match"
+ },
+ "preg_quote": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "string", "name": "str" },
+ { "type": "string", "name": "delimiter",
"default": "NULL" }
+ ],
+ "return": "string",
+ "desc": "Quote regular expression characters"
+ },
+ "preg_replace": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "not object", "name": "pattern" },
+ { "type": "not object", "name": "replacement" },
+ { "type": "not object", "name": "subject" },
+ { "type": "int", "name": "limit", "default":
"-1" },
+ { "type": "int", "name": "count", "reference":
"1", "default": "NULL" }
+ ],
+ "return": "mixed",
+ "desc": "Perform a regular expression search and
replace"
+ },
+ "preg_split": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "string", "name": "pattern" },
+ { "type": "string", "name": "subject" },
+ { "type": "int", "name": "limit", "default":
"-1" },
+ { "type": "int", "name": "flags", "default":
"0" }
+ ],
+ "return": "array",
+ "desc": "Split string by a regular expression"
+ },
+ "abs": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "number" }
+ ],
+ "return": "number",
+ "desc": "Absolute value"
+ },
+ "acos": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Arc cosine"
+ },
+ "acosh": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Inverse hyperbolic cosine"
+ },
+ "asin": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Arc sine"
+ },
+ "asinh": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Inverse hyperbolic sine"
+ },
+ "atan2": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "y" },
+ { "type": "number", "name": "x" }
+ ],
+ "return": "float",
+ "desc": "Arc tangent of two variables"
+ },
+ "atan": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Arc tangent"
+ },
+ "atanh": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Inverse hyperbolic tangent"
+ },
+ "base_convert": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "number" },
+ { "type": "int", "name": "frombase" },
+ { "type": "int", "name": "tobase" }
+ ],
+ "return": "string",
+ "desc": "Convert a number between arbitrary bases"
+ },
+ "bindec": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "string", "name": "binary_string" }
+ ],
+ "return": "number",
+ "desc": "Binary to decimal"
+ },
+ "ceil": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Round fractions up"
+ },
+ "cos": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Cosine"
+ },
+ "cosh": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Hyperbolic cosine"
+ },
+ "decbin": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "int", "name": "number" }
+ ],
+ "return": "string",
+ "desc": "Decimal to binary"
+ },
+ "dechex": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "int", "name": "number" }
+ ],
+ "return": "string",
+ "desc": "Decimal to hexadecimal"
+ },
+ "decoct": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "int", "name": "number" }
+ ],
+ "return": "string",
+ "desc": "Decimal to octal"
+ },
+ "deg2rad": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Converts the number in degrees to the radian
equivalent"
+ },
+ "exp": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Calculates the exponent of e"
+ },
+ "expm1": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Returns exp(number) - 1"
+ },
+ "floor": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "value" }
+ ],
+ "return": "float",
+ "desc": "Round fractions down"
+ },
+ "fmod": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "x" },
+ { "type": "number", "name": "y" }
+ ],
+ "return": "float",
+ "desc": "Returns the floating point remainder (modulo)
of the division of the arguments"
+ },
+ "getrandmax": {
+ "class": "PhpTagsFunc",
+ "parameters": [],
+ "return": "int",
+ "desc": "Show largest possible random value"
+ },
+ "hexdec": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "string", "name": "hex_string" }
+ ],
+ "return": "number",
+ "desc": "Hexadecimal to decimal"
+ },
+ "hypot": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "x" },
+ { "type": "number", "name": "y" }
+ ],
+ "return": "float",
+ "desc": "Calculate the length of the hypotenuse of a
right-angle triangle"
+ },
+ "is_finite": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "val" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether a value is a legal finite number"
+ },
+ "is_infinite": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "val" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether a value is infinite"
+ },
+ "is_nan": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "val" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether a value is not a number"
+ },
+ "lcg_value": {
+ "class": "PhpTagsFunc",
+ "parameters": [],
+ "return": "float",
+ "desc": "Combined linear congruential generator"
+ },
+ "log10": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Base-10 logarithm"
+ },
+ "log1p": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "number" }
+ ],
+ "return": "float",
+ "desc": "Returns log(1 + number)"
+ },
+ "log": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" },
+ { "type": "number", "name": "base", "default":
"M_E" }
+ ],
+ "return": "float",
+ "desc": "Natural logarithm"
+ },
+ "max": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "not object", "name": "value" },
+ { "type": "not object", "name": "value2",
"default": "NULL" },
+ { "type": "not object", "name": "..." }
+ ],
+ "return": "mixed",
+ "desc": "Find highest value"
+ },
+ "min": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "not object", "name": "value" },
+ { "type": "not object", "name": "value2",
"default": "NULL" },
+ { "type": "not object", "name": "..." }
+ ],
+ "return": "mixed",
+ "desc": "Find lowest value"
+ },
+ "mt_getrandmax": {
+ "class": "PhpTagsFunc",
+ "parameters": [],
+ "return": "int",
+ "desc": "Show largest possible random value"
+ },
+ "mt_rand": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "int", "name": "min", "default":
"NULL" },
+ { "type": "int", "name": "max", "default":
"NULL" }
+ ],
+ "return": "int",
+ "desc": "Generate a better random value"
+ },
+ "mt_srand": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "int", "name": "seed", "default":
"NULL" }
+ ],
+ "return": "void",
+ "desc": "Seed the better random number generator"
+ },
+ "octdec": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "string", "name": "octal_string" }
+ ],
+ "return": "number",
+ "desc": "Octal to decimal"
+ },
+ "pi": {
+ "class": "PhpTagsFunc",
+ "parameters": [],
+ "return": "float",
+ "desc": "Get value of pi"
+ },
+ "pow": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "base" },
+ { "type": "number", "name": "exp" }
+ ],
+ "return": "number",
+ "desc": "Exponential expression"
+ },
+ "rad2deg": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "number" }
+ ],
+ "return": "float",
+ "desc": "Converts the radian number to the equivalent
number in degrees"
+ },
+ "rand": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "int", "name": "min", "default":
"NULL" },
+ { "type": "int", "name": "max", "default":
"NULL" }
+ ],
+ "return": "int",
+ "desc": "Generate a random integer"
+ },
+ "round": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "val" },
+ { "type": "int", "name": "precision",
"default": "0" },
+ { "type": "int", "name": "mode", "default":
"PHP_ROUND_HALF_UP" }
+ ],
+ "return": "float",
+ "desc": "Rounds a float"
+ },
+ "sin": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Sine"
+ },
+ "sinh": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Hyperbolic sine"
+ },
+ "sqrt": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Square root"
+ },
+ "srand": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "int", "name": "seed", "default":
"NULL" }
+ ],
+ "return": "void",
+ "desc": "Seed the random number generator"
+ },
+ "tan": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Tangent"
+ },
+ "tanh": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "number", "name": "arg" }
+ ],
+ "return": "float",
+ "desc": "Hyperbolic tangent"
+ },
+ "boolval": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Get the boolean value of a variable"
+ },
+ "floatval": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "not object", "name": "var" }
+ ],
+ "return": "float",
+ "desc": "Get float value of a variable"
+ },
+ "doubleval": { "alias": "floatval" },
+ "get_defined_vars": {
+ "class": "PhpTagsFunc",
+ "parameters": [],
+ "return": "array",
+ "desc": "Returns an array of all defined variables"
+ },
+ "gettype": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "string",
+ "desc": "Get the type of a variable"
+ },
+ "intval": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "not object", "name": "var" },
+ { "type": "int", "name": "base", "default":
"10" }
+ ],
+ "return": "int",
+ "desc": "Get the integer value of a variable"
+ },
+ "is_array": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether a variable is an array"
+ },
+ "is_bool": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Finds out whether a variable is a boolean"
+ },
+ "is_float": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether the type of a variable is float"
+ },
+ "is_double": { "alias": "is_float" },
+ "is_int": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Find whether the type of a variable is integer"
+ },
+ "is_integer": { "alias": "is_int" },
+ "is_long": { "alias": "is_int" },
+ "is_null": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether a variable is NULL"
+ },
+ "is_numeric": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether a variable is a number or a
numeric string"
+ },
+ "is_object": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether a variable is an object"
+ },
+ "is_real": { "alias": "is_float" },
+ "is_scalar": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Finds whether a variable is a scalar"
+ },
+ "is_string": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var" }
+ ],
+ "return": "bool",
+ "desc": "Find whether the type of a variable is string"
+ },
+ "print_r": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "expression" },
+ { "type": "bool", "name": "return", "default":
"false" }
+ ],
+ "return": "mixed",
+ "desc": "Prints human-readable information about a
variable"
+ },
+ "settype": {
+ "class": "PhpTagsFunc",
+ "parameters": [
+ { "type": "mixed", "name": "var", "reference":
"1" },
+ { "type": "string", "name": "type" }
+ ],
+ "return": "bool",
+ "desc": "Set the type of a variable"
+ }
+ "uuid_create": {
+ "class": "PhpTagsFuncUseful",
+ "parameters": [],
+ "return": "string",
+ "desc": "Create random UUID"
+ },
+ "mw_json_decode": {
+ "class": "PhpTagsFuncUseful",
+ "parameters": [
+ { "type": "string", "name": "value" }
+ ],
+ "return": "string",
+ "desc": "Decodes a JSON string"
+ },
+ "mw_json_encode": {
+ "class": "PhpTagsFuncUseful",
+ "parameters": [
+ { "type": "string", "name": "value" }
+ ],
+ "return": "string",
+ "desc": "Returns the JSON representation of a value"
+ }
+ },
+ "constants": {
+ "PHPTAGS_FUNCTIONS_VERSION" : {
+ "desc": "The current version of the PhpTags Functions
extension as a string",
+ "type": "string",
+ "link": "mw://Extension:PhpTags_Functions"
+ },
+ "PHP_VERSION": {
+ "desc": "The current PHP version as a string",
+ "type": "string",
+ "link": "php://reserved.constants.php"
+ },
+ "PHP_MAJOR_VERSION": {
+ "desc": "The current PHP 'major' version as an integer",
+ "type": "int",
+ "link": "php://reserved.constants.php"
+ },
+ "PHP_MINOR_VERSION": {
+ "desc": "The current PHP 'minor' version as an integer",
+ "type": "int",
+ "link": "php://reserved.constants.php"
+ },
+ "PHP_RELEASE_VERSION": {
+ "desc": "The current PHP 'release' version as an
integer",
+ "type": "int",
+ "link": "php://reserved.constants.php"
+ },
+ "PHP_INT_MAX": {
+ "desc": "The largest integer supported in this build of
PHP",
+ "type": "int",
+ "link": "php://reserved.constants.php"
+ },
+ "PHP_INT_SIZE": {
+ "type": "int",
+ "link": "php://reserved.constants.php"
+ },
+ "PHP_OS": {
+ "type": "string",
+ "link": "php://reserved.constants.php"
+ },
+ "DATE_ATOM": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_COOKIE": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_ISO8601": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_RFC822": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_RFC850": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_RFC1036": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_RFC1123": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_RFC2822": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_RFC3339": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_RSS": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "DATE_W3C": {
+ "type": "string",
+ "link": "php://class.datetime.php"
+ },
+ "SUNFUNCS_RET_TIMESTAMP": {
+ "type": "int",
+ "link": "php://datetime.constants.php"
+ },
+ "SUNFUNCS_RET_STRING": {
+ "type": "int",
+ "link": "php://datetime.constants.php"
+ },
+ "SUNFUNCS_RET_DOUBLE": {
+ "type": "int",
+ "link": "php://datetime.constants.php"
+ },
+ "CASE_LOWER": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "CASE_UPPER": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "COUNT_NORMAL": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "COUNT_RECURSIVE": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "ARRAY_FILTER_USE_BOTH": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "ARRAY_FILTER_USE_KEY": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "ASSERT_ACTIVE": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "ASSERT_CALLBACK": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "ASSERT_BAIL": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "ASSERT_WARNING": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "ASSERT_QUIET_EVAL": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "SORT_ASC": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "SORT_DESC": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "SORT_REGULAR": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "SORT_NUMERIC": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "SORT_STRING": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "SORT_LOCALE_STRING": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "SORT_NATURAL": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "SORT_FLAG_CASE": {
+ "type": "int",
+ "link": "php://array.constants.php"
+ },
+ "ABDAY_1": {
+ "type": "int",
+ "desc": "Abbreviated name of n-th day of the week",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABDAY_2": {
+ "type": "int",
+ "desc": "Abbreviated name of n-th day of the week",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABDAY_3": {
+ "type": "int",
+ "desc": "Abbreviated name of n-th day of the wee",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABDAY_4": {
+ "type": "int",
+ "desc": "Abbreviated name of n-th day of the week",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABDAY_5": {
+ "type": "int",
+ "desc": "Abbreviated name of n-th day of the week",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABDAY_6": {
+ "type": "int",
+ "desc": "Abbreviated name of n-th day of the week",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABDAY_7": {
+ "type": "int",
+ "desc": "Abbreviated name of n-th day of the week",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "DAY_1": {
+ "type": "int",
+ "desc": "Name of the n-th day of the week (DAY_1 =
Sunday)",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "DAY_2": {
+ "type": "int",
+ "desc": "Name of the n-th day of the week (DAY_1 =
Sunday)",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "DAY_3": {
+ "type": "int",
+ "desc": "Name of the n-th day of the week (DAY_1 =
Sunday)",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "DAY_4": {
+ "type": "int",
+ "desc": "Name of the n-th day of the week (DAY_1 =
Sunday)",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "DAY_5": {
+ "type": "int",
+ "desc": "Name of the n-th day of the week (DAY_1 =
Sunday)",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "DAY_6": {
+ "type": "int",
+ "desc": "Name of the n-th day of the week (DAY_1 =
Sunday)",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "DAY_7": {
+ "type": "int",
+ "desc": "Name of the n-th day of the week (DAY_1 =
Sunday)",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_1": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_2": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_3": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_4": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_5": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_6": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_7": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_8": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_9": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_10": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_11": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ABMON_12": {
+ "type": "int",
+ "desc": "Abbreviated name of the n-th month of the
year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_1": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_2": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_3": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_4": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_5": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_6": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_7": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_8": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_9": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_10": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_11": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "MON_12": {
+ "type": "int",
+ "desc": "Name of the n-th month of the year",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "AM_STR": {
+ "type": "int",
+ "desc": "String for Ante meridian",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "PM_STR": {
+ "type": "int",
+ "desc": "String for Post meridian",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "D_T_FMT": {
+ "type": "int",
+ "desc": "String that can be used as the format string
for strftime() to represent time and date",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "D_FMT": {
+ "type": "int",
+ "desc": "String that can be used as the format string
for strftime() to represent date",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "T_FMT": {
+ "type": "int",
+ "desc": "String that can be used as the format string
for strftime() to represent time",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "T_FMT_AMPM": {
+ "type": "int",
+ "desc": "String that can be used as the format string
for strftime() to represent time in 12-hour format with ante/post meridian",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ERA": {
+ "type": "int",
+ "desc": "Alternate era",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ERA_D_T_FMT": {
+ "type": "int",
+ "desc": "Date and time in alternate era format",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ERA_D_FMT": {
+ "type": "int",
+ "desc": "Date in alternate era format",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ERA_T_FMT": {
+ "type": "int",
+ "desc": "Time in alternate era format",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "ERA_D_T_FMT": {
+ "type": "int",
+ "desc": "Date and time in alternate era format",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "CODESET": {
+ "type": "int",
+ "desc": "Return a string with the name of the character
encoding",
+ "link": "php://function.nl-langinfo.php"
+ },
+ "CRYPT_SALT_LENGTH": {
+ "type": "int",
+ "link": "php://function.crypt.php"
+ },
+ "CRYPT_STD_DES": {
+ "type": "int",
+ "link": "php://function.crypt.php"
+ },
+ "CRYPT_EXT_DES": {
+ "type": "int",
+ "link": "php://function.crypt.php"
+ },
+ "CRYPT_MD5": {
+ "type": "int",
+ "link": "php://function.crypt.php"
+ },
+ "CRYPT_BLOWFISH": {
+ "type": "int",
+ "link": "php://function.crypt.php"
+ },
+ "CRYPT_SHA256": {
+ "type": "int",
+ "link": "php://function.crypt.php"
+ },
+ "CRYPT_SHA512": {
+ "type": "int",
+ "link": "php://function.crypt.php"
+ },
+ "HTML_SPECIALCHARS": {
+ "type": "int"
+ },
+ "HTML_ENTITIES": {
+ "type": "int"
+ },
+ "ENT_COMPAT": {
+ "type": "int",
+ "desc": "Will convert double-quotes and leave
single-quotes alone",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_QUOTES": {
+ "type": "int",
+ "desc": "Will convert both double and single quotes",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_NOQUOTES": {
+ "type": "int",
+ "desc": "Will leave both double and single quotes
unconverted",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_IGNORE": {
+ "type": "int",
+ "desc": "Silently discard invalid code unit sequences
instead of returning an empty string",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_SUBSTITUTE": {
+ "type": "int",
+ "desc": "Replace invalid code unit sequences with a
Unicode Replacement Character U+FFFD (UTF-8) or &#FFFD; (otherwise) instead of
returning an empty string",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_DISALLOWED": {
+ "type": "int",
+ "desc": "Replace invalid code points for the given
document type with a Unicode Replacement Character U+FFFD (UTF-8) or &#FFFD;",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_HTML401": {
+ "type": "int",
+ "desc": "Handle code as HTML 4.01",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_XML1": {
+ "type": "int",
+ "desc": "Handle code as XML 1",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_XHTML": {
+ "type": "int",
+ "desc": "Handle code as XHTML",
+ "link": "php://function.htmlentities.php"
+ },
+ "ENT_HTML5": {
+ "type": "int",
+ "desc": "Handle code as HTML 5",
+ "link": "php://function.htmlentities.php"
+ },
+ "CHAR_MAX": {
+ "type": "int"
+ },
+ "STR_PAD_LEFT": {
+ "type": "int",
+ "link": "php://function.str-pad.php"
+ },
+ "STR_PAD_RIGHT": {
+ "type": "int",
+ "link": "php://function.str-pad.php"
+ },
+ "STR_PAD_BOTH": {
+ "type": "int",
+ "link": "php://function.str-pad.php"
+ },
+ "M_PI": {
+ "type": "int",
+ "desc": "Pi",
+ "link": "php://math.constants.php"
+ },
+ "M_PI_2": {
+ "type": "int",
+ "desc": "pi/2",
+ "link": "php://math.constants.php"
+ },
+ "M_PI_4": {
+ "type": "int",
+ "desc": "pi/4",
+ "link": "php://math.constants.php"
+ },
+ "M_1_PI": {
+ "type": "int",
+ "desc": "1/pi",
+ "link": "php://math.constants.php"
+ },
+ "M_2_PI": {
+ "type": "int",
+ "desc": "2/pi",
+ "link": "php://math.constants.php"
+ },
+ "M_SQRTPI": {
+ "type": "int",
+ "desc": "sqrt(pi)",
+ "link": "php://math.constants.php"
+ },
+ "M_2_SQRTPI": {
+ "type": "int",
+ "desc": "2/sqrt(pi)",
+ "link": "php://math.constants.php"
+ },
+ "M_LNPI": {
+ "type": "int",
+ "desc": "log_e(pi)",
+ "link": "php://math.constants.php"
+ },
+ "M_EULER": {
+ "type": "int",
+ "desc": "Euler constant",
+ "link": "php://math.constants.php"
+ },
+ "M_SQRT2": {
+ "type": "int",
+ "desc": "sqrt(2)",
+ "link": "php://math.constants.php"
+ },
+ "M_SQRT1_2": {
+ "type": "int",
+ "desc": "1/sqrt(2)",
+ "link": "php://math.constants.php"
+ },
+ "M_SQRT3": {
+ "type": "int",
+ "desc": "sqrt(3)",
+ "link": "php://math.constants.php"
+ },
+ "INF": {
+ "type": "int",
+ "desc": "The infinite",
+ "link": "php://math.constants.php"
+ },
+ "NAN": {
+ "type": "int",
+ "desc": "Not A Number",
+ "link": "php://math.constants.php"
+ },
+ "PHP_ROUND_HALF_UP": {
+ "type": "int",
+ "desc": "Round halves up",
+ "link": "php://math.constants.php"
+ },
+ "PHP_ROUND_HALF_DOWN": {
+ "type": "int",
+ "desc": "Round halves down",
+ "link": "php://math.constants.php"
+ },
+ "PHP_ROUND_HALF_EVEN": {
+ "type": "int",
+ "desc": "Round halves to even numbers",
+ "link": "php://math.constants.php"
+ },
+ "PHP_ROUND_HALF_ODD": {
+ "type": "int",
+ "desc": "Round halves to odd numbers",
+ "link": "php://math.constants.php"
+ },
+ "M_E": {
+ "type": "int",
+ "desc": "e",
+ "link": "php://math.constants.php"
+ },
+ "M_LOG2E": {
+ "type": "int",
+ "desc": "log_2 e",
+ "link": "php://math.constants.php"
+ },
+ "M_LOG10E": {
+ "type": "int",
+ "desc": "log_10 e",
+ "link": "php://math.constants.php"
+ },
+ "M_LN2": {
+ "type": "int",
+ "desc": "log_e 2",
+ "link": "php://math.constants.php"
+ },
+ "M_LN10": {
+ "type": "int",
+ "desc": "log_e 10",
+ "link": "php://math.constants.php"
+ },
+ "PREG_PATTERN_ORDER": {
+ "type": "int",
+ "desc": "Orders results so that $matches[0] is an array
of full pattern matches, $matches[1] is an array of strings matched by the
first parenthesized subpattern, and so on",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_SET_ORDER": {
+ "type": "int",
+ "desc": "Orders results so that $matches[0] is an array
of first set of matches, $matches[1] is an array of second set of matches, and
so on",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_OFFSET_CAPTURE": {
+ "type": "int",
+ "desc": "If this flag is set, for every occurring match
the appendant string offset will also be returned. Note that this changes the
return values in an array where every element is an array consisting of the
matched string at offset 0 and its string offset within subject at offset 1",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_SPLIT_NO_EMPTY": {
+ "type": "int",
+ "desc": "This flag tells preg_split() to return only
non-empty pieces",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_SPLIT_DELIM_CAPTURE": {
+ "type": "int",
+ "desc": "This flag tells preg_split() to capture
parenthesized expression in the delimiter pattern as well",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_SPLIT_OFFSET_CAPTURE": {
+ "type": "int",
+ "desc": "If this flag is set, for every occurring match
the appendant string offset will also be returned. Note that this changes the
return values in an array where every element is an array consisting of the
matched string at offset 0 and its string offset within subject at offset 1",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_NO_ERROR": {
+ "type": "int",
+ "desc": "Returned by preg_last_error() if there were no
errors",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_INTERNAL_ERROR": {
+ "type": "int",
+ "desc": "Returned by preg_last_error() if there was an
internal PCRE error",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_BACKTRACK_LIMIT_ERROR": {
+ "type": "int",
+ "desc": "Returned by preg_last_error() if backtrack
limit was exhausted",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_RECURSION_LIMIT_ERROR": {
+ "type": "int",
+ "desc": "Returned by preg_last_error() if recursion
limit was exhausted",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_BAD_UTF8_ERROR": {
+ "type": "int",
+ "desc": "Returned by preg_last_error() if the last
error was caused by malformed UTF-8 data",
+ "link": "php://pcre.constants.php"
+ },
+ "PCRE_VERSION": {
+ "type": "string",
+ "desc": "PCRE version and release date",
+ "link": "php://pcre.constants.php"
+ },
+ "PREG_GREP_INVERT": {
+ "type": "int",
+ "link": "php://function.preg-grep.php"
+ },
+ "MB_OVERLOAD_MAIL": {
+ "type": "int",
+ "link": "php://mbstring.constants.php"
+ },
+ "MB_OVERLOAD_STRING": {
+ "type": "int",
+ "link": "php://mbstring.constants.php"
+ },
+ "MB_OVERLOAD_REGEX": {
+ "type": "int",
+ "link": "php://mbstring.constants.php"
+ },
+ "MB_CASE_UPPER": {
+ "type": "int",
+ "link": "php://mbstring.constants.php"
+ },
+ "MB_CASE_LOWER": {
+ "type": "int",
+ "link": "php://mbstring.constants.php"
+ },
+ "MB_CASE_TITLE": {
+ "type": "int",
+ "link": "php://mbstring.constants.php"
+ },
+ "UUID": {
+ "type": "string",
+ "class": "PhpTagsFuncUseful",
+ "desc": "returns random UUID"
+ }
+ }
+}
diff --git a/PhpTagsFunctions.php b/PhpTagsFunctions.php
index 6946137..f6d2c80 100644
--- a/PhpTagsFunctions.php
+++ b/PhpTagsFunctions.php
@@ -19,7 +19,7 @@
die( 'ERROR: The <a
href="https://www.mediawiki.org/wiki/Extension:PhpTags">extension PhpTags</a>
must be installed for the extension PhpTags Functions to run!' );
}
-$needVersion = '3.8.0';
+$needVersion = '4.0.0';
if ( version_compare( PHPTAGS_VERSION, $needVersion, '<' ) ) {
die(
'<b>Error:</b> This version of extension PhpTags Functions
needs <a href="https://www.mediawiki.org/wiki/Extension:PhpTags">PhpTags</a> '
. $needVersion . ' or later.
@@ -27,13 +27,13 @@
);
}
-if ( PHPTAGS_HOOK_RELEASE != 5 ) {
+if ( PHPTAGS_HOOK_RELEASE != 6 ) {
die (
'<b>Error:</b> This version of extension PhpTags
Functions is not compatible to current version of extension PhpTags.'
);
}
-const PHPTAGS_FUNCTIONS_VERSION = '3.3.3';
+const PHPTAGS_FUNCTIONS_VERSION = '3.4.0';
// Register this extension on Special:Version
$wgExtensionCredits['phptags'][] = array(
@@ -53,13 +53,13 @@
/**
* @codeCoverageIgnore
*/
-$wgHooks['PhpTagsRuntimeFirstInit'][] =
'PhpTagsFunctionsInit::initializeRuntime';
+$wgHooks['PhpTagsRuntimeFirstInit'][] = function() {
+ \PhpTags\Hooks::setJsonFile( __DIR__ . '/PhpTagsFunctions.json',
PHPTAGS_FUNCTIONS_VERSION );
+};
// Preparing classes for autoloading
-$wgAutoloadClasses['PhpTagsFunctionsInit'] = __DIR__ .
'/PhpTagsFunctions.init.php';
-$wgAutoloadClasses['PhpTagsFunc'] = __DIR__ . '/includes/PhpTagsFunc.php';
-$wgAutoloadClasses['PhpTagsFuncRef'] = __DIR__ .
'/includes/PhpTagsFuncRef.php';
-$wgAutoloadClasses['PhpTagsFuncUseful'] = __DIR__ .
'/includes/PhpTagsFuncUseful.php';
+$wgAutoloadClasses['PhpTagsObjects\\PhpTagsFunc'] = __DIR__ .
'/includes/PhpTagsFunc.php';
+$wgAutoloadClasses['PhpTagsObjects\\PhpTagsFuncUseful'] = __DIR__ .
'/includes/PhpTagsFuncUseful.php';
$wgAutoloadClasses['PhpTagsObjects\\PhpTagsFuncNativeObject'] = __DIR__ .
'/includes/PhpTagsFuncNativeObject.php';
$wgAutoloadClasses['PhpTagsObjects\\PhpTagsWebRequest'] = __DIR__ .
'/includes/PhpTagsWebRequest.php';
diff --git a/includes/PhpTagsFunc.php b/includes/PhpTagsFunc.php
index db8aa3d..18f817c 100644
--- a/includes/PhpTagsFunc.php
+++ b/includes/PhpTagsFunc.php
@@ -1,4 +1,5 @@
<?php
+namespace PhpTagsObjects;
/**
*
@@ -8,11 +9,11 @@
* @author Pavel Astakhov <[email protected]>
* @licence GNU General Public Licence 2.0 or later
*/
-class PhpTagsFunc extends PhpTags\GenericFunction {
+class PhpTagsFunc extends \PhpTags\GenericObject {
public static function __callStatic( $name, $arguments ) {
foreach ( $arguments as &$arg ) {
- if ( $arg instanceof PhpTags\GenericObject ) {
+ if ( $arg instanceof \PhpTags\GenericObject ) {
$arg = $arg->getValue();
}
}
@@ -24,9 +25,6 @@
return $return;
}
- /**
- * @todo remove it for PHP 5 >= 5.5.0
- */
public static function f_boolval( $var ) {
return (bool)$var;
}
@@ -39,24 +37,24 @@
}
public static function f_get_defined_functions() {
- return PhpTags\Hooks::getDefinedFunctions();
+ return \PhpTags\Hooks::getDefinedFunctions();
}
public static function f_function_exists( $function_name ) {
- $functions = PhpTags\Hooks::getDefinedFunctions();
+ $functions = \PhpTags\Hooks::getDefinedFunctions();
return isset( $functions[$function_name] );
}
public static function f_printf() {
$arguments = func_get_args();
$ret = call_user_func_array( 'sprintf', $arguments );
- return new PhpTags\outPrint( strlen($ret), $ret, false, false );
+ return new \PhpTags\outPrint( strlen($ret), $ret, false, false
);
}
public static function f_vprintf() {
$arguments = func_get_args();
$ret = call_user_func_array( 'vsprintf', $arguments );
- return new PhpTags\outPrint( strlen($ret), $ret, false, false );
+ return new \PhpTags\outPrint( strlen($ret), $ret, false, false
);
}
public static function f_var_export( $expression, $return = false ) {
@@ -64,7 +62,7 @@
$expression = $expression->getValue();
}
$ret = var_export( $expression, true );
- return $return ? $ret : new PhpTags\outPrint( null, $ret );
+ return $return ? $ret : new \PhpTags\outPrint( null, $ret );
}
public static function f_var_dump() {
@@ -76,7 +74,7 @@
}
ob_start();
call_user_func_array( 'var_dump', $args );
- return new PhpTags\outPrint( null, ob_get_clean() );
+ return new \PhpTags\outPrint( null, ob_get_clean() );
}
public static function f_print_r( $expression, $return = false ) {
@@ -84,7 +82,247 @@
$expression = $expression->getValue();
}
$ret = print_r( $expression, true );
- return $return ? $ret : new PhpTags\outPrint( true, $ret );
+ return $return ? $ret : new \PhpTags\outPrint( true, $ret );
+ }
+
+ /**
+ * @todo remove it for PHP >= 5.4.0
+ */
+ public static function f_preg_match_all ( $pattern , $subject,
&$matches = null, $flags = PREG_PATTERN_ORDER, $offset = 0 ) {
+// 1) PhpTags\PhpTagsFunctions_PCRE_Test::testRun_preg_match_all_1
+// Parameter 3 to preg_match_all() expected to be a reference,
value given
+// 2) PhpTags\PhpTagsFunctions_PCRE_Test::testRun_preg_match_all_2
+// Parameter 3 to preg_match_all() expected to be a reference,
value given
+//
+// // $trace = debug_backtrace();
+// // $args = $trace[1]['args'];
+// $args = func_get_args();
+// if ( ! array_key_exists( 2, $args ) ) {
+// $args[2] = null;
+// }
+// return call_user_func_array( 'preg_match_all', $args );
+
+ return preg_match_all( $pattern , $subject, $matches, $flags,
$offset );
+ }
+
+ protected static function f_preg_replace() {
+ $args = func_get_args();
+ try {
+ if ( is_array($args[0]) ) {
+ $tmp = array();
+ foreach ( $args[0] as $key => $value ) {
+ $tmp[$key] = self::getValidPattern(
$value );
+ }
+ $args[0] = $tmp;
+ }else{
+ $args[0] = self::getValidPattern( $args[0] );
+ }
+ } catch ( \Exception $exc ) {
+ throw new \PhpTags\PhpTagsException(
\PhpTags\PhpTagsException::EXCEPTION_FROM_HOOK, array( 'preg_replace(): ' .
$exc->getMessage(), $exc->getCode() ) );
+ }
+
+ return call_user_func_array( 'preg_replace', $args );
+ }
+
+ private static function getValidPattern ( $pattern ) {
+ $pattern = str_replace(chr(0), '', $pattern);
+ // Set basic statics
+ $regexStarts = '`~!@#$%^&*-_+=.,?"\':;|/<([{';
+ $regexEnds = '`~!@#$%^&*-_+=.,?"\':;|/>)]}';
+ $regexModifiers = 'imsxADU';
+
+ $delimPos = strpos( $regexStarts, $pattern[0] );
+ if ( $delimPos === false ) {
+ throw new Exception(
+ wfMessage(
'phptagsfunctions-preg-bad-delimiter' )->text(),
+
\PhpTags\PhpTagsException::EXCEPTION_WARNING
+ );
+ }
+
+ $end = $regexEnds[$delimPos];
+ $pos = 1;
+ $endPos = null;
+ while ( !isset( $endPos ) ) {
+ $pos = strpos( $pattern, $end, $pos );
+ if ( $pos === false ) {
+ throw new Exception(
+ wfMessage(
'phptagsfunctions-preg-no-ending-delimiter', $end )->text(),
+
\PhpTags\PhpTagsException::EXCEPTION_WARNING
+ );
+ }
+ $backslashes = 0;
+ for ( $l = $pos - 1; $l >= 0; $l-- ) {
+ if ( $pattern[$l] == '\\' ) {
+ $backslashes++;
+ } else {
+ break;
+ }
+ }
+ if ( $backslashes % 2 == 0 ) {
+ $endPos = $pos;
+ }
+ $pos++;
+ }
+ $startRegex = (string)substr( $pattern, 0, $endPos ) . $end;
+ $endRegex = (string)substr( $pattern, $endPos + 1 );
+ $len = strlen( $endRegex );
+ for ( $c = 0; $c < $len; $c++ ) {
+ if ( strpos( $regexModifiers, $endRegex[$c] ) === false
) {
+ throw new Exception(
+ wfMessage(
'phptagsfunctions-preg-unknown-modifier', $endRegex[$c] )->text(),
+
\PhpTags\PhpTagsException::EXCEPTION_WARNING
+ );
+ }
+ }
+ return $startRegex . $endRegex;
+ }
+
+ public static function f_settype ( &$var, $type ) {
+ if ( $var instanceof \PhpTags\GenericObject )
+ switch ( $type ) {
+ case: 'object':
+ throw new Exception("could not be converted to $type" );
+ }
+ if ( $type == 'object' ) {
+ return false; // @todo
+ }
+ return settype( $var, $type );
+ }
+
+ public static function f_max () {
+ $values = func_get_args();
+ if ( func_num_args() === 1 && false === is_array( $values[0] )
) {
+ throw new \PhpTags\PhpTagsException(
+
\PhpTags\PhpTagsException::WARNING_EXPECTS_PARAMETER,
+ array( 'max', 1, 'array', gettype( $values[0] )
)
+ );
+ }
+ return call_user_func_array( 'max', $values );
+ }
+
+ public static function f_min () {
+ $values = func_get_args();
+ if ( func_num_args() === 1 && false === is_array( $values[0] )
) {
+ throw new \PhpTags\PhpTagsException(
+
\PhpTags\PhpTagsException::WARNING_EXPECTS_PARAMETER,
+ array( 'min', 1, 'array', gettype( $values[0] )
)
+ );
+ }
+ return call_user_func_array( 'min', $values );
+ }
+
+ public static function f_mt_rand () {
+ switch ( func_num_args() ) {
+ case 1:
+ return mt_rand( func_get_arg(0),
mt_getrandmax() );
+ case 2:
+ return mt_rand( func_get_arg(0),
func_get_arg(1) );
+ default: //0
+ return mt_rand();
+ }
+ }
+
+ public static function f_rand () {
+ switch ( func_num_args() ) {
+ case 1:
+ return rand( func_get_arg(0), getrandmax() );
+ case 2:
+ return rand( func_get_arg(0), func_get_arg(1) );
+ default: //0
+ return rand();
+ }
+ }
+
+ public static function f_compact() {
+ return parent::f_compact(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_extract() {
+ return parent::f_extract(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_diff_uassoc() { // @todo callback
+ return parent::f_array_diff_uassoc(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_diff_ukey() { // @todo callback
+ return parent::f_array_diff_ukey(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_filter() { // @todo callback
+ return parent::f_array_filter(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_intersect_uassoc() { // @todo callback
+ return parent::f_array_intersect_uassoc(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_intersect_ukey() { // @todo callback
+ return parent::f_array_intersect_ukey(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_map() { // @todo callback
+ return parent::f_array_map(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_reduce() { // @todo callback
+ return parent::f_array_reduce(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_udiff_assoc() { // @todo callback
+ return parent::f_array_udiff_assoc(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_udiff_uassoc() { // @todo callback
+ return parent::f_array_udiff_uassoc(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_udiff() { // @todo callback
+ return parent::f_array_udiff(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_uintersect_assoc() { // @todo callback
+ return parent::f_array_uintersect_assoc(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_uintersect_uassoc() { // @todo callback
+ return parent::f_array_uintersect_uassoc(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_uintersect() { // @todo callback
+ return parent::f_array_uintersect(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_walk_recursive() { // @todo callback
+ return parent::f_array_walk_recursive(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_array_walk() { // @todo callback
+ return parent::f_array_walk(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_uasort() { // @todo callback
+ return parent::f_uasort(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_uksort() { // @todo callback
+ return parent::f_uksort(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_usort() { // @todo callback
+ return parent::f_usort(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_preg_replace_callback() { // @todo callback
+ return parent::f_preg_replace_callback(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_is_callable() { // @todo callback
+ return parent::f_is_callable(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
+ }
+
+ public static function f_import_request_variables() {
+ return parent::f_import_request_variables(); // Error message:
WARNING_CALLFUNCTION_INVALID_HOOK
}
}
diff --git a/includes/PhpTagsFuncUseful.php b/includes/PhpTagsFuncUseful.php
index a12135d..5626cf5 100644
--- a/includes/PhpTagsFuncUseful.php
+++ b/includes/PhpTagsFuncUseful.php
@@ -1,4 +1,5 @@
<?php
+namespace PhpTagsObjects;
/**
*
@@ -8,7 +9,7 @@
* @author Pavel Astakhov <[email protected]>
* @licence GNU General Public Licence 2.0 or later
*/
-class PhpTagsFuncUseful extends PhpTags\GenericFunction {
+class PhpTagsFuncUseful extends \PhpTags\GenericObject {
public static function getConstantValue( $constantName ) {
switch ( $constantName ) {
diff --git a/includes/PhpTagsWebRequest.php b/includes/PhpTagsWebRequest.php
index 84fa217..2f3008b 100644
--- a/includes/PhpTagsWebRequest.php
+++ b/includes/PhpTagsWebRequest.php
@@ -8,36 +8,6 @@
*/
class PhpTagsWebRequest extends \PhpTags\GenericObject {
- public static function checkArguments( $object, $method, $arguments,
$expects = false ) {
- switch ( $method ) {
- case 'getval':
- case 'getint':
- case 'getbool':
- case 'getarray':
- case 'getcookie':
- case 'gettext':
- $expects = array(
- \PhpTags\Hooks::TYPE_STRING,
- \PhpTags\Hooks::TYPE_MIXED,
-
\PhpTags\Hooks::EXPECTS_MINIMUM_PARAMETERS => 1,
-
\PhpTags\Hooks::EXPECTS_MAXIMUM_PARAMETERS => 2,
- );
- break;
- case 'getcheck':
- $expects = array(
- \PhpTags\Hooks::TYPE_STRING,
-
\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS => 1,
- );
- break;
- case 'wasposted':
- $expects = array(
-
\PhpTags\Hooks::EXPECTS_EXACTLY_PARAMETERS => 0,
- );
- break;
- }
- return parent::checkArguments( $object, $method, $arguments,
$expects );
- }
-
/**
* Get a scalar or null if the parameter was not passed
* @global \WebRequest $wgRequest
@@ -104,7 +74,8 @@
}
/**
- * Returns a bool whether the request was posted
+ * Returns true if the present request was reached by a POST operation
+ * false otherwise (GET, HEAD, or command-line).
* @global \WebRequest $wgRequest
*/
public static function s_wasPosted() {
diff --git "a/tests/phpunit/\041\041\041firstInit_Test.php"
"b/tests/phpunit/\041\041\041firstInit_Test.php"
index 3e77f5e..34f3770 100644
--- "a/tests/phpunit/\041\041\041firstInit_Test.php"
+++ "b/tests/phpunit/\041\041\041firstInit_Test.php"
@@ -2,7 +2,7 @@
if ( ! defined( 'PhpTagsRuntimeFirstInit' ) ) {
wfRunHooks( 'PhpTagsRuntimeFirstInit' );
+ \PhpTags\Hooks::loadData();
\PhpTags\Runtime::$loopsLimit = 1000;
define( 'PhpTagsRuntimeFirstInit', true );
}
-
--
To view, visit https://gerrit.wikimedia.org/r/181783
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3c76c931d12f379fbdf26d07bf34d69c1c62c93
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PhpTagsFunctions
Gerrit-Branch: master
Gerrit-Owner: Pastakhov <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits