EXT: div2007

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2008-04-27T13:30:48
Author:Elmar Hinz
Email:elmar.hinz@team-red.net
Info 3:
Info 4:

EXT: div2007

Extension Key: div2007

Copyright 2007-2008, Elmar Hinz, <elmar.hinz@team-red.net>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: div 1

The functions of tx_div in alphabetic order 1

autoLoadAll 1

browserSession 1

clearAllCaches 2

db 2

explode 2

findTce 2

getDataBase 2

getFrontEndUser 3

getSiteRelativeExtensionPath 3

getValidKey 3

guessKey 3

getGlobal 3

load 3

loadClass 3

loadTcaAdditions 4

makeInstance 4

makeInstanceClassName 4

resolvePathWithExtPrefix 4

session 4

tce 4

toHashArray 5

toHashObject 5

toHashString 5

toListArray 5

toListObject 5

toListString 5

user 5

userSession 5

The functions of tx_div 2007 in alphabetic order

autoLoadAll

Definition

This function walks through all directories of an extension and includes all class files it finds.

Comment

This is rather a quick and dirty solution for lazy file inclusion. There are drawbacks. Please see sourcecode comments before you use it.

browserSession

Definition

Store data into the browser session or load it from there.

Comment

The browser session lasts, while the browser is opened, by default with a maximum of 24 hours. Also see tx_div2007::userSession() and tx_div2007::session() .

clearAllCaches

Definition

Clear all caches at once.

Comment

This function if for the development process only. It can be applied temporary to avoid repeated cache clearing by hand. It will be painful for you, if you forget to disable it on your live server.

db

Definition

This is an alias for the function tx_div2007::getDataBase() .

explode

Definition

Explode a string to an array in a typical way.

Comment

This is typically used to simplify user input for example by TypoScript.

Strings are exploded by ,;: comma, semicolon and colon. The resulting tokens are trimmed. Whitespace inside the token is kept. The list of names: David Copperfield, Mr. Wickfield, Uriah Heep would be split into 3 tokens.

findTce

Definition

Get an instance of the TCE.

Comment

Use the features of the TCE also from the frontend. Useful to do INSERT and UPDATE queries in full accordance with the T3 constraints, but not very fast. A backend user must be logged in or be faked.

getDataBase

Definition

Get the global TYPO3_DB object.

Comment

Typically used to do SELECT queries.

getFrontEndUser

Definition

Get the global frontend user object.

getSiteRelativeExtensionPath

Definition

Load the site relative extension path for the given extension key.

Comment

That is the path to the extension from the view point of the browser in opposite to the absolute path from the view point of the server file system.

getValidKey

Definition

Takes the extension key with or without underscores and finds the matching official extension key with underscores. If the extension key is not loaded it returns false.

Comment

Helps you to find the real, valid key, if you only know the key with underscores stripped. The stripped key is i.e. part of class names.

guessKey

Definition

Takes a string like a class name or a file path, that contains any information about the extension key, and tries to extract it in the official format with underscores.

getGlobal

Definition

Get the global variable of the given key.

load

Definition

This is an alias for the function tx_div2007::loadClass() .

loadClass

Definition

Find and include the file for the given class name ‘tx_key_path_file’.

loadTcaAdditions

Definition

Loads TCA additions of other extensions

Comment

Your extension may depend on fields that are added by other extensions. For reasons of performance parts of the TCA are only loaded on demand. To ensure that the extended TCA is loaded for the extensions yours depends on you can apply this function.

makeInstance

Definition

Load the class file and make an instance of the class.

Comment

This is an extension to t3lib_div::makeInstance(). It automatically finds and includes the required class file. The XCLASS mechanisms are working. See tx_div2007::makeInstanceClassName() .

makeInstanceClassName

Definition

Load the class file and return the class name or the ux_classname.

Comment

See tx_div2007::makeInstance() .

resolvePathWithExtPrefix

Definition

Resolve extension paths that make use of the “EXT:” prefix.

Comment

The path is relative to PATH_site. See tx_div2007::getSiteRelativeExtensionPath() .

session

Definition

This is an alias for the function tx_div2007::browserSession() .

tce

Definition

This is an alias for the function tx_div2007::findTce() .

toHashArray

Definition

Takes suitable data as input and converts it to a hash array.

toHashObject

Definition

Takes suitable data as input and converts it to a hash object.

toHashString

Definition

Takes suitable data as input and converts it to a hash string.

toListArray

Definition

Takes suitable data as input and converts it to a list array.

toListObject

Definition

Takes suitable data as input and converts it to a list object.

toListString

Definition

Takes suitable data as input and converts it to a list string.

user

Definition

This is an alias for the function tx_div2007::getFrontEndUser() .

userSession

Definition

Store data into the user session or load it from there.

Comment

The user session is bound to the user account. If a frontend user logs into the same account on a different machine, the session data is already there. Also see tx_div2007::browserSession() .

img-1 EXT: div2007 - 5