\

Classes

BkTree A serialisable BK-Tree Implementation.
ids Provides an interface to interact with page ids.
JsonStorageBox Represents a key-value data store.
Nilsimsa The MIT License (MIT)
page_renderer Renders the HTML page that is sent to the client.
Slimdown Modified by Starbeamrainbowlabs (starbeamrainbowlabs)
StorageBox Represents a key-value data store.

Functions

add_action()

add_action(string  $action_name,callable  $func)

Registers a new action handler.

Parameters

string $action_name

The action to register.

callable $func

The function to call when the specified action is requested.

add_help_section()

add_help_section(string  $index,string  $title,string  $content)

Adds a new help section to the help page.

Parameters

string $index

The string to index the new section under.

string $title

The title to display above the section.

string $content

The content to display.

add_parser()

add_parser(string  $name,callable  $parser_code,callable  $hash_generator)

Registers a new parser.

Parameters

string $name

The name of the new parser to register.

callable $parser_code

The function to register as a new parser.

callable $hash_generator

A function that should take a single argument of the input source text, and return a unique hash for that content. The return value is used as the filename for cache entries, so should be safe to use as such.

add_recent_change()

add_recent_change(array  $rchange)

Adds a new recent change to the recent changes file.

Parameters

array $rchange

The new change to add.

check_subpage_parents()

check_subpage_parents(string  $pagename,boolean  $create_dir = true)

Makes sure that a subpage's parents exist.

Note this doesn't check the pagename itself.

Parameters

string $pagename

The pagename to check.

boolean $create_dir

Whether to create an associated directory for subpages or not.

cli()

cli(): void

Parses $_SERVER["argv"] and provides a command-line interface.

This function kill the process if the current execution environment is not the CLI.

cli_exec()

cli_exec(string|array  $string): integer

Executes a given Pepperminty Wiki shell command.

This function kill the process if the current execution environment is not the CLI. The returned exit code functions as a normal shell process exit code does.

Parameters

string|array $string

The shell command to execute.

Returns

integer —

The exit code of the command executed.

cli_register()

cli_register(string  $name,string  $description,callable  $function): void

Registers a new CLI command.

Throws an error if a CLI command with the specified name already exists.

Parameters

string $name

The name of command.

string $description

The description of the command.

callable $function

The function to execute when this command is executed. An array is passed as the first and only argument containing the arguments passed when the command was invoked.

cli_shell()

cli_shell(): \[type]

Starts the Pepperminty Wiki CLI Shell.

This function kill the process if the current execution environment is not the CLI.

Returns

\[type] —

[description]

crypto_id()

crypto_id(integer  $length): string

Generates a crytographically-safe random id of the given length.

Parameters

integer $length

The length of id to generate.

Returns

string —

The random id.

debug_mask_secrets()

debug_mask_secrets(string  $text): string

Masks secrets in debug output.

Parameters

string $text

The text to mask.

Returns

string —

The masked text.

delete_comment()

delete_comment(array  $comment_data,string  $target_id): boolean

Deletes the first comment found with the specified id.

Parameters

array $comment_data

An array of threaded comments to delete the comment from.

string $target_id

The id of the comment to delete.

Returns

boolean —

Whether the comment was found and deleted or not.

delete_recursive()

delete_recursive(string  $path,boolean  $delete_self = true)

Recursively deletes a directory and it's contents.

Adapted by Starbeamrainbowlabs

Parameters

string $path

The path to the directory to delete.

boolean $delete_self

Whether to delete the top-level directory. Set this to false to delete only a directory's contents

do_password_hash_code_update()

do_password_hash_code_update()

Recalculates and updates the password hashing cost.

email_user()

email_user(string  $username,string  $subject,string  $body,boolean  $ignore_verification = false): boolean

Sends a plain text email to a user, replacing {username} with the specified username.

Parameters

string $username

The username to send the email to.

string $subject

The subject of the email.

string $body

The body of the email.

boolean $ignore_verification

Whether to ignore user email verification status and send the email anyway. Defaults to false.

Returns

boolean —

Whether the email was sent successfully or not. Currently, this may fail if the user doesn't have a registered email address.

email_user_verify()

email_user_verify(string  $username): boolean

Sends a verification email to the specified user, assuming they need to verify their email address.

If a user does not need to verify their email address, no verification email is sent and true is returned.

Parameters

string $username

The name of the user to send the verification code to.

Returns

