Overview

Packages

  • akismet
  • None
  • PHP
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • plugins
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Signatures
    • Signed
    • Transport
  • wa-apps
    • blog
      • actions
        • backend
        • blog
        • comment
        • cron
        • design
        • frontend
        • page
        • plugin
        • post
      • api
        • v1
      • cli
      • layout
      • model
      • plugin
        • aksimet
        • category
        • emailsubscription
        • favorite
        • gravatar
        • import
        • markdown
        • myposts
        • tag
        • troll
      • settings
    • checklists
      • backend
      • json
    • contacts
      • backend
    • developer
    • dummy
    • guestbook
    • guestbook2
    • photos
      • album
      • api
        • v1
      • backend
      • design
      • dialog
      • frontend
      • page
      • photo
      • plugin
        • comment
        • imageeffects
        • import
        • publicgallery
        • watermark
      • search
      • settings
      • stack
      • tag
      • upload
    • site
      • backend
      • blocks
      • config
      • design
      • domains
      • files
      • frontend
      • helper
      • layout
      • pages
      • routing
      • setting
    • stickies
      • api
        • v1
      • sheet
      • stiky
  • wa-plugin
    • payment
    • shipping
    • sms
  • wa-plugins
    • shipping
      • usps
  • wa-system
    • API
    • Auth
      • Adapters
    • Autoload
    • Cache
      • Adapter
    • Captcha
    • Config
    • Contact
    • controller
    • currency
    • database
    • datetime
    • design
    • event
    • exception
    • files
    • image
    • layout
    • locale
    • log
    • mail
    • page
      • action
      • model
    • payment
    • plugin
    • request
    • response
    • routing
    • shipping
    • sms
    • storage
    • user
    • util
    • validator
    • view
    • webasyst
      • api
      • backend
      • cli
      • config
      • layout
      • login
      • model
      • password
      • payment
      • profile
      • settings
      • shipment
    • widget
    • workflow
  • waPlugins
    • Payment
  • webasyst
    • wa-system
      • helper

Classes

  • waRequest
  • waRequestFile
  • waRequestFileIterator
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class waRequest

This file is part of Webasyst framework.

Licensed under the terms of the GNU Lesser General Public License (LGPL). http://www.webasyst.com/framework/license/

Package: wa-system\request
Copyright: 2011 Webasyst LLC
Author: Webasyst LLC
Link: http://www.webasyst.com/
Located at wa-system/request/waRequest.class.php
Methods summary
public
# __construct( )
protected static
# cast( mixed $val, mixed $type = null )
public static mixed
# post( string|null $name = null, mixed $default = null, string $type = null )

Returns POST request contents.

Returns POST request contents.

Parameters

$name
string|null
$name POST request field name. If empty, entire contents of POST request are returned.
$default
mixed
$default The default value, which is returned if no value is found for the request field specified in $name parameter.
$type
string
$type Data type to which the value of specified parameter must be converted. Acceptable data types are described for method get().

Returns

mixed

See

waRequest::get()
public static boolean
# issetPost( string $name )

Verifies availablility of specified field in POST request.

Verifies availablility of specified field in POST request.

Parameters

$name
string
$name POST request field

Returns

boolean
public static mixed
# get( string|null $name = null, string|null $default = null, string|null $type = null )

Returns the contents of the GET request.

Returns the contents of the GET request.

Parameters

$name
string|null
$name GET request field name. If empty, entire contents of the GET request are returned.
$default
string|null
$default The default value, which is returned if no value is found for the request field specified in $name parameter.
$type
string|null
$type Data type to which the cookie record value must be converted, specified by means of one of TYPE_* constants: waRequest::TYPE_INT - integer waRequest::TYPE_STRING - string waRequest::TYPE_STRING_TRIM string with trimmed space characters waRequest::TYPE_ARRAY_INT = array of integers waRequest::TYPE_ARRAY = array of various data

Returns

mixed

Example

waRequest::get('id', 0, waRequest::TYPE_INT)
public static mixed
# request( string|null $name = null, mixed $default = null, string $type = null )

Returns combined contents of GET and POST requests or the value of specified request field.

Returns combined contents of GET and POST requests or the value of specified request field.

Parameters

$name
string|null
$name Request field name. If empty, entire contents of POST and GET request are returned.
$default
mixed
$default The default value, which is returned if no value is found for the request field specified in $name parameter.
$type
string
$type Data type to which the value of specified parameter must be converted. Acceptable data types are described for method get().

Returns

mixed

See

waRequest::get()
public static waRequestFileIterator
# file( mixed $name )

Returns iterator for file

Returns iterator for file

Returns

