KWeb  6.4
KWeb Class Reference

Public Member Functions

 __construct ()
 isInitialized ()
 timeElapsed ()
 Returns time elapsed since start of this request (seconds as float)
 storeUpdates ($storeNow=false)
 Stores all changed items in the database, or marks these changes for storage at the end of the script execution.
 finish ($noLayout=false, $exit=true)
 checkInc ($inc, $usePrefixes=true)
 getIncPath ($inc, $usePrefixes=true, $skip=0, $discoveryParams=array())
 Zwraca ścieżkę do pliku z szablonem.
 resolveInc ($inc, $usePrefixes=true, $skip=0, $discoveryParams=array())
 Resolves relative inc to absolute inc identifier.
 getIncFromPath ($path, $absolute=true)
 overrideIncPath ($inc, $newPath)
 safeIncPath ($inc)
 getIncContent ($inc, $LVAR=array(), $require=true, $usePrefixes=true, $skip=0, $discoveryParams=array())
 printInc ($inc, $LVAR=array(), $require=true, $usePrefixes=true, $skip=0, $discoveryParams=array())
 printTemplateFile ($path, $LVAR=array())
 getCurrentItem ($object=true)
 Returns the SHORT path - local if it exists, or KWeb otherwise.
 getCurrentInc ()
 getCurrentIncVariables ($filter=false)
 getOpenedObject ($object=true, $mainRequest=false)
 getOpenedInc ($mainRequest=false)
 getCurrentView ()
 getOpenedView ($mainRequest=false)
 getOpenedPath ($expand, $object=true, $mainRequest=false)
 Zwraca ścieżkę otwarcia jako nazwa1/nazwa2/nazwa3 lub listę obiektów ...
 getOpenedLang ($mainRequest=false)
 runViewConfig ($view, $object=null)
 Runs object and/or view configuration.
 getItemUrl ($itemId, $view=null, $params=null, $lang=false, array $options=array())
 getIncUrl ($inc, $params=null, $lang=false, array $options=array())
 getUrl ($uri='', $params=null, $lang=false, array $options=array())
 fullUrlPush ()
 fullUrlPop ()
 isFullUrlEnabled ()
 getTempId ()
 isTempId ($id)
 pushError ($where, $type, $msg)
 popError ($where)
 countErrors ($where)
 debug ($where, $msg)
 Stores debug information.
 setDebugging ($enable, $sticky=false)
 Enables or disables debuging.
 isDebugging ()
 Returns TRUE if we are in debug mode.
 getDebugData ()
 gotCriticalError ()
 accessError ($msg, $critical=true, $editor=false, $dump=false)
 error ($msg, $dump=false)
 formatExceptionMessage ($e, $errorLevel=E_ERROR, $state= 'running')
 exceptionHandler ($exception)
 errorHandler ($errno, $message, $file, $line, array $context)
 onKDBTimeout ($event)
 logMsg ($type, $where, $msg, $dump= '')
 Logs a message in the database.
 redirect ($to, $response='302 Found', $checkError=true, $throw=true)
 handleRedirectException (KWebException_Redirect $redirect)
 getCurrentUser ($object=true)
 getUser ($userId, $object=true, $critical=true)
 getUserGroups ($userId=false)
 generateUniqueId ()
 setCharsetOut ($set)
 getCharsetOut ()
 convInOut ($s)
 convOutIn ($s)
 pathLocal ($path, $fromUrl=false)
 Returns absolute, local system path.
 pathPublic ($path, $fromUrl=false)
 Returns absolute, local system path to public files.
 pathRelative ($path, $fromUrl=false, $relativeTo=KWEB_PUBLIC_PATH)
 Returns relative path.
 pathSystem ($path, $relativeTo, $fromUrl=false)
 Returns absolute, local system path.
 pathClient ($path, $forceFull=null)
 Returns path accesible by clients - a web path.
 isInAdminMode ()

Static Public Member Functions

static instance ()
static start ()
 isLocalReferer ()
static escape ($value, $format=false)
 Convenience function for calling TextFormat::escape()
static image ($file, $searchIn=null)
static icon ($name, $size=ICON_SMALL, $searchIn=null, $find=true)

Data Fields

 $incStack = array()
 $itemStack = array()
 $viewStack = array()
 $lvarStack = array()
 $adminMode = true
 $domain = array('path' => '')
 Currently utilized domain.