boolean —

Whether the verification code was sent successfully. If a user does not need to verify their email address, this returns true.

email_users()

email_users(array<mixed,string>  $usernames,string  $subject,string  $body): integer

Sends a plain text email to a list of users, replacing {username} with each user's name.

Parameters

array<mixed,string> $usernames

A list of usernames to email.

string $subject

The subject of the email.

string $body

The body of the email.

Returns

integer —

The number of emails sent successfully.

ends_with()

ends_with(string  $haystack,string  $needle): boolean

Checks to see if $hackstack ends with $needle.

The matching bookend to starts_with.

Parameters

string $haystack

The haystack to search..

string $needle

The needle to look for.

Returns

boolean

endsWith()

endsWith(string  $whole,string  $end): boolean

Tests whether a string ends with a given substring.

Parameters

string $whole

The string to test against.

string $end

The substring test for.

Returns

boolean —

Whether $whole ends in $end.

ensure_cli()

ensure_cli(): void

Ensures that the current execution environment is the command-line interface.

This function will not return if thisthe current execution environment is not the CLI.

errorimage()

errorimage(string  $text,integer  $target_size = null): resource

Creates an images containing the specified text.

Useful for sending errors back to the client.

Parameters

string $text

The text to include in the image.

integer $target_size

The target width to aim for when creating the image. Not not specified, a value is determined automatically.

Returns

resource —

The handle to the generated GD image.

estimate_reading_time()

estimate_reading_time(string  $text,string  $lang = "en"): array

Estimates the reading time for a given lump of text.

Ref https://github.com/sbrl/Pepperminty-Wiki/issues/172 (has snippet of original code from Firefox & link to study from which the numbers are taken).

Parameters

string $text

The text to estimate for.

string $lang

The language code of the text - defaults to "en"

Returns

array —

An array in the form [ low_time, high_time ] in minutes

extract_user_from_userpage()

extract_user_from_userpage(string  $userPagename): string

Extracts a username from a user page path.

Parameters

string $userPagename

The suer page path to extract from.

Returns

string —

The name of the user that the user page belongs to.

fetch_comment_thread()

fetch_comment_thread(array  $comment_data,string  $comment_id): array<mixed,object>

Fetches all the parent comments of the specified comment id, including the comment itself at the end.

Useful for figuring out who needs notifying when a new comment is posted.

Parameters

array $comment_data

The comment data to search.

string $comment_id

The comment id to fetch the thread for.

Returns

array<mixed,object> —

A list of the comments in the thread, with the deepest one at the end.

filepath_to_pagename()

filepath_to_pagename(string  $filepath): string

Converts a filepath to a page name.

Parameters

string $filepath

The filepath to convert.

Returns

string —

The extracted pagename.

find_comment()

find_comment(array  $comment_data,string  $comment_id): object

Finds the comment with specified id by way of an almost-breadth-first search.

Parameters

array $comment_data

The comment data to search.

string $comment_id

The id of the comment to find.

Returns

object —

The comment data with the specified id, or false if it wasn't found.

find_revisionid_timestamp()

find_revisionid_timestamp(string  $pagename,  $timestamp): integer

Given a page name and timestamp, returns the associated page revision number.

Parameters

string $pagename

The page name to obtain the revision number for.

$timestamp

Returns

integer —

The revision number of the given page at the given time.

full_url()

full_url(array  $s = false,boolean  $use_forwarded_host = false): string

Get the full url, as requested by the client.

Parameters

array $s

The $_SERVER variable. Defaults to $_SERVER.

boolean $use_forwarded_host

Whether to take the X-Forwarded-Host header into account.

Returns

string —

The full url, as requested by the client.

generate_comment_id()

generate_comment_id(): string

Generates a new random comment id.

Returns

string —

A new random comment id.

generate_page_list()

generate_page_list(array<mixed,string>  $pagelist): string

Renders a list of pages as HTML.

Parameters

array<mixed,string> $pagelist

A list of page names to include in the list.

Returns

string —

The specified list of pages as HTML.

generate_password()

generate_password(string  $length): string

Generates a new (cryptographically secure) random password that's also readable (i.e. consonant-vowel-consonant).

This implementation may be changed in the future to use random dictionary words instead - ref https://xkcd.com/936/

Parameters

string $length

The length of password to generate.

Returns

string —

The generated random password.

get_all_tags()

get_all_tags(): array<mixed,string>