waRequestFileIterator
public static mixed
# cookie( string|null $name = null, string|null $default = null, string|null $type = null )

Returns information about user's cookie files.

Returns information about user's cookie files.

Parameters

$name
string|null
$name Cookie record id. If not specified, all cookie data received from user is returned.
$default
string|null
$default The default value, which is returned if no value is found for the cookie record specified in $name parameter.
$type
string|null
$type Data type to which the request field value must be converted. Acceptable data types are described for get() method.

Returns

mixed

See

waRequest::get()
public static boolean
# isXMLHttpRequest( )

Verifies whether current request is an AJAX request.

Verifies whether current request is an AJAX request.

Returns

boolean
public static string
# getUserAgent( )

Returns the contents of server header HTTP_USER_AGENT.

Returns the contents of server header HTTP_USER_AGENT.

Returns

string
public static string|boolean
# isMobile( boolean $check = true )

Determines the use of a mobile device.

Determines the use of a mobile device.

Parameters

$check
boolean
$check Flag requiring to check and update the value of field nomobile in user's PHP session. If set to true, the following actions are performed: - If the GET request contains variable named 'nomobile' with a value equivalent to true, then field 'nomobile' in user's PHP session is set to true. If the value of this variable is equivalent to false, then field 'nomobile' is removed from user's session. - If the GET request contains no variable named 'nomobile' and does contain a variable named 'mobile' with a value equivalent to true, then field 'nomobile' is removed from user's session. - If, upon execution of the above actions, the value of field 'nomobile' in user's PHP session is equal to true, then method returns false. Otherwise the method continues its operation so as if the value of this flag were equal to false. If the flag's value is set to false, the use of a mobile device is determined by the contents of HTTP_USER_AGENT header.

Returns

string|boolean
If mobile device is detected, one of these identifiers is returned: 'android', 'blackberry', 'iphone', 'opera', 'palm', 'windows', 'generic'; otherwise method return false.
public static mixed
# server( string|null $name = null, mixed $default = null, string $type = null )

Returns the contents of a server variable (from $_SERVER).

Returns the contents of a server variable (from $_SERVER).

Parameters

$name
string|null
$name Server variable name. If empty, all server variables' values are returned.
$default
mixed
$default The default value, which is returned if no value is found for variable specified in $name parameter.
$type
string
$type Data type to which the value of specified variable must be converted. Acceptable data types are described for method get().

Returns

mixed

See

waRequest::get()
public static
# method( )

Alias for waRequest::getMethod()

Alias for waRequest::getMethod()

See

waRequest::getMethod()
public static string
# getMethod( )

Returns the type of user request.

Returns the type of user request.

Returns

string
'post' or 'get'
protected static
# getData( mixed $data, mixed $name = null, mixed $default = null, mixed $type = null )
protected static
# getDefault( mixed & $default )
public static mixed
# param( string|null $name = null, mixed $default = null, string $type = null )

Returns additional request parameters.

Returns additional request parameters.

Parameters

$name
string|null
$name Request parameter name. If not specified, method returns values of all available parameters.
$default
mixed
$default Default value, which is returned if no value is set for the specified parameter.
$type
string
$type Data type to which the value of specified parameter must be converted. Acceptable data types are described for method get().

Returns

mixed

See

waRequest::get()
public static
# setParam( string $key, mixed $value = null )

Sets custom values for additional request parameters.

Sets custom values for additional request parameters.

Parameters

$key
string
$key Parameter name.
$value
mixed
$value Parameter value. If not specified, default value null is set.
public static
# getIp( string|integer $get_as_int = false )

Returns user's IP address.

Returns user's IP address.

Parameters

$get_as_int
string|integer
$get_as_int IP address either as string or as integer
public static string
# getLocale( string|boolean $default = null, boolean $browser_only = false )

Determines user's locale.

Determines user's locale.

Parameters

$default
string|boolean
$default Default value, which is returned if user's locale cannot be determined. If true is specified, then the same value is used for $browser_only parameter.
$browser_only
boolean
$browser_only Flag requiring to determine user's locale using browser headers only and to ignore additional request parameters set using setParam() method.

Returns

string
public static string
# getTheme( )

Returns id of design theme used in current frontend page.

Returns id of design theme used in current frontend page.

Returns

string
public static
# isHttps( )
Constants summary
string TYPE_INT 'int'
#
string TYPE_STRING 'string'
#
string TYPE_STRING_TRIM 'string_trim'
#
string TYPE_ARRAY_INT 'array_int'
#
string TYPE_ARRAY 'array'
#
Properties summary
protected static array $params array()
#
My fork of Webasyst Framework API documentation generated by ApiGen 2.8.0