Chuyển đến nội dung
Tài liệu

Tra cứu lớp và hàm

Hàm toàn cục

Danh sách các hàm toàn cục. Tài liệu này được tạo tự động từ mã nguồn lõi Zittme.

Nguồn: common/functions.php (hiện đại), common/legacy.php (tương thích kế thừa)

Hàm toàn cục (common/functions.php)

  • config(string $key, $value = null)
  • Get or set system configuration.
  • lang(?string $code, $value = null)
  • Get or set lang variable.
  • array_first_key(array $array)
  • Get the first key of an array.
  • array_last_key(array $array)
  • Get the last key of an array.
  • array_escape(array $array, bool $double_escape = true)
  • Escape all keys and values in a multi-dimensional array.
  • array_flatten(array $array, bool $preserve_keys = true)
  • Flatten a multi-dimensional array into a one-dimensional array.
  • class_basename($class)
  • Get the base name of a class name (without namespaces).
  • clean_path(string $path)
  • Clean a path to remove ./, ../, trailing slashes, etc.
  • escape($str, bool $double_escape = true, bool $except_lang_code = false)
  • This function is a shortcut to htmlspecialchars().
  • escape_css(string $str)
  • This function escapes a string to be used in a CSS property.
  • escape_js(string $str)
  • This function escapes a string to be used in a JavaScript string literal.
  • escape_sqstr(string $str)
  • This function escapes a string to be used in a 'single-quoted' PHP string literal.
  • escape_dqstr(string $str)
  • This function escapes a string to be used in a "double-quoted" PHP string literal.
  • explode_with_escape(string $delimiter, string $str, int $limit = 0, string $escape_char = '\\')
  • This function splits a string into an array, but allows the delimter to be escaped.
  • starts_with($needle, $haystack, bool $case_sensitive = true)
  • This function returns true if $haystack starts with $needle, and false otherwise.
  • ends_with($needle, $haystack, bool $case_sensitive = true)
  • This function returns true if $haystack ends with $needle, and false otherwise.
  • contains($needle, $haystack, bool $case_sensitive = true)
  • This function returns true if $haystack contains $needle, and false otherwise.
  • is_between($needle, $min, $max, bool $exclusive = false)
  • This function returns true if $needle is between $min and $max, and false otherwise.
  • force_range($input, $min, $max)
  • This function restricts $input to be between $min and $max.
  • base64_encode_urlsafe(string $str)
  • This function encodes a string with base64, using a URL-safe character set.
  • base64_decode_urlsafe(string $str)
  • This function decodes a string with base64, using a URL-safe character set.
  • number_shorten($number, int $significant_digits = 2)
  • This function shortens a number using common suffixes.
  • path2url(string $path)
  • Convert a server-side path to a URL.
  • url2path(string $url)
  • Convert a URL to a server-side path.
  • hex2rgb(string $hex)
  • Convert hexadecimal color codes to an array of R, G, B values.
  • rgb2hex(array $rgb, bool $hash_prefix = true)
  • Convert an array of R, G, B values to hexadecimal color codes.
  • include_in_clean_scope(string $filename)
  • This function includes another file in a clean scope.
  • include_and_ignore_errors(string $filename)
  • This function includes another file while ignoring all errors inside of it.
  • include_and_ignore_output(string $filename)
  • This function includes another file while ignoring all output.
  • tobool($input)
  • Converts any value to either true or false.
  • countobj($array_or_object)
  • Counts members of an array or an object.
  • utf8_check($str)
  • Checks if the given string contains valid UTF-8.
  • utf8_clean($str)
  • Remove BOM and invalid UTF-8 sequences from text content.
  • utf8_mbencode($str)
  • Encode UTF-8 characters outside of the Basic Multilingual Plane in the &#xxxxxx format.
  • utf8_normalize_spaces($str, bool $multiline = false)
  • This function replaces all whitespace characters with a single regular space (0x20).
  • utf8_trim($str)
  • This function trims all space from the beginning and end of a string.
  • is_html_content($str)
  • Check if a string contains HTML content.
  • is_empty_html_content($str)
  • Check if HTML content is empty.

