Global Functions
boolean | isCurrentRequestSSL() Returns true if current request is through SSL, whether it is through a proxy load balancer or not
|
string | ___(string $s) Returns a translated text in current language
|
string | ___S(string $s) Returns a HTML-encoded string, translated in current language
|
int | get_schlix_max_user_session_time() Get maximum login time
|
int | get_schlix_max_user_remember_cookie_time() Get maximum remember me cookie time in seconds
|
string | get_random_token(int $length=16) Generate random token
|
generate_salt($hash_type, $work_factor=9) | |
get_skin_module($skin_name) | |
get_current_skin_module() Get current skin module
| |
string | skin_html(string $html, array $vars, array $allowed_namespaces=['x-ui']) Skin HTML
|
array | get_all_skin_modules() Returns a list of available skin
|
boolean | is_value_true(string $string) Returns true if a variable == true or > 0
|
type | fix_xhtml(type $html) Fix self closing XHTML tags
|
get_file_permissions(type $path) Get readable file permissions
| |
___u(string $path) Return URL encode path
| |
int | ___c(array $object) Return the count of an array without emitting a PHP warning (PHP 7.2 compat)
|
string | encode_path(string $url) Raw URL encode a path
|
string | decode_path(string $url) Raw URL decode a path
|
string | get_remote_file_content(string $url, bool $use_default_user_agent=true, bool $ignore_ssl_ca=false) Get remote file content with CURL
|
start_output_buffer($clean_first=false) Start output buffering
| |
string | end_output_buffer() End output buffering and return string
|
string | ___h(string $s, int $maxlen) String output sanitizing function to ensure there's no XSS in the text. If maxlen is specified then it will be limited to maxlen
|
string | SAFE_HTML(string $s, int $maxlen) Alias of ___h/ Deprecated for an easier to remember function name. Use ___h. String output sanitizing function to ensure there's no XSS in the text. If maxlen is specified then it will be limited to maxlen. To be removed in v2.3.x-x Deprecatedsince version 2.1.6-2
since version 2.1.6-2
|
string | format_nice_date(string $the_date, bool $display_time=false) Converts a datetime or a UNIX date and return it in the format of year-month-day time
|
string | time_since(int $time_since) http://stackoverflow.com/questions/18685/how-to-display-12-minutes-ago-etc-in-a-php-webpage
|
boolean | str_starts_with(string $haystack, string $needle) Returns true if haystack starts with needle
|
boolean | str_ends_with(string $haystack, string $needle) Returns true if haystack ends with needle
|
boolean | str_contains(string $haystack, string $needle) Returns true if haystack contains needle
|
string | str_limit(string $str, int $maxlen) Returns string value of $str and if the length is greater than maxlen then it will be trimmed
|
get_class_ancestors($class) | |
string | get_user_real_ip_address() Returns a user's real IP address. Probes for proxy if the CMS is behind a load balancer.
|
string | get_user_browser_string() Returns the user's browser string limited to 255 chars
|
get_system_or_user_file($filename, $die=true) | |
get_system_or_user_url_path($filename, $die=true) | |
string | get_application_real_name_by_alias(string $alias) Returns the application real name, given the alias as defined in the application configuration page $SystemDB
|
string | prevent_duplicate_filename_in_folder(string $folder, string $original_filename) Returns a new, non-duplicate filename
|
string | force_https_url() Force URL to be HTTPS if the site's SSL variable is enabled and HTTPS URL is defined inthe subsite configuration
|
string | set_csrf_token() Setthe CSRF token if none
|
string | get_csrf_token() Returns the CSRF token
|
bool | is_valid_csrf(array $datavalues=NULL) Check if the variable _csrftoken matches with the currently set token. If the array is not specified, then $_POST will be used
|
check_csrf_halt_on_error($is_ajax=false) | |
type | get_simplified_file_hash(type $filename) Simple file hash
|
type | is_readable_file(type $filename) Check if file is readable and is a file
|
boolean | is_valid_image_file(string $filename, string $check_filename=true) Returns true if image file is valid
|
boolean | is_valid_uploaded_image_file(string $tmp_filename, string $uploaded_filename) Returns true if image is valid (beta)
|
type | record_404_error() Record 404 error $SystemDB
|
display_http_error($error_number) Display HTTP Error (e.g. 404, 400, etc). Internal use only
| |
string | get_js_csrf_var(string $varname='_csrftoken') Returns a Javascript variable that contains csrftoken string e.g. var variable_name = '1231351232asdasd'
|
display_schlix_alert($error) Adds an error string that will be displayed when the page loads again next time
| |
clear_schlix_alert() Clear error string
| |
bool | is_serialized(string $string) Returns true if the input string is serialized
|
string | new_uuid_v4() Generates a new UUIDv4 Source Credit: copied and pasted this from http://php.net/manual/en/function.uniqid.php
|
bool | is_valid_guid(string $guid) Returns true if format is valid GUID
|
get_application_alias($app, $subclass=NULL) | |
redirect_url(string $url) Redirect URL
| |
encode_url(string $path) Return URL encode
| |
array | get_list_of_all_apps(bool $use_cache=false, int $cache_how_many_minutes=5) Returns a list of all applications type $SystemConfig
|
bool | is_captcha_verification_valid() Returns true if Captcha is valid
|
string | convert_pasted_png_images_from_html_text(string $txt, string $upload_path, string $url_path, string $filename_prefix='img') Converts data:image/png;base64 from text to image $SystemLog
|
string | move_static_external_images_from_html_text(string $txt, string $upload_path, string $url_path) Search for all external images hosted outside of this URL in this HTML text to a local one. If the file already exists with the same name then it will be ignored
|
quote_field_name_for_query($item_field) | |
quote_array_of_field_names_for_query($item_fields) | |
string | alpha_numeric_with_underscore(string $str, string $replacement='-') Returns alphanumeric of string with _ (underscore) allowed
|
string | alpha_numeric_with_dash_underscore(string $str, string $replacement='-') Returns alphanumeric of string with - (dash) and _ (underscore) allowed
|
string | sanitize_action_command(string $str) Returns alphanumeric of string with - (dash) and _ (underscore) allowed
|
string | alpha_numeric_only(string $str, string $replacement='') Like alpha_numeric_with_dash_underscore but without - (dash) and (underscore) allowed
|
convert_to_safe_basename($str, $max_len, $default_empty='untitled', $allow_utf8=true) | |
type | mb_pathinfo(type $filepath) Alternative pathinfo
|
string | convert_to_safe_filename($str, $default_empty_ext='') Converts a string to safe filename
|
string | convert_into_sef_friendly_title(string $str, bool $allow_utf8=true) Converts a string to an alphanumeric one (dash and underscores allowed). This is mainly used to convert a title page to virtual filename
|
int | time_difference(string $start_date, string $end_date) Returns the number of seconds between start_date and end_date
|
int | days_difference(string $start_date, string $end_date) Returns the day numbers between start_date and end_date
|
int | days_difference_from_today(string $the_date) Returns the number of day difference from today
|
string | get_current_datetime() Return string of current date in ISO-8601 format
|
type | is_valid_email_address(type $email) Returns true if email address is valid
|
bool | verify_email_dns(string $email) Returns true if email address is DNS verified with the MX record
|
array | select_http_post_variables() Select HTTP POST Variables. Useful to filter variables based on table names
|
array | convert_array_values_to_keys(array $array, mixed $fill=1) Convert array values to keys and fill it with number
|
string | remove_multiple_slashes(string $str) Remove multiple slashes from string.
|
string | sanitize_string(string $value, bool $dont_add_quotes=false) Sanitize string - SQL $SystemDB
|
bool | is_date(object $date, string $format='Y-m-d H:i:s') Returns true if input is in date format
|
bool | is_ajax_request() Returns true if this request is AJAX
|
bool | is_postback() Returns true if it's a postback ... similar to ASP.NET's isPostBack()
|
string | real_strip_tags(string $i_html, array $i_allowedtags=[], bool $i_trimtext=FALSE) Perform a real strip tag. Function copied from php.net
|
bool | create_generic_directory(string $dir, $permission=0755, $recursive=true) Create directory with permission 0755 if not exist
|
string | unix_slash(string $f) Replaces Windows \ with /
|
bool | copy_recursive(string $source, string $dest) Copy recursive from source to destination
|
sort_associative_array_by_key(array $array, string $subkey, int $sortType=SORT_ASC) Sort an associative array by key
| |
string | ajax_reply(int $status, array $data) Returns a JSON-encoded string of reply. Set status to 200 for ok
|
ajax_reply_invalid_method($method_name) | |
ajax_reply_ok_redirect($success_message=null, $url_redirect='') | |
ajax_reply_ok_message($success_message=null) | |
ajax_reply_ok($data=null) | |
ajax_reply_error($data=null) | |
string echo ajax reply and return false (RETURN AS AJAX) | ajax_echo(string $s) AJAX - reply with error
string
$s
string
string
|
string | ajax_datasource_reply(int $status, int $allRecords, int $start, int $end, int $item_per_page, int $total_item_count, string $sort=null, string $dir='asc') Returns a JSON-encoded array of message for datasource in SCHLIX.UI.DataTable
|
boolean | is_animated_gif(string $filename) Returns true if the file is an animated gif
|
boolean | create_image_thumbnail(string $src, string $dest, int $thumb_width=120, int $thumb_height=120, bool $dont_resize_if_smaller=false, int $quality=100) Create an image thumbnail. If dont_resize_if_smaller flag is specified and the source image is smaller than the specified thumbnail width and height then it will just be copied. Quality is a number between 1 - 100
|
boolean | create_htaccess_restrict_view(string $folder) Create .htaccess and web.config to restrict folder viewing
|
create_directory_if_not_exists($main_folder, $log_if_error=false) | |
boolean | create_site_skeleton(string $prefix, string $sitename) Create sub-site folder skeleton. Prefix is usually SCHLIX_SITE_HTTPBASE
|
string | normalize_file_path(string $path) Returns a UNIX-style file path (with forward slash /) and remove multiple slashes.
|
string | remove_prefix_from_file_name(string $filename, string $prefix) This function is an alias of remove_prefix_from_string. This function is used to determine the base path of a URL. e.g. $filename = /var/www/html, $prefix = /var then it would return /www/html
|
string | remove_prefix_from_string(string $str, string $prefix) Remove leading prefix from a string.
|
__force_change_site_httpbase($str_old_httpbase, $str_new_httpbase) This is a function designed to replace the base path. Not intended to be called during page exection. However $SystemDB must be initialized. Please call setupSchlixRuntime() before executing this function
| |
__convert_unit_prefix_to_bytes($val) Converts unit in Giga, mega, or kilo to bytes e.g. 1M, 2G, 30K etc
| |
int | get_real_max_upload_size() Returns max upload size in bytes
|
string | get_calling_class_function() Get the class and function name that called the current method
|
bool | fget_bool(string $varname) Returns $_GET variable as a boolean
|
bool | fpost_bool(string $varname) Returns $_POST variable as a boolean
|
string|int | fget_alphanumeric(string $varname, int $limit) Returns $_GET variable as alphanumeric
|
int | fpost_alphanumeric(string $varname, $limit) Returns $_POST variable as alphanumeric
|
int | fget_int(string $varname) Returns $_GET variable as an integer
|
int | fget_uint(string $varname) Returns $_GET variable as an unsigned integer
|
int | fpost_int(string $varname) Returns $_POST variable as an integer
|
int | fpost_uint(string $varname) Returns $_POST variable as an unsigned integer
|
int | fget_float(string $varname) Returns $_GET variable as a float number
|
int | fpost_float(string $varname) Returns $_POST variable as a float number
|
int | fget_double(string $varname) Returns $_GET variable as adouble
|
int | fpost_double(string $varname) Returns $_POST variable as double
|
string | fget_string(string $varname, int $limit) Returns the value of $_GET[$varname], limited to $limit
|
string | fpost_string(string $varname, int $limit) Returns the value of $_POST[$varname], limited to $limit
|
string | fget_string_notags(string $varname, int $limit) Returns the value of $_GET[$varname], limited to $limit
|
string | fpost_string_notags(string $varname, int $limit) Returns the value of $_POST[$varname], limited to $limit
|
string | fget_string_noquotes_notags(string $varname, int $limit) Returns the value of $_GET[$varname], limited to $limit
|
string | fpost_string_noquotes_notags(string $varname, int $limit) Returns the value of $_POST[$varname], limited to $limit
|
string | fget_filename_only(string $varname) Returns a sanitized filename from $_GET[$varname]
|
string | fpost_filename_only(string $varname) Returns a sanitized filename from $_POST[$varname]
|
string | fget_filename_fullpath(string $varname) Returns a sanitized full path from $_GET[$varname]
|
string | fpost_filename_fullpath(string $varname) Returns a sanitized full path from $_POST[$varname]
|
array | fpost_array_any(string $varname) Returns array from $_POST[$varname]
|
array | fpost_array_int(string $varname) Returns array of int from $_POST[$varname]
|
int | fpost_date_combobox(string $varname) Returns $_POST variable as an integer
|
rate_limit_record(string $action, string $detail_string, int $period=3600) Record a rate limit action $SystemDB
| |
bool | rate_limit_count(string $action, int $period=3600) Returns action count for a certain action $SystemDB
|
bool | rate_limit_exceeded(string $action, int $max_retry, int $period=3600) Returns true if rate limit for a certain action has been exceeded
|
bool | rate_limit_and_halt(string $action, int $max_soft_retry, int $max_hard_retry=50, int $period=3600) Check if rate limit for a certain action has been exceeded. Upon the first hit of soft retry number, captcha should be displayed. When hard retry count has been exceeded, the system will automatically halt it.
Max retry is set at a very generous number = 50
|
array | strip_array_column(array $data, array $fields_to_strip) Strip array column
|
get_sorted_timezone_data() | |
force_download_file($filename, $override_filename='') |