XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
Context Class Reference

Public Member Functions

getInstance ()
 
 __construct ()
 
 init ()
 
 close ()
 
 loadDBInfo ()
 
 getDBType ()
 
 setDBInfo ($db_info)
 
 getDBInfo ()
 
 getSslStatus ()
 
 getDefaultUrl ()
 
 loadLangSupported ()
 
 loadLangSelected ()
 
 checkSSO ()
 
 isFTPRegisted ()
 
 getFTPInfo ()
 
 addBrowserTitle ($site_title)
 
 setBrowserTitle ($site_title)
 
 getBrowserTitle ()
 
 getSiteTitle ()
 
 _getBrowserTitle ()
 
 loadLang ($path)
 
 _evalxmlLang ($path)
 
 _loadXmlLang ($path)
 
 _loadPhpLang ($path)
 
 setLangType ($lang_type= 'ko')
 
 getLangType ()
 
 getLang ($code)
 
 setLang ($code, $val)
 
 convertEncoding ($source_obj)
 
 checkConvertFlag (&$val, $key=null, $charset=null)
 
 doConvertEncoding (&$val, $key=null, $charset)
 
 convertEncodingStr ($str)
 
 decodeIdna ($domain)
 
 setResponseMethod ($method= 'HTML')
 
 getResponseMethod ()
 
 setRequestMethod ($type= '')
 
 _checkGlobalVars ()
 
 _setRequestArgument ()
 
 _recursiveCheckVar ($val)
 
 _setJSONRequestArgument ()
 
 _setXmlRpcArgument ()
 
 _filterXmlVars ($key, $val)
 
 _filterRequestVar ($key, $val, $do_stripslashes=true, $remove_hack=false)
 
 isUploaded ()
 
 _setUploadedArgument ()
 
 getRequestMethod ()
 
 getRequestUrl ()
 
 getJSCallbackFunc ()
 
 getUrl ($num_args=0, $args_list=array(), $domain=null, $encode=TRUE, $autoEncode=FALSE)
 
 getRequestUri ($ssl_mode=FOLLOW_REQUEST_SSL, $domain=null)
 
 set ($key, $val, $set_to_get_vars=0)
 
 get ($key)
 
 gets ()
 
 getAll ()
 
 getRequestVars ()
 
 addSSLAction ($action)
 
 addSSLActions ($action_array)
 
 subtractSSLAction ($action)
 
 getSSLActions ()
 
 isExistsSSLAction ($action)
 
 normalizeFilePath ($file)
 
 getAbsFileUrl ($file)
 
 loadFile ($args)
 
 unloadFile ($file, $targetIe= '', $media= 'all')
 
 unloadAllFiles ($type= 'all')
 
 addJsFile ($file, $optimized=FALSE, $targetie= '', $index=0, $type= 'head', $isRuleset=FALSE, $autoPath=null)
 
 unloadJsFile ($file, $optimized=FALSE, $targetie= '')
 
 unloadAllJsFiles ()
 
 addJsFilter ($path, $filename)
 
 _getUniqueFileList ($files)
 
 getJsFile ($type= 'head')
 
 addCSSFile ($file, $optimized=FALSE, $media= 'all', $targetie= '', $index=0)
 
 unloadCSSFile ($file, $optimized=FALSE, $media= 'all', $targetie= '')
 
 unloadAllCSSFiles ()
 
 getCSSFile ()
 
 getJavascriptPluginInfo ($pluginName)
 
 loadJavascriptPlugin ($plugin_name)
 
 addHtmlHeader ($header)
 
 clearHtmlHeader ()
 
 getHtmlHeader ()
 
 addBodyClass ($class_name)
 
 getBodyClass ()
 
 addBodyHeader ($header)
 
 getBodyHeader ()
 
 addHtmlFooter ($footer)
 
 getHtmlFooter ()
 
 getConfigFile ()
 
 getFTPConfigFile ()
 
 isInstalled ()
 
 transContent ($content)
 
 isAllowRewrite ()
 
 pathToUrl ($path)
 
 getMetaTag ()
 
 addMetaTag ($name, $content, $is_http_equiv=FALSE)
 

