@return: {ARRAY} array [ status => 'OK' | 'WARN' | 'ERR', 'message' => '' | 'WARN Message' | 'ERR Message', 'msg-code' => 0..n, 'filename' => '' | 'filename.ext', 'filetype' => '' | 'ext', 'filesize' => Bytes, 'filecontent' => '' | 'the Contents of the file ...' ]
@param: {STRING} $var_name: The HTML Variable Name
@param: {INTEGER} $var_index: The HTML Variable Index: -1 for single file uploads ; 0..n for multi-file uploads ; DEFAULT is -1
@param: {INTEGER} $max_size: The max file size in bytes that would be accepted ; set to zero for allow maximum size supported by PHP via INI settings ; DEFAULT is zero
@param: {STRING} $allowed_extensions: The list of allowed file extensions ; Default is '' ; Example to restrict to several extensions: '<ext1>,<ext2>,...<ext100>,...' ; set to empty string to allow all extenstions supported via Smart.Framework INI: SMART_FRAMEWORK_ALLOW_UPLOAD_EXTENSIONS / SMART_FRAMEWORK_DENY_UPLOAD_EXTENSIONS
@return: {MIXED} '' (empty string) if all OK ; FALSE (boolean) if upload failed ; otherwise will return a non-empty string with the ERROR / WARNING message if the file was not successfuly stored in the destination directory
@param: {STRING} $dest_dir: The destination directory ; Example: 'wpub/my-test/'
@param: {STRING} $var_name: The HTML Variable Name
@param: {INTEGER} $var_index: The HTML Variable Index: -1 for single file uploads ; 0..n for multi-file uploads
@param: {BOOLEAN} $allow_rewrite: Allow rewrite if already exists that file in the destination directory ; default is TRUE
@param: {INTEGER} $max_size: The max file size in bytes that would be accepted ; set to zero for allow maximum size supported by PHP via INI settings
@param: {STRING} $allowed_extensions: The list of allowed file extensions ; Default is '' ; Example to restrict to several extensions: '<ext1>,<ext2>,...<ext100>,...' ; set to empty string to allow all extenstions supported via Smart.Framework INI: SMART_FRAMEWORK_ALLOW_UPLOAD_EXTENSIONS / SMART_FRAMEWORK_DENY_UPLOAD_EXTENSIONS
@param: {STRING} $new_name: Use a new file name for the uploaded file instead of the original one ; Set to empty string to preserve the uploaded file name ; DEFAULT is ''
@param: {BOOLEAN} $enforce_lowercase: Set to TRUE to enforce lowercase file name ; DEFAULT is FALSE
Store one Uploaded File to a destination directory
public staticfunctionclient_ident_private_key (
) {} ::
public staticfunctionunique_client_private_key (
) {} ::
public staticfunctionunique_auth_client_private_key (
) {} ::
public staticfunctionget_selfrobot_useragent_name (
) {} ::
public staticfunctionget_visitor_useragent (
) {} ::
public staticfunctionget_visitor_signature (
) {} ::
public staticfunctionget_visitor_tracking_uid (
) {} ::
public staticfunctionget_encoding_charset (
) {} ::
public staticfunctionget_server_current_request_with (
) {} ::
public staticfunctionis_ajax_request (
) {} :: BOOL
public staticfunctionget_server_current_request_method (
) {} ::
public staticfunctionget_server_current_protocol (
) {} ::
public staticfunctionget_server_current_port (
) {} ::
public staticfunctionget_server_current_ip (
) {} ::
public staticfunctionget_server_current_domain_name (
) {} ::
public staticfunctionget_server_current_basedomain_name (
) {} ::
public staticfunctionget_server_current_subdomain_name (
) {} ::
public staticfunctionget_server_current_request_path (
) {} ::
public staticfunctionget_server_current_request_uri (
) {} ::
public staticfunctionget_server_current_full_script (
) {} ::
public staticfunctionget_server_current_script (
) {} ::
public staticfunctionget_server_current_queryurl (
bool$use_blank_if_empty = false
) {} ::
public staticfunctionget_server_current_path (
) {} ::
public staticfunctionget_server_current_url (
bool$skip_port_if_default = true
) {} :: STRING
public staticfunctionget_webserver_version (
) {} ::
public staticfunctionget_server_os (
) {} ::
public staticfunctionis_ip_client_trusted (
) {} :: BOOLEAN
@return: {BOOLEAN} TRUE if trusted ; FALSE if not
Check if the Client real IP is trusted
If something fails in the detection of the Client real IP address this will return FALSE
public staticfunctionget_ip_client (
) {} :: STRING
@return: {STRING} IP Address ; if no address detected will RAISE a FATAL ERROR ...
Get the Client real IP ; by default will use $_SERVER['REMOTE_ADDR'] ; but if set in configs can use by example $_SERVER['HTTP_X_FORWARDED_FOR'] or other values (ex: in the case of a reverse proxy)
This function should be used always across the Smart.Framework to get the client's real IP instead using directly the $_SERVER['REMOTE_ADDR'] as the real client IP may change when using apache/php behind haproxy or varnish and in this case by example the $_SERVER['HTTP_X_FORWARDED_FOR'] may return client's real IP address and the $_SERVER['REMOTE_ADDR'] will be in this case the IP of the proxy ...
This can be override if proxy mode enabled, by setting SMART_FRAMEWORK_SRVPROXY_CLIENT_IP
public staticfunctionget_ip_proxyclient (
) {} :: STRING
@return: {STRING} IP Address or a space (if no proxy address detected)
Get the Client Proxy IP if any such as: HTTP_CLIENT_IP or HTTP_X_FORWARDED_FOR
This function should be used always across the Smart.Framework to get the client's proxy IP and never must use directly HTTP_CLIENT_IP or HTTP_X_FORWARDED_FOR or other headers directly as they may change when using apache/php behind haproxy or varnish !
public staticfunctionget_os_browser_ip (
string$y_mode = ""
) {} ::