Gets a list of all the tags currently used across the wiki.

Returns

array<mixed,string> —

A list of all unique tags present on all pages across the wiki.

get_comment_filename()

get_comment_filename(string  $pagename): string

Given a page name, returns the absolute file path in which that page's comments are stored.

Parameters

string $pagename

The name pf the page to fetch the comments filename for.

Returns

string —

The path to the file that the

get_max_upload_size()

get_max_upload_size(): integer

Calculates the actual maximum upload size supported by the server Returns a file size limit in bytes based on the PHP upload_max_filesize and post_max_size

Returns

integer —

The maximum upload size supported bythe server, in bytes.

get_page_parent()

get_page_parent(string  $pagename): string|boolean

Gets the name of the parent page to the specified page.

Parameters

string $pagename

The child page to get the parent page name for.

Returns

string|boolean

get_subpages()

get_subpages(object  $pageindex,string  $pagename): object

Gets a list of all the sub pages of the current page.

Parameters

object $pageindex

The pageindex to use to search.

string $pagename

The name of the page to list the sub pages of.

Returns

object —

An object containing all the subpages and their respective distances from the given page name in the pageindex tree.

get_user_pagename()

get_user_pagename(string  $username): string

Figures out the path to the user page for a given username.

Does not check to make sure the user acutally exists.

Parameters

string $username

The username to get the path to their user page for.

Returns

string —

The path to the given user's page.

getallheaders()

getallheaders()

Polyfill for PHP's native getallheaders() function on platforms that don't have it.

getsvgsize()

getsvgsize(string  $svgFilename): array<mixed,integer>

Calculates the size of the specified SVG file.

Parameters

string $svgFilename

The filename to calculate the size of.

Returns

array<mixed,integer> —

The width and height respectively of the specified SVG file.

glob_recursive()

glob_recursive(string  $pattern,integer  $flags): array

A recursive glob() function.

Parameters

string $pattern

The glob pattern to use to find filenames.

integer $flags

The glob flags to use when finding filenames.

Returns

array —

An array of the filepaths that match the given glob.

has_action()

has_action(string  $action_name): boolean

Figures out whether a given action is currently registered.

Only guaranteed to be accurate in inside an existing action function

Parameters

string $action_name

The name of the action to search for

Returns

boolean —

Whether an action with the specified name exists.

has_statistic()

has_statistic(string  $stat_id): boolean

Checks whether a specified statistic has been registered.

Parameters

string $stat_id

The id of the statistic to check the existence of.

Returns

boolean —

Whether the specified statistic has been registered.

hash_password()

hash_password(string  $pass): string

Hashes the given password according to the current settings defined in $settings.

Parameters

string $pass

The password to hash.

Returns

string —

The hashed password. Uses password_hash() under-the-hood, but with some additional extras to avoid known issues.

hash_password_compute_cost()

hash_password_compute_cost(boolean  $verbose = false): integer

Computes the appropriate cost value for password_hash based on the settings automatically.

Starts at 10 and works upwards in increments of 1. Goes on until a value is found that's greater than the target - or 10x the target time elapses.

Parameters

boolean $verbose

Whether to output verbose progress information to the client or not.

Returns

integer —

The automatically calculated password hashing cost.

hash_password_properties()

hash_password_properties(): array

Figures out the appropriate algorithm & options for hashing passwords based on the current settings.

Returns

array —

The appropriate password hashing algorithm and options.

hash_password_update()

hash_password_update(string  $pass,string  $hash): string|null

Determines if the provided password needs re-hashing or not.

Parameters

string $pass

The password to check.

string $hash

The hash of the provided password to check.

Returns

string|null —

Returns null if an updaste is not required - otherwise returns the new updated hash.

hide_email()

hide_email(\string  $email,string  $display_text = null): string

Hides an email address from bots. Returns a fragment of HTML that contains the mangled email address.

Parameters

\string $email
string $display_text

The display text for the resulting HTML - if null then the original email address is used.

Returns

string —

The mangled email address.

history_add_revision()

history_add_revision(object  $pageinfo,string  $newsource,string  $oldsource,boolean  $save_pageindex = true,string  $change_type = "edit")

Adds a history revision against a page.

Note: Does not update the current page content! This function only records a new revision against a page name. Thus it is possible to have a disparity between the history revisions and the actual content displayed in the current revision if you're not careful!

Parameters

object $pageinfo

The pageindex object of the page to operate on.