Public Attributes

 $allow_rewrite = FALSE
 
 $request_method = 'GET'
 
 $js_callback_func = ''
 
 $response_method = ''
 
 $context = NULL
 
 $db_info = NULL
 
 $ftp_info = NULL
 
 $sslActionCacheFile = './files/cache/sslCacheFile.php'
 
 $ssl_actions = array()
 
 $oFrontEndFileHandler
 
 $html_header = NULL
 
 $body_class = array()
 
 $body_header = NULL
 
 $html_footer = NULL
 
 $path = ''
 
 $lang_type = ''
 
 $lang = NULL
 
 $loaded_lang_files = array()
 
 $site_title = ''
 
 $get_vars = NULL
 
 $is_uploaded = FALSE
 
 $patterns
 
 $isSuccessInit = TRUE
 

Detailed Description

Manages Context such as request arguments/environment variables It has dual method structure, easy-to use methods which can be called as self::methodname(),and methods called with static object.

Author
NAVER (devel.nosp@m.oper.nosp@m.s@xpr.nosp@m.esse.nosp@m.ngine.nosp@m..com)

Definition at line 14 of file Context.class.php.

Constructor & Destructor Documentation

Context::__construct ( )

Cunstructor

Returns
void

Definition at line 178 of file Context.class.php.

Member Function Documentation

Context::_checkGlobalVars ( )

handle global arguments

Returns
void

Definition at line 1202 of file Context.class.php.

Context::_evalxmlLang (   $path)

Evaluation of xml language file

Parameters
stringPath of the language file
Returns
void

Definition at line 903 of file Context.class.php.

Context::_filterRequestVar (   $key,
  $val,
  $do_stripslashes = true,
  $remove_hack = false 
)

Filter request variable

See Also
Cast variables, such as _srl, page, and cpage, into interger
Parameters
string$keyVariable key
string$valVariable value
string$do_stripslashesWhether to strip slashes
Returns
mixed filtered value. Type are string or array

Definition at line 1401 of file Context.class.php.

Context::_filterXmlVars (   $key,
  $val 
)

Filter xml variables

Parameters
string$keyVariable key
object$valVariable value
Returns
mixed filtered value

Definition at line 1348 of file Context.class.php.

Context::_getBrowserTitle ( )

Get browser title

Deprecated:

Definition at line 847 of file Context.class.php.

Context::_getUniqueFileList (   $files)

Same as array_unique but works only for file subscript

Deprecated:
Parameters
array$filesFile list
Returns
array File list

Definition at line 2304 of file Context.class.php.

Context::_loadPhpLang (   $path)

Load language file of php type

Parameters
string$pathPath of the language file
Returns
string file name

Definition at line 951 of file Context.class.php.

Context::_loadXmlLang (   $path)

Load language file of xml type

Parameters
string$pathPath of the language file
Returns
string file name

Definition at line 937 of file Context.class.php.

Context::_recursiveCheckVar (   $val)

Definition at line 1261 of file Context.class.php.

Context::_setJSONRequestArgument ( )

Handle request arguments for JSON

Returns
void

Definition at line 1288 of file Context.class.php.

Context::_setRequestArgument ( )

handle request arguments for GET/POST

Returns
void

Definition at line 1218 of file Context.class.php.

Context::_setUploadedArgument ( )

Handle uploaded file

Returns
void

Definition at line 1486 of file Context.class.php.

Context::_setXmlRpcArgument ( )

Handle request arguments for XML RPC

Returns
void

Definition at line 1310 of file Context.class.php.

Context::addBodyClass (   $class_name)

Add css class to Html Body

Parameters
string$class_nameclass name

Definition at line 2535 of file Context.class.php.

Context::addBodyHeader (   $header)

Add html code after <body>

Parameters
string$headerAdd html code after <body>

Definition at line 2559 of file Context.class.php.

Context::addBrowserTitle (   $site_title)

Add string to browser title

Parameters
string$site_titleBrowser title to be added
Returns
void

Definition at line 778 of file Context.class.php.

Context::addCSSFile (   $file,
  $optimized = FALSE,
  $media = 'all',
  $targetie = '',
  $index = 0 
)

Add CSS file