Hàm toàn cục kế thừa (common/legacy.php)

  • getModule($module_name, $type = 'view', $kind = '')
  • Define a function to use {@see ModuleHandler::getModuleObject()} ($module_name, $type)
  • getController($module_name)
  • Create a controller instance of the module
  • getAdminController($module_name)
  • Create a admin controller instance of the module
  • getView($module_name)
  • Create a view instance of the module
  • getAdminView($module_name)
  • Create a admin view instance of the module
  • getModel($module_name)
  • Create a model instance of the module
  • getAdminModel($module_name)
  • Create an admin model instance of the module
  • getAPI($module_name)
  • Create an api instance of the module
  • getMobile($module_name)
  • Create a mobile instance of the module
  • getWAP($module_name)
  • Create a wap instance of the module
  • getClass($module_name)
  • Create a class instance of the module
  • executeQuery($query_id, $args = [], $column_list = [], string $result_type = 'auto', string $result_class = 'stdClass')
  • The alias of DB::executeQuery()
  • executeQueryArray($query_id, $args = [], $column_list = [], string $result_class = 'stdClass')
  • Function to handle the result of DB::executeQuery() as an array
  • getNextSequence()
  • Alias of DB::getNextSequence()
  • setUserSequence($seq)
  • Set Sequence number to session
  • checkUserSequence($seq)
  • Check Sequence number grant
  • getUrl()
  • Get a encoded url. Define a function to use Context::getUrl()
  • getNotEncodedUrl()
  • Get a not encoded(html entity) url
  • getAutoEncodedUrl()
  • Get a encoded url. If url is encoded, not encode. Otherwise html encode the url.
  • getFullUrl()
  • Return the value adding request uri to getUrl() to get the full url
  • getNotEncodedFullUrl()
  • Return the value adding request uri to getUrl() to get the not encoded full url
  • getSiteUrl()
  • getSiteUrl() returns the URL by transforming the given argument value of domain
  • getNotEncodedSiteUrl()
  • getSiteUrl() returns the not encoded URL by transforming the given argument value of domain
  • getFullSiteUrl()
  • Return the value adding request uri to the getSiteUrl() To get the full url
  • getCurrentPageUrl($escape = true)
  • Return the exact url of the current page
  • isSiteID($domain)
  • Return if domain of the virtual site is url type or id type
  • cut_str($string, $cut_size = 0, $tail = '...')
  • Put a given tail after trimming string to the specified size
  • get_time_zone_offset($timezone)
  • Convert XE legacy time zone format into UTC offset.
  • zgap($timestamp = null)
  • Get the offset between the current user's time zone and Zittme's internal time zone.
  • ztime($str)
  • Convert timestamp string to Unix timestamp.
  • zdate($str, $format = 'Y-m-d H:i:s', $conversion = false)
  • Convert timestamp to user-defined format.
  • getInternalDateTime(?int $timestamp = null, string $format = 'YmdHis')
  • Convert a Unix timestamp to YYYYMMDDHHIISS format, using the internal time zone.
  • getDisplayDateTime(?int $timestamp = null, string $format = 'YmdHis')
  • Convert a Unix timestamp to YYYYMMDDHHIISS format, using the internal time zone.
  • getTimeGap($date, $format = 'Y.m.d')
  • If the recent post within a day, output format of YmdHis is "min/hours ago from now". If not within a day, it return format string.
  • getMonthName(int $month, bool $short = true)
  • Name of the month return
  • getEncodeEmailAddress($email)
  • Returns encoded value of given email address for email scraping
  • debugPrint($value, ...$values)
  • Add an entry to the debug log.
  • delObjectVars($target_obj, $del_obj)
  • Delete the second object vars from the first argument
  • getDestroyXeVars($vars)
  • Delete variables that are commonly submitted but don't need to be saved.
  • getNumberingPath($no, int $size = 3)
  • Trim a given number to a fiven size recursively
  • removeHackTag($content)
  • Sanitize HTML content.
  • detectUTF8($string, $return_convert = FALSE, $urldecode = TRUE)
  • Get whether utf8 or not given string
  • isCrawler($user_agent = null)
  • Get is current user crawler
  • stripEmbedTagForAdmin(&$content, $writer_member_srl)
  • Remove embed media for admin
  • checkCSRF()
  • Check for CSRF attacks
  • recurciveExposureCheck(&$menu)
  • menu exposure check by isShow column
  • htmlHeader()
  • Print raw html header
  • htmlFooter()
  • Print raw html footer
  • alertScript($msg = null)
  • Print raw alert message script
  • closePopupScript()
  • Print raw close window script
  • reload($isOpener = FALSE)
  • Print raw reload script
  • handleError($errno, $errstr, $file, $line, $context)
  • Legacy error handler
  • getMicroTime()
  • Alias to microtime(true)
  • getScriptPath()
  • Return the requested script path
  • getRequestUriByServerEnviroment()
  • Return the requested script path
  • json_encode2($data)
  • get json encoded string of data
  • url_decode($str)
  • Decode the URL in Korean
  • blockWidgetCode($content)
  • Block widget code (Deprecated)
  • purifierHtml(&$content)
  • HTMLPurifier wrapper (Deprecated)
  • checkXmpTag($content)
  • Check xmp tag (Deprecated)
  • removeSrcHack(array $match)
  • Remove src hack (Deprecated)
  • checkUploadedFile($file, $filename = null)
  • Check uploaded file (Deprecated)
  • mysql_pre4_hash_password($password)
  • Php function for mysql old_password()
  • changeValueInUrl($key, $requestKey, $dbKey, $urlName = 'success_return_url')
  • Change values inside a user-submitted URL, most commonly success_return_url.
  • utf8RawUrlDecode($source)
  • PHP unescape function of javascript's escape
  • _code2utf($num)
  • Returns utf-8 string of given code
  • writeSlowlog()
  • flushSlowlog()
  • requirePear()