string $newsource

The page content to save as the new revision.

string $oldsource

The old page content that is the current revision (before the update).

boolean $save_pageindex

Whether the page index should be saved to disk.

string $change_type

The type of change to record this as in the history revision log

human_filesize()

human_filesize(integer  $bytes,integer  $decimals = 2): string

Converts a filesize into a human-readable string.

Parameters

integer $bytes

The number of bytes to convert.

integer $decimals

The number of decimal places to preserve.

Returns

string —

A human-readable filesize.

human_time()

human_time(integer  $seconds): string

Renders a given number of seconds as something that humans can understand more easily.

Parameters

integer $seconds

The number of seconds to render.

Returns

string —

The rendered time.

human_time_since()

human_time_since(integer  $time): string

Calculates the time since a particular timestamp and returns a human-readable result.

Parameters

integer $time

The timestamp to convert.

Returns

string —

The time since the given timestamp as a human-readable string.

is_cli()

is_cli(): boolean

Returns whether we are both on the cli AND the cli is enabled.

Returns

boolean

lines_count()

lines_count(  $handle)

Parameters

$handle

log_str()

log_str(string  $line)

Logs a string to stdout, but only on the CLI.

Parameters

string $line

The line to log.

makepathsafe()

makepathsafe(string  $string): string

Makes a path (or page name) safe.