Deprecated:
Parameters
string$fileFile name with path
string$optimizedoptimized (That seems to not use)
string$mediaMedia query
string$targetietarget IE
string$indexindex
Returns
void

Definition at line 2345 of file Context.class.php.

Context::addHtmlFooter (   $footer)

Add html code before </body>

Parameters
string$footerAdd html code before </body>

Definition at line 2581 of file Context.class.php.

Context::addHtmlHeader (   $header)

Add html code before </head>

Parameters
string$headeradd html code before </head>.
Returns
void

Definition at line 2507 of file Context.class.php.

Context::addJsFile (   $file,
  $optimized = FALSE,
  $targetie = '',
  $index = 0,
  $type = 'head',
  $isRuleset = FALSE,
  $autoPath = null 
)

Add the js file

Deprecated:
Parameters
string$fileFile name with path
string$optimizedoptimized (That seems to not use)
string$targetietarget IE
string$indexindex
string$typeAdded position. (head:<head>..</head>, body:<body>..</body>)
bool$isRulesetUse ruleset
string$autoPathIf path not readed, set the path automatically.
Returns
void

Definition at line 2237 of file Context.class.php.

Context::addJsFilter (   $path,
  $filename 
)

Add javascript filter

Parameters
string$pathFile path
string$filenameFile name
Returns
void

Definition at line 2291 of file Context.class.php.

Context::addMetaTag (   $name,
  $content,
  $is_http_equiv = FALSE 
)

Add the meta tag

Parameters
string$namename of meta tag
string$contentcontent of meta tag
mixed$is_http_equivvalue of http_equiv
Returns
void

Definition at line 2738 of file Context.class.php.

Context::addSSLAction (   $action)

Register if an action is to be encrypted by SSL. Those actions are sent to https in common/js/xml_handler.js

Parameters
string$actionact name
Returns
void

Definition at line 2039 of file Context.class.php.

Context::addSSLActions (   $action_array)

Register if actions are to be encrypted by SSL. Those actions are sent to https in common/js/xml_handler.js

Parameters
string$actionact name
Returns
void

Definition at line 2063 of file Context.class.php.

Context::checkConvertFlag ( $val,
  $key = null,
  $charset = null 
)

Check flag

Parameters
mixed$val
string$key
mixed$charsetcharset
See Also
arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5
Returns
void

Definition at line 1081 of file Context.class.php.

Context::checkSSO ( )

Single Sign On (SSO)

Returns
bool True : Module handling is necessary in the control path of current request , False : Otherwise

Definition at line 653 of file Context.class.php.

Context::clearHtmlHeader ( )

Definition at line 2513 of file Context.class.php.

Context::close ( )

Finalize using resources, such as DB connection

Returns
void

Definition at line 437 of file Context.class.php.

Context::convertEncoding (   $source_obj)

Convert strings of variables in $source_object into UTF-8

Parameters
object$source_objConatins strings to convert
Returns
object converted object

Definition at line 1043 of file Context.class.php.

Context::convertEncodingStr (   $str)

Convert strings into UTF-8

Parameters
string$strString to convert
Returns
string converted string

Definition at line 1123 of file Context.class.php.

Context::decodeIdna (   $domain)

Definition at line 1132 of file Context.class.php.

Context::doConvertEncoding ( $val,
  $key = null,
  $charset 
)

Convert array type variables into UTF-8

Parameters
mixed$val
string$key
string$charsetcharacter set
See Also
arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5
Returns
object converted object

Definition at line 1108 of file Context.class.php.

Context::get (   $key)

Return key's value

Parameters
string$keyKey
Returns
string Key

Definition at line 1973 of file Context.class.php.

Context::getAbsFileUrl (   $file)

Get abstract file url

Deprecated:
Parameters
string$filefile path
Returns
string Converted file path

Definition at line 2159 of file Context.class.php.

Context::getAll ( )

Return all data

Returns
object All data

Definition at line 2012 of file Context.class.php.

Context::getBodyClass ( )

Return css class to Html Body

Returns
string Return class to html body

Definition at line 2546 of file Context.class.php.

Context::getBodyHeader ( )

Returns added html code by addBodyHeader()

