Global Functions

setupSchlixRuntime()
Initializes SCHLIX runtime
booleanisCurrentRequestSSL()
Returns true if current request is through SSL, whether it is through a proxy load balancer or not
string___(string $str)
TODO: translation (v2.4.x) translation
upgrade_schlix(string $from_version, string $db_host, string $db_database, string $db_username, string $db_password)
Upgrade end v2.0.3
set_db_to_current_version(\SCHLIX\cmsDatabase $mydb)
Update version
start_output_buffer($clean_first=false)
Start output buffering
stringend_output_buffer()
End output buffering and return string
stringSAFE_HTML(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
stringformat_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
stringtime_since($time_since)
http://stackoverflow.com/questions/18685/how-to-display-12-minutes-ago-etc-in-a-php-webpage
booleanstr_starts_with(string $haystack, string $needle)
Returns true if haystack starts with needle
booleanstr_contains(string $haystack, string $needle)
Returns true if haystack contains needle
stringstr_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)
stringget_user_real_ip_address()
Returns a user's real IP address. Probes for proxy if the CMS is behind a load balancer.
get_system_or_user_file($filename, $die=true)
get_system_or_user_url_path($filename, $die=true)
stringget_application_real_name_by_alias(string $alias)
Returns the application real name, given the alias as defined in the application configuration page $SystemDB
stringprevent_duplicate_filename_in_folder(string $folder, string $original_filename)
Returns a new, non-duplicate filename
stringforce_https_url()
Force URL to be HTTPS if the site's SSL variable is enabled and HTTPS URL is defined inthe subsite configuration
stringset_csrf_token()
Setthe CSRF token if none
stringget_csrf_token()
Returns the CSRF token
boolis_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)
typerecord_404_error_and_redirect()
Record 404 error and redirect $SystemDB
display_http_error($error_number)
Display HTTP Error (e.g. 404, 400, etc). Internal use only
stringget_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
boolis_serialized(string $string)
Returns true if the input string is serialized
stringnew_uuid_v4()
Generates a new UUIDv4 Source Credit: copied and pasted this from http://php.net/manual/en/function.uniqid.php
get_application_alias($app)
redirect_url(string $url)
Redirect URL
encode_url(string $path)
Return URL encode
arrayget_list_of_all_apps(bool $use_cache=false, int $cache_how_many_minutes=5)
Returns a list of all applications type $SystemConfig
boolis_captcha_verification_valid()
Returns true if Captcha is valid
stringconvert_pasted_png_images_from_html_text(string $txt, string $upload_path, string $url_path, string $filename_prefix='')
Converts data:image/png;base64 from text to image $SystemLog
stringmove_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)
stringalpha_numeric_with_dash_underscore(string $str, string $replacement='-')
Returns alphanumeric of string with - (dash) and _ (underscore) allowed
stringalpha_numeric_only(string $str, string $replacement='')
Like alpha_numeric_with_dash_underscore but without - (dash) and (underscore) allowed
stringconvert_to_safe_filename(string $s)
Converts a string to safe filename
stringconvert_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
intdays_difference(string $start_date, string $end_date)
Returns the day numbersbetween start_date and end_date
intdays_difference_from_today(string $the_date)
Returns the number of day difference from today
stringget_current_datetime()
Return string of current date in ISO-8601 format
boolverify_email_dns(string $email)
Returns true if email address is DNS verified with the MX record
arrayselect_http_post_variables()
Select HTTP POST Variables. Useful to filter variables based on table names
arrayconvert_array_values_to_keys(array $array, mixed $fill=1)
Convert array values to keys and fill it with number
stringremove_multiple_slashes(string $str)
Remove multiple slashes from string.
stringsanitize_string(string $value, bool $dont_add_quotes=false)
Sanitize string - SQL $SystemDB
boolis_date(object $date, string $format='Y-m-d H:i:s')
Returns true if input is in date format
boolis_ajax_request()
Returns true if this request is AJAX
boolis_postback()
Returns true if it's a postback ... similar to ASP.NET's isPostBack()
stringreal_strip_tags(string $i_html, array $i_allowedtags=array(), bool $i_trimtext=FALSE)
Perform a real strip tag. Function copied from php.net
boolcopy_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
stringajax_reply(int $status, array $data)
Returns a JSON-encoded string of reply. Set status to 200 for ok
stringajax_echo(string $s)
echo ajax reply and return false (RETURN AS AJAX)
stringajax_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
booleanis_animated_gif(string $filename)
Returns true if the file is an animated gif
booleancreate_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
booleancreate_htaccess_restrict_view(string $folder)
Create .htaccess and web.config to restrict folder viewing
booleancreate_site_skeleton($prefix, string $sitename)
Create website skeleton
stringnormalize_file_path(string $path)
Returns a UNIX-style file path (with forward slash /) and remove multiple slashes.
remove_prefix_from_file_name($filename, $prefix)
booleancreate_image_thumbnail_with_watermark(string $fileSrc, string $thumbDest, string $watermarkSrc, int $thumb_width=120, int $thumb_height=120)
Create an image with watermark (usually PNG watermark)
__convert_unit_prefix_to_bytes($val)
Converts unit in Giga, mega, or kilo to bytes e.g. 1M, 2G, 30K etc
intget_real_max_upload_size()
Returns max upload size in bytes
stringget_calling_class_function()
Get the class and function name that called the current method
boolfget_bool(string $varname)
Returns $_GET variable as a boolean
boolfpost_bool(string $varname)
Returns $_POST variable as a boolean
string|intfget_alphanumeric(string $varname, int $limit)
Returns $_GET variable as alphanumeric
intfpost_alphanumeric(string $varname, $limit)
Returns $_POST variable as alphanumeric
intfget_int(string $varname)
Returns $_GET variable as an integer
intfpost_int(string $varname)
Returns $_POST variable as an integer
intfget_float(string $varname)
Returns $_GET variable as a float number
intfpost_float(string $varname)
Returns $_POST variable as a float number
intfget_double(string $varname)
Returns $_GET variable as adouble
intfpost_double(string $varname)
Returns $_POST variable as double
stringfget_string(string $varname, int $limit)
Returns the value of $_GET[$varname], limited to $limit
stringfpost_string(string $varname, int $limit)
Returns the value of $_POST[$varname], limited to $limit
stringfget_string_notags(string $varname, int $limit)
Returns the value of $_GET[$varname], limited to $limit
stringfpost_string_notags(string $varname, int $limit)
Returns the value of $_POST[$varname], limited to $limit
stringfget_string_noquotes_notags(string $varname, int $limit)
Returns the value of $_GET[$varname], limited to $limit
stringfpost_string_noquotes_notags(string $varname, int $limit)
Returns the value of $_POST[$varname], limited to $limit
stringfget_filename_only(string $varname)
Returns a sanitized filename from $_GET[$varname]
stringfpost_filename_only(string $varname)
Returns a sanitized filename from $_POST[$varname]
stringfget_filename_fullpath(string $varname)
Returns a sanitized full path from $_GET[$varname]
stringfpost_filename_fullpath(string $varname)
Returns a sanitized full path from $_POST[$varname]
arrayfpost_array_any(string $varname)
Returns array from $_POST[$varname]
arrayfpost_array_int(string $varname)
Returns array of int from $_POST[$varname]