A safe path / page name may not contain: Forward-slashes at the beginning Multiple dots in a row Odd characters (e.g. ?%*:|"<>() etc.) A safe path may, however, contain unicode characters such as éôà etc.

Parameters

string $string

The string to make safe.

Returns

string —

A safe version of the given string.

mb_stripos_all()

mb_stripos_all(string  $haystack,string  $needle): array|false

Case-insensitively finds all occurrences of $needle in $haystack. Handles UTF-8 characters correctly.

Parameters

string $haystack

The string to search.

string $needle

The string to find.

Returns

array|false —

An array of match indices, or false if nothing was found.

metrics2servertiming()

metrics2servertiming(\stdClass  $perfdata)

Parameters

\stdClass $perfdata

minify_css()

minify_css(string  $css_str): string

Minifies CSS. Uses simple computationally-cheap optimisations to reduce size.

CSS Minification ideas by Jean from catswhocode.com

Parameters

string $css_str

The string of CSS to minify.

Returns

string —

The minified CSS string.

module_exists()

module_exists(string  $id): boolean

Checks to see whether a module with the given id exists.

Parameters

string $id

The id to search for.

Returns

boolean —

Whether a module is currently loaded with the given id.

module_list_find()

module_list_find(array  $list,\string  $id)

Parameters

array $list
\string $id

module_list_search()

module_list_search(array  $list,\string  $id)

Parameters

array $list
\string $id

parse_page_source()

parse_page_source(string  $source,boolean  $untrusted = false,boolean  $use_cache = true): string

Parses the specified page source using the parser specified in the settings into HTML.

The specified parser may (though it's unlikely) render it to other things.

Parameters

string $source

The source to render.

boolean $untrusted

Whether the source string is 'untrusted' - i.e. a user comment. Untrusted source disallows HTML and protects against XSS attacks.

boolean $use_cache

Whether to use the on-disk cache. Has no effect if parser caching is disabled in peppermint.json, or the source string is too small.

Returns

string —

The source rendered to HTML.

parse_size()

parse_size(string  $size): integer

Parses a PHP size to an integer

Parameters

string $size

The size to parse.

Returns

integer —

The number of bytees represented by the specified size string.

path_resolve()

path_resolve(string  $path,string|null  $basePath = null): string

Resolves a relative path against a given base directory.

Parameters

string $path

The relative path to resolve.

string|null $basePath

The base directory to resolve against.

Returns

string —

An absolute path.

path_resolve()

path_resolve(string  $path,string|null  $basePath = null): string

Resolves a relative path against a given base directory.

Parameters

string $path

The relative path to resolve.

string|null $basePath

The base directory to resolve against.

Returns

string —

An absolute path.

register_module()

register_module(array  $moduledata)

Registers a module.

Parameters

array $moduledata

The module data to register.

register_save_preprocessor()

register_save_preprocessor(callable  $func)

Register a new proprocessor that will be executed just before an edit is saved.

Parameters

callable $func

The function to register.

render_comments()

render_comments(array<mixed,object>  $comments_data,integer  $depth): string

Renders a given comments tree to html.

Parameters

array<mixed,object> $comments_data

The comments tree to render.

integer $depth

For internal use only. Specifies the depth at which the comments are being rendered.

Returns

string —

The given comments tree as html.

render_editor()

render_editor(string  $editorName): string

Renders an editor's or a group of editors name(s) in HTML.

Parameters

string $editorName

The name of the editor to render.

Returns

string —

HTML representing the given editor's name.

render_pagename()

render_pagename(object  $rchange): string

Renders a page name in HTML.

Parameters

object $rchange

The recent change to render as a page name

Returns

string —

HTML representing the name of the given page.

render_recent_change()

render_recent_change(object  $rchange): string

Renders a single recent change

Parameters

object $rchange

The recent change to render.

Returns

string —

The recent change, rendered to HTML.

render_recent_change_atom()

render_recent_change_atom(array  $recent_changes): string

Renders a list of recent changes as an Atom 1.0 feed.

Requires the XMLWriter PHP class.

Parameters

array $recent_changes

The array of recent changes to render.

Returns

string —

The recent changes as an Atom 1.0 feed.

render_recent_changes()

render_recent_changes(array  $recent_changes): string

Renders a list of recent changes to HTML.

Parameters

array $recent_changes

The recent changes to render.

Returns

string —

The given recent changes as HTML.

render_sidebar()

render_sidebar(array  $pageindex,string  $root_pagename = ""): string

Renders the sidebar for a given pageindex.

Parameters

array $pageindex

The pageindex to render the sidebar for

string $root_pagename

The pagename that should be considered the root of the rendering. You don't usually need to use this, it is used by the algorithm itself since it is recursive.

Returns

string —

A HTML rendering of the sidebar for the given pageindex.

render_timestamp()

render_timestamp(integer  $timestamp,boolean  $absolute = false,boolean  $html = true): string

Renders a timestamp in HTML.

Parameters

integer $timestamp

The timestamp to render.

boolean $absolute

Whether the time should be displayed absolutely, or relative to the current time.

boolean $html

Whether the result should formatted as HTML (true) or plain text (false).

Returns

string —

HTML representing the given timestamp.

save_pageindex()

save_pageindex(): boolean

Save the page index back to disk, respecting $settings->minify_pageindex

Returns

boolean —

Whether the page index was saved successfully or not.

save_settings()

save_settings(): boolean

Saves the settings file back to peppermint.json.

Returns

boolean —

Whether the settings were saved successfully.

save_userdata()

save_userdata(): boolean

Saves the currently logged in user's data back to peppermint.json.

Returns

boolean —

Whether the user's data was saved successfully. Returns false if the user isn't logged in.

send_cookie()

send_cookie(string  $key,string  $value,integer  $expires): void

Sets a cookie on the client via the set-cookie header.

Uses setcookie() under-the-hood.

Parameters

string $key

The cookie name to set.

string $value

The cookie value to set.

integer $expires

The expiry time to set on the cookie.

similar_suggest()

similar_suggest(string  $pagename,string  $content,\bool  $limit_output = true): array

Given a page name, returns a list fo similar pages.

Parameters

string $pagename

The name of the page to return suggestions for.

string $content

The content of the given page.

\bool $limit_output

Returns

array —

A list of suggested page names in the format pagename => rank.

stack_trace()

stack_trace(boolean  $log_trace = true,boolean  $full = false): string

Generates a stack trace.

Parameters

boolean $log_trace

Whether to send the stack trace to the error log.

boolean $full

Whether to output a full description of all the variables involved.

Returns

string —

A string prepresentation of a stack trace.

standard_deviation()

standard_deviation(array  $array): float

Calculates the standard deviation of an array of numbers.

Parameters

array $array

The array of numbers to calculate the standard deviation of.

Returns

float —

The standard deviation of the numbers in the given array.

starts_with()

starts_with(string  $haystack,string  $needle): boolean

Checks to see if $haystack starts with $needle.

Parameters

string $haystack

The string to search.

string $needle

The string to search for at the beginning of $haystack.

Returns

boolean —

Whether $needle can be found at the beginning of $haystack.

startsWith()

startsWith(string  $haystack,string  $needle): boolean

Tests whether a string starts with a specified substring.

Parameters

string $haystack

The string to check against.

string $needle

The substring to look for.

Returns

boolean —

Whether the string starts with the specified substring.

statistic_add()

statistic_add(array  $stat_data)

Registers a statistic calculator against the system.

Parameters

array $stat_data

The statistic object to register.

stats_load()

stats_load(): object

Loads and returns the statistics cache file.

Returns

object —

The loaded & decoded statistics.

stats_save()

stats_save(  $stats): boolean

Saves the statistics back to disk.

Parameters

$stats

Returns

boolean —

Whether saving succeeded or not.

str_replace_once()

str_replace_once(string  $find,string  $replace,string  $subject): string

Replaces the first occurrence of $find with $replace.

Parameters

string $find

The string to search for.

string $replace

The string to replace the search string with.

string $subject

The string ot perform the search and replace on.

Returns

string —

The source string after the find and replace has been performed.

system_extension_mime_type()

system_extension_mime_type(string  $ext): string

Converts a given file extension to it's associated mime type.

Parameters

string $ext

The extension to convert.

Returns

string —

The mime type associated with the given extension.

system_extension_mime_types()

system_extension_mime_types(): array

Returns the system MIME type mapping of extensions to MIME types.

Returns

array —

An array mapping file extensions to their associated mime types.

system_mime_type_extension()

system_mime_type_extension(string  $type): string

Converts a given mime type to it's associated file extension.

Parameters

string $type

The mime type to convert.

Returns

string —

The extension for the given mime type.

system_mime_type_extensions()

system_mime_type_extensions(): array

Returns the system's mime type mappings, considering the first extension listed to be cacnonical.

Returns

array —

An array of mime type mappings.

test_auto()

test_auto()

test_search_linear()

test_search_linear()

theme_update()

theme_update(boolean  $force_update = false): boolean

Updates the currently selected theme by fetching it from a remote url.

Parameters

boolean $force_update

Whether to force an update - even if we've already updated recently.

Returns

boolean —

Whether the update was sucessful. It might fail because of network issues, or the theme update requires a newer version of Pepperminty Wiki than is currently installed.

time_callable()

time_callable(  $callable)

Parameters

$callable

tree_create()

tree_create()

tree_load()

tree_load()

tree_save()

tree_save(\BkTree  $tree)

Parameters

\BkTree $tree

update_redirect_metadata()

update_redirect_metadata(object  $index_entry,string  $pagedata)

Updates the metadata associated with redirects in the pageindex entry specified utilising the provided page content.

Parameters

object $index_entry

The page index entry object to update.

string $pagedata

The page content to operate on.

update_statistics()

update_statistics(boolean  $update_all = false,boolean  $force = false)

Updates the wiki's statistics.

Parameters

boolean $update_all

Whether all the statistics should be checked and recalculated, or just as many as we have time for according to the settings.

boolean $force

Whether we should recalculate statistics that don't currently require recalculating anyway.

upload_check_svg()

upload_check_svg(string  $temp_filename): array<mixed,integer>

Checks an uploaded SVG file to make sure it's (at least somewhat) safe.

Sends an error to the client if a problem is found.

Parameters

string $temp_filename

The filename of the SVG file to check.

Returns

array<mixed,integer> —

The size of the SVG image.

url_origin()

url_origin(  $s = false,  $use_forwarded_host = false)

Parameters

$s
$use_forwarded_host

url_stem()

url_stem(array  $s = false,boolean  $use_forwarded_host = false): string

Get the stem URL at which this Pepperminty Wiki instance is located You can just append ?get_params_here to this and it will be a valid URL.

Uses full_url() under the hood. Note that this is based on the URL of the current request.

Parameters

array $s

The $_SERVER variable (defaults to $_SERVER)

boolean $use_forwarded_host

Whether to use the x-forwarded-host header or ignore it.

Returns

string —

The stem url, as described above

var_dump_ret()

var_dump_ret(mixed  $var): string

Calls var_dump() and returns the output.

Parameters

mixed $var

The thing to pass to var_dump().

Returns

string —

The output captured from var_dump().

var_dump_short()

var_dump_short(mixed  $var): string

Calls var_dump(), shortening the output for various types.

Parameters

mixed $var

The thing to pass to var_dump().

Returns

string —

A shortened version of the var_dump() output.

verify_password()

verify_password(string  $pass,string  $hash): boolean

Verifies a user's password against a pre-generated hash.

Parameters

string $pass

The user's password.

string $hash

The hash to compare against.

Returns

boolean —

Whether the password matches the has or not.

writegraph()

writegraph()