Returns
string Added html code after <body>

Definition at line 2570 of file Context.class.php.

Context::getBrowserTitle ( )

Get browser title

Returns
string Browser title(htmlspecialchars applied)

Definition at line 817 of file Context.class.php.

Context::getConfigFile ( )

Get config file

string The path of the config file that contains database settings

Definition at line 2603 of file Context.class.php.

Context::getCSSFile ( )

Return a list of css files

Returns
array Returns css file list. Array contains file, media, targetie.

Definition at line 2383 of file Context.class.php.

Context::getDBInfo ( )

Get DB information

Returns
object DB information

Definition at line 561 of file Context.class.php.

Context::getDBType ( )

Get DB's db_type

Returns
string DB's db_type

Definition at line 538 of file Context.class.php.

Context::getDefaultUrl ( )

Return default URL

Returns
string Default URL

Definition at line 583 of file Context.class.php.

Context::getFTPConfigFile ( )

Get FTP config file

Returns
string The path of the config file that contains FTP settings

Definition at line 2613 of file Context.class.php.

Context::getFTPInfo ( )

Get FTP information

Returns
object FTP information

Definition at line 758 of file Context.class.php.

Context::getHtmlFooter ( )

Returns added html code by addHtmlHeader()

Returns
string Added html code before </body>

Definition at line 2592 of file Context.class.php.

Context::getHtmlHeader ( )

Returns added html code by addHtmlHeader()

Returns
string Added html code before </head>

Definition at line 2524 of file Context.class.php.

& Context::getInstance ( )

returns static context object (Singleton). It's to use Context without declaration of an object

Returns
object Instance

Definition at line 162 of file Context.class.php.

Context::getJavascriptPluginInfo (   $pluginName)

Returns javascript plugin file info

Parameters
string$pluginName
Returns
stdClass

Definition at line 2394 of file Context.class.php.

Context::getJSCallbackFunc ( )

Return js callback func.

Returns
string callback func.

Definition at line 1569 of file Context.class.php.

Context::getJsFile (   $type = 'head')

Returns the list of javascripts that matches the given type.

Parameters
string$typeAdded position. (head:<head>..</head>, body:<body>..</body>)
Returns
array Returns javascript file list. Array contains file, targetie.

Definition at line 2327 of file Context.class.php.

Context::getLang (   $code)

Return string accoring to the inputed code

Parameters
string$codeLanguage variable name
Returns
string If string for the code exists returns it, otherwise returns original code

Definition at line 1008 of file Context.class.php.

Context::getLangType ( )

Get lang_type

Returns
string Language type

Definition at line 996 of file Context.class.php.

Context::getMetaTag ( )

Get meta tag

Returns
array The list of meta tags

Definition at line 2711 of file Context.class.php.

Context::getRequestMethod ( )

Return request method

Returns
string Request method type. (Optional - GET|POST|XMLRPC|JSON)

Definition at line 1537 of file Context.class.php.

Context::getRequestUri (   $ssl_mode = FOLLOW_REQUEST_SSL,
  $domain = null 
)

Return after removing an argument on the requested URL

Parameters
string$ssl_modeSSL mode
string$domainDomain string converted URL

Definition at line 1849 of file Context.class.php.

Context::getRequestUrl ( )

Return request URL

Returns
string request URL

Definition at line 1547 of file Context.class.php.

Context::getRequestVars ( )

Return values from the GET/POST/XMLRPC

Returns
BaseObject Request variables.

Definition at line 2023 of file Context.class.php.

Context::getResponseMethod ( )

Get reponse method

Returns
string Response method. If it's not set, returns request method.

Definition at line 1163 of file Context.class.php.

Context::gets ( )

Get one more vars in object vars with given arguments(key1, key2, key3,...)

Returns
object

Definition at line 1989 of file Context.class.php.

Context::getSiteTitle ( )

Return layout's title

Returns
string layout's title

Definition at line 831 of file Context.class.php.

Context::getSSLActions ( )

Get SSL Action

Returns
string acts in array

Definition at line 2109 of file Context.class.php.

Context::getSslStatus ( )

Return ssl status

Returns
object SSL status (Optional - none|always|optional)

