Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ConceptIn Web RequestIn CLI
logged-in user id$this->Application->RecallVar('user_id')
  • no session
  • no permission checking
  • no logged-in user concept
  • always return fixed user id
is ajax request$this->Application->GetVar('ajax') == 'yes'
  • no web request
  • always return false
current language id$this->Application->GetVar('m_lang')
  • no web request
  • always return primary language id
current theme id$this->Application->GetVar('m_theme')
  • no web request
  • always return primary theme id
automatic object loading by ID in urlcode inside "kDBEventHandler::StoreSelectedIDs" method
  • no web request
  • throw an exception on loading attempt
getting current site domain field$this->Application->siteDomainField('FieldName')
  • no web request
  • no domains
  • always return false
current session id$this->Application->GetSID()
  • no session
  • always return ID of current CLI process ID (PID)
main popup window identifier$this->Application->GetTopmostWid()
  • no windows in CLI
  • always return an empty string
popup window identifier$this->Application->GetVar('m_wid')
  • no windows in CLI
  • always return an empty string
is current user logged-in$this->Application->LoggedIn()
  • no session
  • no permission checking
  • no logged-in user concept
  • always return false
website visitor IP address$this->Application->getClientIP()
  • no web request
  • always return empty string
attempt to read/write web request data 
  • $this->Application->GetVar(..., ...)
  • $this->Application->SetVar(..., ...)
  • $this->Application->DeleteVar(...)
  • no web request
  • create in-memory storage to be used instead of session
  • used during url building a lot
attempt to read/write web request dataother methods
  • always throw an exception
attempt to read/write session data 
  • $this->Application->StoreVar(..., ...)
  • $this->Application->RecallVar(..., ...)
  • $this->Application->RemoveVar(...)
  • no session
  • create in-memory storage to be used instead of session
  • used in some scheduled tasks as temp storage
attempt to read/write session dataother methods
  • always throw an exception

Even though most of methods mentioned makes no sense in CLI they still return value that makes sense to avoid changing every call site.

Things, that usually are done from CLI

  1. sending e-mail
    • can be several e-mails at once
    • each e-mail on different language
    • phrases used inside e-mail
  2. building a link
    • to homepage
    • to other page
    • with use_section="1" attribute
    • with mod-rewrite globally enabled
    • with mod-rewrite globally disabled
    • link to a category item
  3. printing a grid
    • with help of PrintList/PrintList2 tags
    • usage of InitList tag
  4. loading an item
    1. from database by given id

Related Tasks

Jira Legacy
serverSystem Jira
serverId513b375f-8291-3313-9d9f-704c39b1f915
keyINP-1516