const URL_REQUEST_TYPE = 'requestType'
 Request type of URL to use.
const URL_SLUG = 'slug'
 Slug to use in URL.
const URL_HASH = 'hash'
 Hash to append to the url.
const URL_MATCH_PATH = 'matchPath'
 Specify path to match, or TRUE if Url should try to match currently opened path (.
const URL_MATCH_LANG = 'matchLang'
 Language to use for path matching (.
const URL_SHORTEN = 'shorten'
 Makes URL as short as possible.
const URL_PATH_PARAMS = 'pathParams'
 List of parameter keys which should be embedded in path (like "/index,name-value.html")
const URL_FULL = "full"
 If TRUE, the url will have 'http://domain' portion prepended.
const URL_RESOLVE_INC = "resolveInc"
 If TRUE, the template path will be resolved.
const URL_DONT_ALTER = "dontAlter"
 Tells event handlers to not alter this url.
const PRINT_RETURN_OUTPUT = "returnOutput"
const CONVERT_TO = true
 Conversion TO specified FORMAT_ If conversion is for example FROM hashmap TO string then using CONVERT_TO will result in a string (from hashmap)
const CONVERT_FROM = false
 Conversion FROM specified FORMAT_ If conversion is for example FROM hashmap TO string then using CONVERT_FROM will result in a hashmap (from string)
const FORMAT_STRING = 'string'
 Data stored as strings.
const FORMAT_SQL = 'sql'
 Data stored in database.
const FORMAT_INTERNAL = false
 Data used in objects.
const FORMAT_FORM = 'form'
 Data used in web forms.
const EVENT_FINISH = "kweb.kweb.finish"
const EVENT_FINISHED = "kweb.kweb.finished"
const EVENT_UNHANDLED_EXCEPTION = "kweb.kweb.unhandled_exception"
 Use setProcessed() to suppress standard error information output.
const ERRORSTACK_NOTIFY = KErrorStack::NOTIFY
 Errors on this stack will be stored in the session in case they didn't show up.

Static Public Attributes

static $inst

Protected Member Functions

 _initialize ()
 commitPendingData ($commit=false)
 Stores cached objects and session.

Protected Attributes

 $requestId
 $debug = array()
 $debugLimit = 100
 $criticalError = false
 $incPaths = array()
 $timingRun

Constructor & Destructor Documentation

KWeb::__construct ( )

Member Function Documentation

KWeb::_initialize ( ) [protected]
KWeb::accessError ( msg,
critical = true,
editor = false,
dump = false 
)
KWeb::checkInc ( inc,
usePrefixes = true 
)
KWeb::commitPendingData ( commit = false) [protected]

Stores cached objects and session.

KWeb::convInOut ( s)
KWeb::convOutIn ( s)
KWeb::countErrors ( where)
KWeb::debug ( where,
msg 
)

Stores debug information.

KWeb::error ( msg,
dump = false 
)
KWeb::errorHandler ( errno,
message,
file,
line,
array $  context 
)
static KWeb::escape ( value,
format = false 
) [static]

Convenience function for calling TextFormat::escape()

Parameters:
$format(html, js, html+js, url, slug, id)
KWeb::exceptionHandler ( exception)
Parameters:
$exceptionException
KWeb::finish ( noLayout = false,
exit = true 
)
KWeb::formatExceptionMessage ( e,
errorLevel = E_ERROR,
state = 'running' 
)
KWeb::fullUrlPop ( )
KWeb::fullUrlPush ( )
KWeb::generateUniqueId ( )
KWeb::getCharsetOut ( )
KWeb::getCurrentInc ( )
KWeb::getCurrentIncVariables ( filter = false)
KWeb::getCurrentItem ( object = true)

Returns the SHORT path - local if it exists, or KWeb otherwise.

This function is a little bit faster and simpler than pathOverride. It's designed for interface files like CSS, Images etc.

Parameters:
$dirDirectory (without opening/ending slashes)
$fileFilename
$localnull = dozwolone są lokalne przeciążenia, true = zwraca lokalne przeciążenie (zawsze!), false = zwraca zawsze oryginał
Returns:
Short path (should be prefixed with web or system path)
KWeb::getCurrentUser ( object = true)
Returns:
KWebItem_User
KWeb::getCurrentView ( )
KWeb::getDebugData ( )
KWeb::getIncContent ( inc,
LVAR = array(),
require = true,
usePrefixes = true,
skip = 0,
discoveryParams = array() 
)
KWeb::getIncFromPath ( path,
absolute = true 
)
KWeb::getIncPath ( inc,
usePrefixes = true,
skip = 0,
discoveryParams = array() 
)

Zwraca ścieżkę do pliku z szablonem.

Parameters:
incNazwa szablony. Poprzedzenie jej znakiem '/' wymusza zwrot ścieżki bez prefixów. Dodanie kolejnego znaku '/' zwraca ścieżkę z katalogu kweb
KWeb::getIncUrl ( inc,
params = null,
lang = false,
array $  options = array() 
)
KWeb::getItemUrl ( itemId,
view = null,
params = null,
lang = false,
array $  options = array() 
)
KWeb::getOpenedInc ( mainRequest = false)
KWeb::getOpenedLang ( mainRequest = false)
KWeb::getOpenedObject ( object = true,
mainRequest = false 
)
Returns:
KWebObject
KWeb::getOpenedPath ( expand,
object = true,
mainRequest = false 
)

Zwraca ścieżkę otwarcia jako nazwa1/nazwa2/nazwa3 lub listę obiektów ...

Parameters:
$expandbool Jeżeli jest true, zwraca pełną listę obiektów (razem z rodzicami pierwszego elementu ścieżki)
KWeb::getOpenedView ( mainRequest = false)
KWeb::getTempId ( )
KWeb::getUrl ( uri = '',
params = null,
lang = false,
array $  options = array() 
)
Parameters:
$paramsarray Parametry do dołączenia do adresu. Parametry zaczynające się od / zostaną dopisane do adresu ścieżki (jako index,nazwa-wartosc.html.
KWeb::getUser ( userId,
object = true,
critical = true 
)
Returns:
KWebItem_User
KWeb::getUserGroups ( userId = false)
KWeb::gotCriticalError ( )
KWeb::handleRedirectException ( KWebException_Redirect redirect)
static KWeb::icon ( name,
size = ICON_SMALL,
searchIn = null,
find = true 
) [static]
static KWeb::image ( file,
searchIn = null 
) [static]
static KWeb::instance ( ) [static]
Returns:
KWeb
KWeb::isDebugging ( )

Returns TRUE if we are in debug mode.

KWeb::isFullUrlEnabled ( )
KWeb::isInAdminMode ( )
KWeb::isInitialized ( )
KWeb::isLocalReferer ( ) [static]
KWeb::isTempId ( id)
KWeb::logMsg ( type,
where,
msg,
dump = '' 
)

Logs a message in the database.

Parameters:
$typeE_ERROR, E_WARNING or E_NOTICE
$whereString identifier of the log group
$msgMessage to log
$dumpAdditional information
KWeb::onKDBTimeout ( event)
Parameters:
Event$event
KWeb::overrideIncPath ( inc,
newPath 
)
KWeb::pathClient ( path,
forceFull = null 
)

Returns path accesible by clients - a web path.

Parameters:
$path
boolean/null$forceFull Should return full path (with hostname)? If null it will use current system's setting (from pushFullUrl)
Returns:
Ambiguous|string
KWeb::pathLocal ( path,
fromUrl = false 
)

Returns absolute, local system path.

Fore relative paths KWEB_PATH will be used, for URLs - KWEB_PUBLIC_PATH

Parameters:
$path- relative system path, absolute system path, or URL
$fromUrl- treat all absolkute paths as URLs
KWeb::pathPublic ( path,
fromUrl = false 
)

Returns absolute, local system path to public files.

Parameters:
$path- relative system path, absolute system path, or URL
$fromUrl- treat all absolkute paths as URLs
KWeb::pathRelative ( path,
fromUrl = false,
relativeTo = KWEB_PUBLIC_PATH 
)

Returns relative path.

Parameters:
$path- relative system path, absolute system path, or URL
$fromUrl- treat all absolute paths as URLs
KWeb::pathSystem ( path,
relativeTo,
fromUrl = false 
)

Returns absolute, local system path.

Resolves relative paths and urls based on provided base path.

Parameters:
$path- relative system path, absolute system path, or URL
$fromUrl- treat all absolute paths as URLs
$relativeTo- base path for relative and URL paths
KWeb::popError ( where)
KWeb::printInc ( inc,
LVAR = array(),
require = true,
usePrefixes = true,
skip = 0,
discoveryParams = array() 
)
Parameters:
LVAR- parametry do przekazania do szablonu. Specjalne znaczniki: returnOutput - zwraca wydruk
KWeb::printTemplateFile ( path,
LVAR = array() 
)
KWeb::pushError ( where,
type,
msg 
)
KWeb::redirect ( to,
response = '302 Found',
checkError = true,
throw = true 
)
KWeb::resolveInc ( inc,
usePrefixes = true,
skip = 0,
discoveryParams = array() 
)

Resolves relative inc to absolute inc identifier.

KWeb::runViewConfig ( view,
object = null 
)

Runs object and/or view configuration.

Parameters:
$view- view to run VIEW/_view_config template on
KWebObject$object- object to run "_config" template on
KWeb::safeIncPath ( inc)
KWeb::setCharsetOut ( set)
KWeb::setDebugging ( enable,
sticky = false 
)

Enables or disables debuging.

Parameters:
$stickyif TRUE debugging will not be disabled
static KWeb::start ( ) [static]
KWeb::storeUpdates ( storeNow = false)

Stores all changed items in the database, or marks these changes for storage at the end of the script execution.

Parameters:
$storeNow
KWeb::timeElapsed ( )

Returns time elapsed since start of this request (seconds as float)


Field Documentation

KWeb::$adminMode = true
KWeb::$criticalError = false [protected]
KWeb::$debug = array() [protected]
KWeb::$debugLimit = 100 [protected]
KWeb::$domain = array('path' => '')

Currently utilized domain.

Filled by KWebOpenURI, from KWebSetting::$inst->domains;

KWeb::$incPaths = array() [protected]
KWeb::$incStack = array()
KWeb::$inst [static]
KWeb::$itemStack = array()
KWeb::$lvarStack = array()
KWeb::$requestId [protected]
KWeb::$timingRun [protected]
KWeb::$viewStack = array()
const KWeb::CONVERT_FROM = false

Conversion FROM specified FORMAT_ If conversion is for example FROM hashmap TO string then using CONVERT_FROM will result in a hashmap (from string)

const KWeb::CONVERT_TO = true

Conversion TO specified FORMAT_ If conversion is for example FROM hashmap TO string then using CONVERT_TO will result in a string (from hashmap)

Errors on this stack will be stored in the session in case they didn't show up.

const KWeb::EVENT_FINISH = "kweb.kweb.finish"
const KWeb::EVENT_FINISHED = "kweb.kweb.finished"
const KWeb::EVENT_UNHANDLED_EXCEPTION = "kweb.kweb.unhandled_exception"

Use setProcessed() to suppress standard error information output.

const KWeb::FORMAT_FORM = 'form'

Data used in web forms.

const KWeb::FORMAT_INTERNAL = false

Data used in objects.

const KWeb::FORMAT_SQL = 'sql'

Data stored in database.

const KWeb::FORMAT_STRING = 'string'

Data stored as strings.

const KWeb::PRINT_RETURN_OUTPUT = "returnOutput"
const KWeb::URL_DONT_ALTER = "dontAlter"

Tells event handlers to not alter this url.

const KWeb::URL_FULL = "full"

If TRUE, the url will have 'http://domain' portion prepended.

Defaults to KWeb::$inst->getFullUrl()

const KWeb::URL_HASH = 'hash'

Hash to append to the url.

const KWeb::URL_MATCH_LANG = 'matchLang'

Language to use for path matching (.

See also:
KWebItem::getItemPath $matchLang)
const KWeb::URL_MATCH_PATH = 'matchPath'

Specify path to match, or TRUE if Url should try to match currently opened path (.

See also:
KWebItem::getItemPath $match) true
const KWeb::URL_PATH_PARAMS = 'pathParams'

List of parameter keys which should be embedded in path (like "/index,name-value.html")

const KWeb::URL_REQUEST_TYPE = 'requestType'

Request type of URL to use.

If FALSE then no suffix will be used

const KWeb::URL_RESOLVE_INC = "resolveInc"

If TRUE, the template path will be resolved.

const KWeb::URL_SHORTEN = 'shorten'

Makes URL as short as possible.

const KWeb::URL_SLUG = 'slug'

Slug to use in URL.


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