Definition at line 572 of file Context.class.php.

Context::getUrl (   $num_args = 0,
  $args_list = array(),
  $domain = null,
  $encode = TRUE,
  $autoEncode = FALSE 
)

Make URL with args_list upon request URL

Parameters
int$num_argsArguments nums
array$args_listArgument list for set url
string$domainDomain
bool$encodeIf TRUE, use url encode.
bool$autoEncodeIf TRUE, url encode automatically, detailed. Use this option, $encode value should be TRUE
Returns
string URL

Definition at line 1594 of file Context.class.php.

Context::init ( )

Initialization, it sets DB information, request arguments and so on.

See Also
This function should be called only once
Returns
void

Definition at line 201 of file Context.class.php.

Context::isAllowRewrite ( )

Check whether it is allowed to use rewrite mod

Returns
bool True if it is allowed to use rewrite mod, otherwise FALSE

Definition at line 2644 of file Context.class.php.

Context::isExistsSSLAction (   $action)

Check SSL action are existed

Parameters
string$actionact name
Returns
bool If SSL exists, return TRUE.

Definition at line 2124 of file Context.class.php.

Context::isFTPRegisted ( )

Check if FTP info is registered

Returns
bool True: FTP information is registered, False: otherwise

Definition at line 748 of file Context.class.php.

Context::isInstalled ( )

Checks whether XE is installed

Returns
bool True if the config file exists, otherwise FALSE.

Definition at line 2623 of file Context.class.php.

Context::isUploaded ( )

Check if there exists uploaded file

Returns
bool True: exists, False: otherwise

Definition at line 1475 of file Context.class.php.

Context::loadDBInfo ( )

Load the database information

Returns
void

Definition at line 447 of file Context.class.php.

Context::loadFile (   $args)

Load front end file

Parameters
array$argsarray case js : $args[0]: file name, $args[1]: type (head | body), $args[2]: target IE, $args[3]: index case css : $args[0]: file name, $args[1]: media, $args[2]: target IE, $args[3]: index

Definition at line 2191 of file Context.class.php.

Context::loadJavascriptPlugin (   $plugin_name)

Load javascript plugin

Parameters
string$plugin_nameplugin name
Returns
void

Definition at line 2449 of file Context.class.php.

Context::loadLang (   $path)

Load language file according to language type

Parameters
string$pathPath of the language file
Returns
void

Definition at line 858 of file Context.class.php.

Context::loadLangSelected ( )

Find selected languages to serve in the site

Returns
array Selected languages

Definition at line 615 of file Context.class.php.

Context::loadLangSupported ( )

Find supported languages

Returns
array Supported languages

Definition at line 594 of file Context.class.php.

Context::normalizeFilePath (   $file)

Normalize file path

Deprecated:
Parameters
string$filefile path
Returns
string normalized file path

Definition at line 2137 of file Context.class.php.

Context::pathToUrl (   $path)

Converts a local path into an URL

Parameters
string$pathURL path
Returns
string Converted path

Definition at line 2656 of file Context.class.php.

Context::set (   $key,
  $val,
  $set_to_get_vars = 0 
)

Set a context value with a key

Parameters
string$keyKey
mixed$valValue
mixed$set_to_get_varsIf not FALSE, Set to get vars.
Returns
void

Definition at line 1948 of file Context.class.php.

Context::setBrowserTitle (   $site_title)

Set string to browser title

Parameters
string$site_titleBrowser title to be set
Returns
void

Definition at line 802 of file Context.class.php.

Context::setDBInfo (   $db_info)

Set DB information

Parameters
object$db_infoDB information
Returns
void

Definition at line 550 of file Context.class.php.

Context::setLang (   $code,
  $val 
)

Set data to lang variable

Parameters
string$codeLanguage variable name
string$val$codes value
Returns
void

Definition at line 1028 of file Context.class.php.

Context::setLangType (   $lang_type = 'ko')

Set lang_type

Parameters
string$lang_typeLanguage type.
Returns
void

Definition at line 981 of file Context.class.php.

Context::setRequestMethod (   $type = '')

Determine request method

Parameters
string$typeRequest method. (Optional - GET|POST|XMLRPC|JSON)
Returns
void

Definition at line 1184 of file Context.class.php.

Context::setResponseMethod (   $method = 'HTML')

Force to set response method

Parameters
string$methodResponse method. [HTML|XMLRPC|JSON]
Returns
void

Definition at line 1150 of file Context.class.php.

Context::subtractSSLAction (   $action)

Delete if action is registerd to be encrypted by SSL.

Parameters
string$actionact name
Returns
void

Definition at line 2091 of file Context.class.php.

Context::transContent (   $content)

Transforms codes about widget or other features into the actual code, deprecatred

Parameters
stringTransforms codes
Returns
string Transforms codes

Definition at line 2634 of file Context.class.php.

Context::unloadAllCSSFiles ( )

Unload all css files

Returns
void

Definition at line 2372 of file Context.class.php.

Context::unloadAllFiles (   $type = 'all')

Unload front end file all

Parameters
string$typeUnload target (optional - all|css|js)
Returns
void

Definition at line 2218 of file Context.class.php.

Context::unloadAllJsFiles ( )

Unload all javascript files

Returns
void

Definition at line 2278 of file Context.class.php.

Context::unloadCSSFile (   $file,
  $optimized = FALSE,
  $media = 'all',
  $targetie = '' 
)

Remove css file

Deprecated:
Parameters
string$fileFile name with path
string$optimizedoptimized (That seems to not use)
string$mediaMedia query
string$targetietarget IE
Returns
void

Definition at line 2361 of file Context.class.php.

Context::unloadFile (   $file,
  $targetIe = '',
  $media = 'all' 
)

Unload front end file

Parameters
string$fileFile name with path
string$targetIeTarget IE
string$mediaMedia query
Returns
void

Definition at line 2206 of file Context.class.php.

Context::unloadJsFile (   $file,
  $optimized = FALSE,
  $targetie = '' 
)

Remove the js file

Deprecated:
Parameters
string$fileFile name with path
string$optimizedoptimized (That seems to not use)
string$targetietarget IE
Returns
void

Definition at line 2267 of file Context.class.php.

Member Data Documentation

Context::$allow_rewrite = FALSE

Definition at line 21 of file Context.class.php.

Context::$body_class = array()

Definition at line 87 of file Context.class.php.

Context::$body_header = NULL

Definition at line 93 of file Context.class.php.

Context::$context = NULL

Definition at line 45 of file Context.class.php.

Context::$db_info = NULL

Definition at line 51 of file Context.class.php.

Context::$ftp_info = NULL

Definition at line 57 of file Context.class.php.

Context::$get_vars = NULL

Definition at line 135 of file Context.class.php.

Context::$html_footer = NULL

Definition at line 99 of file Context.class.php.

Context::$html_header = NULL

Definition at line 81 of file Context.class.php.

Context::$is_uploaded = FALSE

Definition at line 141 of file Context.class.php.

Context::$isSuccessInit = TRUE

Definition at line 155 of file Context.class.php.

Context::$js_callback_func = ''

Definition at line 33 of file Context.class.php.

Context::$lang = NULL

Definition at line 117 of file Context.class.php.

Context::$lang_type = ''

Definition at line 111 of file Context.class.php.

Context::$loaded_lang_files = array()

Definition at line 123 of file Context.class.php.

Context::$oFrontEndFileHandler

Definition at line 75 of file Context.class.php.

Context::$path = ''

Definition at line 105 of file Context.class.php.

Context::$patterns
Initial value:
= array(
'/<\?/iUsm',
'/<\%/iUsm',
'/<script\s*?language\s*?=\s*?("|\')?\s*?php\s*("|\')?/iUsm'
)

Definition at line 146 of file Context.class.php.

Context::$request_method = 'GET'

Definition at line 27 of file Context.class.php.

Context::$response_method = ''

Definition at line 39 of file Context.class.php.

Context::$site_title = ''

Definition at line 129 of file Context.class.php.

Context::$ssl_actions = array()

Definition at line 69 of file Context.class.php.

Context::$sslActionCacheFile = './files/cache/sslCacheFile.php'

Definition at line 63 of file Context.class.php.


The documentation for this class was generated from the following file: