**********************************************************************************
*** How Typo3 was updated to new naming convension as stated in "Inside Typo3" ***
**********************************************************************************


- First, removed symlinks to t3lib and stdlib in typo3.




*************************
** NEW CONSTANTS: (1)
************************

WHAT: The path-definition variables are converted into constants, prefixed PATH_
REASON: Better security and less global vars.
SCOPE:	/	(whole source tree, .php,.inc)

$stdlib_path	= PATH_stdlib
$typo3lib_path	= PATH_t3lib
$config_path	= PATH_typo3conf
$TSlib_path	= PATH_tslib

$modPath 	= PATH_typo3_mod
$typo3Path	= PATH_typo3
$sitePath	= PATH_site
$tempPath	= PATH_temp
	

--search: I used this regex to find path assignments. 
(stdlib_path|typo3lib_path|config_path|sitePath|TSlib_path|modPath|typo3Path|sitePath|tempPath)"?\]?[ ]*=

--action: 
I manually replaced the definitions with define()-function and the new name


--search: I searched for the use of the variables
\$(stdlib_path|typo3lib_path|config_path|TSlib_path|modPath|typo3Path|sitePath|tempPath)
\$GLOBALS\["?(stdlib_path|typo3lib_path|config_path|TSlib_path|modPath|typo3Path|sitePath|tempPath)"?\]
-- Action: none, just to gain an idea...



-- search regex
\$GLOBALS\["?stdlib_path"?\]|\$stdlib_path
\$GLOBALS\["?typo3lib_path"?\]|\$typo3lib_path
\$GLOBALS\["?config_path"?\]|\$config_path
\$GLOBALS\["?TSlib_path"?\]|\$TSlib_path
\$GLOBALS\["?typo3Path"?\]|\$typo3Path
\$GLOBALS\["?sitePath"?\]|\$sitePath
-- replace:
Replaced with respective constant 


-- search regex:
\$GLOBALS\["?tempPath"?\]|\$tempPath
\$GLOBALS\["?modPath"?\]|\$modPath
-- action:
Some instances manually replaced



-- check search: Check that there are no missed variables left:
stdlib_path|typo3lib_path|config_path|TSlib_path|modPath|typo3Path|sitePath|tempPath



*************************
** stdlib/typo3lib/tslib functions removed: (2)
************************

-- search (regex):
stdlib[ ]*\(['"]([A-Za-z0-9_\.]*)['"]\)
-- replace:
include_once(PATH_stdlib."\1.php")



-- search (regex):
typo3lib[ ]*\(['"]([A-Za-z0-9_\.]*)['"]\)
-- replace:
include_once(PATH_t3lib."\1.php")


-- search (regex):
TSlib[ ]*\(['"]([A-Za-z0-9_\.]*)['"]\)
-- replace:
include_once(PATH_tslib."\1.php")



-- check:
(TSlib|typo3lib|stdlib)[ ]*\(
(content|fe_tce|gifbuilder|menu|pagegen|search|showpic)\.php



-- action:
Removed stdlib() and typo3lib() functions and line with '$stdlib[standard]' from stdlib/standard.php
Removed TSlib() from tslib/index_ts.php






*************************
** New filenaming (3)
************************

NOTE:
The following - unless otherwise stated - are search/replace with the following regex. For the sake of simplicity the regex "body" is omitted in each case, but you must use this:

--search regex, example with "admin":
((class|extends|new)[[:space:]]*)admin([;[:space:]\{])
--replacing:
\1t3lib_admin\3



t3lib/

admin.php		-> class.t3lib_admin.php
--search
admin
--replace
t3lib_admin

basicfilefunctions.php	-> class.t3lib_basicfilefunctions.php
--search
basicFileFunctions
--replace
t3lib_basicFileFunctions

be_log.php              -> class.t3lib_bedisplaylog.php
--search
logFunctions
--replace
t3lib_BEDisplayLog

cookie.php deleted: Nobody used it.

debug.php		-> class.t3lib_timetrack.php
--search
timeTrack
--replace
t3lib_timeTrack

exportdata.php		-> class.t3lib_exportdata.php
--search
exportData_base
--replace
t3lib_exportData

extfilefunctions.php	-> class.t3lib_extfilefunctions.php
--search
extFileFunctions
--replace
t3lib_extFileFunctions

load_interface_mod.php	-> class.t3lib_loadmodules.php
--search
loadModules
--replace
t3lib_loadModules

loaddbgroup.php		-> class.t3lib_loaddbgroup.php
--search
loadDBGroup_base
--replace
t3lib_loadDBGroup

page.php		-> class.t3lib_page.php
--search
pageselect_base
--replace
t3lib_pageSelect

recordlist.php		-> class.t3lib_recordlist.php
--search
recordList_base
--replace
t3lib_recordList

statgif.php deleted: Not used yet. Will be later - maybe...

stdgraphic.php		-> class.t3lib_stdgraphic.php
--search
stdgraphic
--replace
t3lib_stdGraphic

tce_main.php		-> class.t3lib_tcemain.php
--search
tce_main
--replace
t3lib_TCEmain

transferdata.php	-> class.t3lib_transferdata.php
--search
transferData_base
--replace
t3lib_transferData

tree.php		-> class.t3lib_pagetree.php
--search
pageTree
--replace
t3lib_pageTree

userauth.php		-> class.t3lib_userauth.php
--search
userauth_base
--replace
t3lib_userAuth

userauth_group.php	-> class.t3lib_userauthgroup.php
--search
userauth_group
--replace
t3lib_userAuthGroup




Special treatment:


tsparser.php		-> class.t3lib_tstemplate.php
			-> class.t3lib_matchcondition.php
			-> class.t3lib_tsparser.php
There was three classes in this file. Each is now in it's own file.
function getGlobal() was moved into class t3lib_matchCondition and functions calls in this class was corrected. There was apparently no other use of that function in other scripts.
function sortedKeyList() was moved into class t3lib_TStemplate. Function calls in menu/gifbuilder/content.php was corrected by prepending t3lib_TStemplate::

--search
TSparser_base
--replace
t3lib_TStemplate

--search
configParser
--replace
t3lib_TSparser

--search
matchRequest
--replace
t3lib_matchCondition





standard.php		-> class.t3lib_befunc.php
--search
be_interfaceFunctions
--replace
t3lib_BEfunc
The last line created and instance of this class in GLOBALS["BEFunc"]. This is not the case anymore. The object must be created outside the class. (changed in typo3/init.php and tslib/index_ts.php)

function typo3PrintError() is now included in the class. Therefore functioncalls must be prefixed, t3lib_BEfunc::

--search this regex (dont insert in class-regex above!!!)
([^A-Za-z0-9_>:])typo3PrintError[ ]*\(
--Replace with:
\1t3lib_BEfunc::typo3PrintError (





iconworks.php		-> class.t3lib_iconworks.php
Two functions, class "t3lib_iconWorks" created for them
function getIcon() and makeIcon() is prefixed with t3lib_iconWorks::

--search this regex (dont insert in class-regex above!!!)
([^A-Za-z0-9_>:])getIcon([ ]*)\(
--Replace with:
\1t3lib_iconWorks::getIcon\2(

Prefix manually "t3lib_iconWorks::" to one instances of makeIcon() in class.t3lib_iconworks.php






Replace wrong function-definitions (with blablabla:: prefixed...)

--search
function([[:space:]]*)[A-Za-z0-9_]*::
--replace
function\1



Update include-statements to new names:

--search
PATH_t3lib\."(admin|basicfilefunctions|exportdata|extfilefunctions|loaddbgroup|page|recordlist|stdgraphic|transferdata|userauth|iconworks|be_log|debug|load_interface_mod|tce_main|tree|userauth_group|tsparser|standard).php"
--replace
PATH_t3lib."class.t3lib_\1.php"

--search
PATH_t3lib\."class.t3lib_(be_log|debug|load_interface_mod|tce_main|tree|userauth_group|tsparser|standard).php"
--replace: manually insert the new name:

be_log -> bedisplaylog
debug -> timetrack
load_interface_mod -> loadmodules
tce_main -> tcemain
tree -> pagetree
userauth_group -> userauthgroup
tsparser -> tstemplate
standard -> befunc


Inserted these lines in the top of class.t3lib_tstemplate.php:

include_once(PATH_t3lib."class.t3lib_tsparser.php");
include_once(PATH_t3lib."class.t3lib_matchcondition.php");



Checking:
Searching for 

--search:
PATH_t3lib[[:space:]]*\.["'][[:space:]]*[^c]
--result: Should give zero hits.

--search:
(class|extends)[[:space:]][[:space:]]*[^t][^3][^l][^i][^b]
--result: Should give a lot of results, among others classes that are extension of the classes in t3lib




*******************************************************
** remove stdlib/ and make new classes in t3lib (4)
*******************************************************




stdlib/


index.html - deleted
info.html - deleted
fwd.gif - deleted
rew.gif - deleted
formmail.php - deleted, was not used because Typo3 uses tslib/index_ts.php for formmail-actions.
md5.js.php - deleted, typo3/index.php was updated to use the file, typo3/md5.js

moved, search for use and corrected path:
formvalidate.js -> jsfunc.validateform.js
formupdate.js -> jsfunc.updateform.js
menu.js -> jsfunc.menu.js
class_gzip_encode.php  -> class.gzip_encode.php
htmlmail.php  ->	class.t3lib_htmlmail.php
			class.t3lib_formmail.php
			(+ change class-names
--search
((class|extends|new)[[:space:]]*)mail_base([;[:space:]\{])
--replacing:
\1t3lib_htmlmail\3

--search
((class|extends|new)[[:space:]]*)formmail([;[:space:]\{])
--replacing:
\1t3lib_formmail\3




--search (php,inc,html,htm,tmpl)
fwd.gif|rew.gif|formmail.php|formvalidate.js|formupdate.js|menu.js|class_gzip_encode.php
--action:
Manually replace the old filenames with the new filenames AND path.

--search (normal)
PATH_stdlib."htmlmail.php"
--replace
PATH_t3lib."class.t3lib_htmlmail.php"


--search

--replace
t3lib_htmlmail


The new general class, t3lib_div:
tags.php	
debug.php	
standard.php	
files.php       
strings.php	
	->	class.t3lib_div.php


All functions is collected in a class, t3lib_div.
Class search_result is removed, the member function "split" was moved to tslib/search.php where it was used as the only place...



--search
([^A-Za-z0-9_>:])(milliseconds|gif_compress|png_to_gif_by_imagemagick|checkbrowser|fixed_lgd|fixed_lgd_pre|hardspace|break_text|unbreak_text|inList|inArray|rmFromList|intInRange|intval_positive|intExplode|trimExplode|extParseUrl|split_fileref|modifyHTMLColor|rm_endcomma|danish_strtoupper|split_attributes|splitCalc|uniqueArray|uniqueList|shortMD5|testInt|isFirstPartOfStr|formatSize|stripslashes_array|get_tag_attributes|split_tag_attributes|imagefinder|linkfinder|getURL|getStrippedURL|getMimeType|writeFile|get_dirs|debug_white_space|debug_ordvalue|debug_code|parsetime|view_array|print_array,GPvar)[[:space:]]*\(
--Replace with:
\1t3lib_div::\2(

(600 function calls was replaced.... :-) )

Functions NOT replaced by this regex:
debug
-still some global vars in the file. Removed later to another file...



Replace wrong function-definitions (with blablabla:: prefixed...)

--search
function([[:space:]]*)[A-Za-z0-9_]*::
--replace
function\1

(60 functions were corrected...)



--search:
(tags|debug|files|strings)\.php
--action:
remove any include-statements


--search (non-regex)
PATH_stdlib."standard.php"
--replace
PATH_t3lib."class.t3lib_div.php"

--search (non-regex)
PATH_t3lib."class.t3lib_div.php"
--action:
Check that PATH_t3lib exists as constant!

--search (non-regex)
PATH_stdlib
--action
remove last define()'s

--search: 
stdlib
--action
in general and remove references in text




Introducing central default configuration file, which includes one functions, debug()

File: t3lib/config_default.php

This statement is inserted in: init.php,thumbs.php,index_ts.php and showpic.php instead of TYPO3_CONF_VARS array.
include(PATH_t3lib."config_default.php")

This file presumes that the constant PATH_typo3conf is set.
functions debug() is defined in this file.











___________________

renamed tslib/media-00 to tslib/media/ in typo3_src-[xxx]
deleted stdlib/

Means:
remove/regenerate softlinks to these dirs on website





*******************************************************
** Functions (5)
*******************************************************


mysql_fetch_array() -> mysql_fetch_assoc()
--search
([^A-Za-z0-9_>:])mysql_fetch_array([[:space:]]*)\(
--replace
\1mysql_fetch_assoc\2(


split() -> explode()
--search: This regex finds all split-functions that use a single character and therefore does not use the reg-ex features of split()
([^A-Za-z0-9_>:])split([[:space:]]*)\(([[:space:]]*["'])[\\]?(.["'])
--replace
\1explode\2(\3\4

--search: Finds all split($...) functions
([^A-Za-z0-9_>:])split([[:space:]]*)\([[:space:]]*\$
--action:
manual replace if possible

--search: 
([^A-Za-z0-9_>:])split([[:space:]]*)\([[:space:]]*["']
--action:
manual replace if possible




*******************************************************
** new filenaming in tslib/ (6)
*******************************************************

NOTE:
The following - unless otherwise stated - are search/replace with the following regex. For the sake of simplicity the regex "body" is omitted in each case, but you must use this:

--search regex, example with "admin":
((class|extends|new)[[:space:]]*)admin([;[:space:]\{])
--replacing:
\1tslib_admin\3


fe_tce.php -> class.tslib_fetce.php
--search
fe_tce_main
--replace
tslib_feTCE

gifbuilder.php -> class.tslib_gifbuilder.php
--search
gifbuilder_base
--replace
tslib_gifBuilder

search.php -> class.tslib_search.php
--search
search_base
--replace
tslib_search


SPECIAL. These two class-files differ from the rest, because they include more than one class. Why is that? Because the alternative is to split them up in 9 include-files which depend on each other anyway. So for the sake of efficiency these are still kept together. But the general rule is "one class per class-file":

content.php	-> class.tslib_content.php
classes cObj, frameset, tableOffset, controlTable was prepended with "tslib_"

--search regex
((class|extends|new)[[:space:]]*)(cObj|frameset|tableOffset|controlTable)([;[:space:]\{])
--replacing:
\1tslib_\3\4


menu.php	-> class.tslib_menu.php
class menu_base, tmenu_base, gmenu_base, imgmenu_base, jsmenu_base was prepended with "tslib_" and "_base" removed.
--search regex
((class|extends|new)[[:space:]]*)(menu|tmenu|gmenu|imgmenu|jsmenu)_base([;[:space:]\{])
--replacing:
\1tslib_\3\4




Cleaning up filenames:

--search (non-regex)
PATH_tslib
--action:
Manually insert the correct filenames where changed



---------------


************************************************************
** cleaning in tslib/index_ts.php and tslib/pagegen.php (7)
************************************************************

debug_typo3PrintError from t3lib_timetrack was included in the class
use of the function should be like:

--search (non-regex)
debug_typo3PrintError
--replace
t3lib_timeTrack::debug_typo3PrintError

manually removed falsely set prefix "function t3lib_timeTrack::" in timetrack-class...




Create class/classfile : class.tslib_feuserauth.php
changed in index_ts.php:
- included new class-file
- $fe_user = new userauth;	-> $fe_user = new tslib_feUserAuth;

Create class/classfile : class.t3lib_beuserauth.php
changed in typo3/init.php AND tslib/index_ts.php:
- included new class-file
$be_user = new userauth;	-> $be_user = new t3lib_beUserAuth;


function getExtUrl in class t3lib_page was overridden with the function normally used in frontend. Probably not a problem for anyone, since this function was only used in the frontend anyway...
in index_ts.php:	new pageselect -> new t3lib_pageSelect;


Created class/classfile : class.tslib_fe.php
functions from index_ts.php put in this class:
--search
([^A-Za-z0-9_>:])(tidyHTML|getPageAndRootline|clear_preview|set_no_cache|set_cache_timeout_default|is_included|fetch_the_id)[[:space:]]*\(
--Replace with:
\1tslib_fe::\2(

--search
function([[:space:]]*)[A-Za-z0-9_]*::
--replace
function\1


(*** step6a:)

Definitions of $WHICH_OS is made into the constant TYPO3_OS by:
define("TYPO3_OS", stristr(PHP_OS,"win")?"WIN":"");
--search: (case-SENSITIVE!!)
(\$GLOBALS\[[[:space:]]*['"]?|\$)(WHICH_OS)(['"]?[[:space:]]*\]|)
--replace
TYPO3_OS
Also: Removed key TYPO3_CONF_VARS["SYS"]["os"] 

Removed file typo3/fe_tce_db.php as it was not used

global var PHPVER in init.php removed. Typo3 supports only PHP4.

Constant PATH_thisScript instead of $theScriptName
--search: (case-SENSITIVE!!)
(\$GLOBALS\[[[:space:]]*['"]?|\$)(theScriptName)(['"]?[[:space:]]*\]|)
--replace
PATH_thisScript

function convertPathFromWindows was removed.

typo3/init.php:	$typo3MainDir -> constant, TYPO3_mainDir
typo3/init.php:	$path -> $temp_path

typo3/init.php:	$TYPO3_MOD_PATH -> constant, TYPO3_MOD_PATH		(!!!)
--search: (case-SENSITIVE!!)
(\$GLOBALS\[[[:space:]]*['"]?|\$)(TYPO3_MOD_PATH)(['"]?[[:space:]]*\]|)([[:space:]]*[^=])
--replace
TYPO3_MOD_PATH\4
--search: (case-SENSITIVE!!): FInds all TYPO3_CONF_VARS definitions and makes them into define-statements
(\$GLOBALS\[[[:space:]]*['"]?|\$)(TYPO3_MOD_PATH)(['"]?[[:space:]]*\]|)(:space:]]*[=])([^;]*)
--replace
define("TYPO3_MOD_PATH", \5)

Removing these global constants:
$contentTable = $GLOBALS["TYPO3_CONF_VARS"]["SYS"]["contentTable"];
$sitename = $GLOBALS["TYPO3_CONF_VARS"]["SYS"]["sitename"];
$DDMMYY = $GLOBALS["TYPO3_CONF_VARS"]["SYS"]["ddmmyy"];
$HHMM = $GLOBALS["TYPO3_CONF_VARS"]["SYS"]["hhmm"];
--search
(\$GLOBALS\[[[:space:]]*['"]?|\$)sitename(['"]?[[:space:]]*\]|)
(\$GLOBALS\[[[:space:]]*['"]?|\$)DDMMYY(['"]?[[:space:]]*\]|)
(\$GLOBALS\[[[:space:]]*['"]?|\$)HHMM(['"]?[[:space:]]*\]|)
--replace
$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["sitename"]
$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["ddmmyy"]
$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["hhmm"]
--search
(\$GLOBALS\[[[:space:]]*['"]?|\$)contentTable(['"]?[[:space:]]*\]|)
--action
substitute with this, if correct (in transferfunc.php class there's an internal var with this name...)
$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["contentTable"]

Substituting database config vars with constants:
$typo_db, $typo_db_username, $typo_db_password, $typo_db_host, $typo_db_extTableDef_script
--search (but not t3lib/config_default.php
(\$GLOBALS\[[[:space:]]*['"]?|\$)typo_(db_username|db_password|db_host|db_extTableDef_script)(['"]?[[:space:]]*\]|)
--replace
TYPO3_\2\3

removed ["BE"]["clear_db_info"] option in $TYPO3_CONF_VARS

--search
(\$GLOBALS\[[[:space:]]*['"]?|\$)typo_db(['"]?[[:space:]]*\]|)
--action
removed all "global $typo_db" lines manually

--search
(\$GLOBALS\[[[:space:]]*['"]?|\$)typo_db(['"]?[[:space:]]*\]|)
--replace
TYPO3_db

Check:
Finds all mysql() function calls with a variable in:
--search
mysql[[:space:]]*\([[:space:]]*\$
mysql[[:space:]]*\([[:space:]]*\$G   (finds global-refs)





Moving stuff into the new class, tslib_fe:

FUNCTIONS moved into object $TSFE
clear_preview|tidyHTML|getPageAndRootline|set_no_cache|set_cache_timeout_default|is_included
--search
(for the function names)
--action
replace

(Safety copy: 6c)



GLOBAL Vars that moved into the global object $TSFE
--search, case sensitive, ONLY in tslib/
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(parsetime_start|exec_time|sim_exec_time|browser|register|all|be_user|BE_USER_LOGIN|TYPO3_CONF_VARS|id|rootLine|page|sys_page|no_cache|fe_user|loginUser|gr_list|type|BE_USER_LOGIN|be_user|IMAGES_ON_PAGE|TEMP_IMAGES_ON_PAGE|additionalHeaderData|JSCode|JSImgCode|typo3_DIV_SECTION|tmpl|show_hidden_page|FE_PREVIEW|cache_timeout_default|content|config|cacheContent_flag|sPre|pSetup|newHash|jumpurl|GET_URL_ID_TOKEN|no_cache_beforePageGen)['"]?[[:space:]]*\]
--replace
$GLOBALS["TSFE"]->\1

--search: (non-regex, kun tslib)
$GLOBALS["TSFE"]->TYPO3_CONF_VARS
--replace:
$GLOBALS["TYPO3_CONF_VARS"]

--search: Same vars as before, ONLY in tslib_fe
\$(TYPO3_CONF_VARS|id|parsetime_start|exec_time|sim_exec_time|browser|register|all|be_user|BE_USER_LOGIN|rootLine|page|sys_page|no_cache|fe_user|loginUser|gr_list|type|BE_USER_LOGIN|be_user|IMAGES_ON_PAGE|TEMP_IMAGES_ON_PAGE|additionalHeaderData|JSCode|JSImgCode|typo3_DIV_SECTION|tmpl|show_hidden_page|FE_PREVIEW|cache_timeout_default|content|config|cacheContent_flag|sPre|pSetup|newHash|jumpurl|GET_URL_ID_TOKEN|no_cache_beforePageGen)([^A-Za-z0-9_])
--replace:
$this->\1\2

--search: ONLY in tslib_fe
$GLOBALS["TSFE"]->
--replace:
$this->

in t3lib for the same global var names:   This is the list of names that should be substituted: tmpl|gr_list|GET_URL_ID_TOKEN|config|id|all|sys_page|fe_user|type
--search: ONLY t3lib
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(tmpl|gr_list|GET_URL_ID_TOKEN|config|id|all|sys_page|fe_user|type)['"]?[[:space:]]*\]
--result:
$GLOBALS["TSFE"]->\1

Reverting to GLOBALS
--search:
(\$GLOBALS\["TSFE"\]|\$this)->(exec_time|TEMP_IMAGES_ON_PAGE|sim_exec_time|be_user|IMAGES_ON_PAGE)([^A-Za-z0-9_])
--replace
$GLOBALS["\2"]\3

Setting parameter, id, type for class constructer

setting GPVar(): $recs,$mid,$rid,$sword

$HTTP_POST_VARS -> $GLOBALS["HTTP_POST_VARS"]

Special env vars:
--search
(\$GLOBALS\["|\$)(REDIRECT_URL|REQUEST_URI|HTTP_HOST|PATH_INFO|HTTP_REFERER|REMOTE_ADDR|REMOTE_HOST|HTTP_USER_AGENT)("\]|)
--replace
$GLOBALS["\2"]

timetracking: moved t3lib_timetrack to tslib_timetrack
--search, case sensititive
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(tt)['"]?[[:space:]]*\]
--replace
$GLOBALS["TT"]
--search, non-regex, case sensititive, in index_ts.php
$tt
--replace
$TT

--search(regex)
(\$GLOBALS\[["']?|\$)BE_func(["']?\]|)->
--replace
t3lib_BEfunc::

Removed "$BE_func = new ..." in typo3/init.php and tslib/index_ts.php




In pagegen.php:

Global vars into tslib_fe:
additionalHeaderData|JSCode|JSImgCode|typo3_DIV_SECTION|debug|intTarget|extTarget|absRefPrefix|compensateFieldWidth|lockFilePath|ATagParams|config|SWORD_REGEX|sword_list|linkVars

--search, case sensitive, ONLY in tslib/ + t3lib
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(additionalHeaderData|JSCode|JSImgCode|typo3_DIV_SECTION|debug|intTarget|extTarget|absRefPrefix|compensateFieldWidth|lockFilePath|ATagParams|config|SWORD_REGEX|sword_list|linkVars)['"]?[[:space:]]*\]
--replace
$GLOBALS["TSFE"]->\1


--search, ONLY in index_ts.php and pagegen.php
\$(additionalHeaderData|JSCode|JSImgCode|typo3_DIV_SECTION|debug|intTarget|extTarget|absRefPrefix|compensateFieldWidth|lockFilePath|ATagParams|config|SWORD_REGEX|sword_list|linkVars|pSetup|tmpl|content)([^A-Za-z0-9_])
--replace:
$GLOBALS["TSFE"]->\1\2

--search
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?sim_exec_time['"]?[[:space:]]*\]
--replace
$GLOBALS["SIM_EXEC_TIME"]

--search
\$sim_exec_time([^A-Za-z0-9_])
--replace
$SIM_EXEC_TIME\1

--search
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?exec_time['"]?[[:space:]]*\]
--replace
$GLOBALS["EXEC_TIME"]

--search
\$exec_time([^A-Za-z0-9_])
--replace
$EXEC_TIME\1


--search, case sensitive, ONLY in tslib/ + t3lib
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(cobj_depth_counter|recordRegister|currentRecord|TSPath)['"]?[[:space:]]*\]
--replace
$GLOBALS["TSFE"]->\1

--search, case sensitive, ONLY in scripts/payment*, products*
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(update_code|tracking|swords|begin_at|backPID|products_finalize|products_payment|products_info|products_cmd|reason|transact|authkey|orderid)['"]?[[:space:]]*\]
--replace
GPvar("\1")


--search
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(IMAGES_ON_PAGE|LAST_IMAGE_INFO|currentRecordTotal|currentRecordNumber)['"]?[[:space:]]*\]
--replace
$GLOBALS["TSFE"]->\1

--search, case sensitive, ONLY in tslib_content.php
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(stype|scols|sword|scount|spointer)['"]?[[:space:]]*\]
--replace
GPvar("\1")

--search
\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?(ACCESSKEY)['"]?[[:space:]]*\]
--replace
$GLOBALS["TSFE"]->\1


--search
(\$GLOBALS[[:space:]]*\[[[:space:]]*['"]?|\$)(pointer|source|ftu|table|file|target|number|missing|ONLY|depth|edit|return_id|id|lastEdited|template|sObj|importFile|sys_dmail_uid|createMailFrom|edit_content|CMD|pages_uid|tt_address_uid|uid|redirect|pages_uid|fixLostRecords_table|fixLostRecords_uid|based_on_uid|dataRec|samedoc|document|closeDocuments|edit_content|field|value|formRef|dirTree|pageTree|sendLogoutSignal|expData|currentMenuFane|logid|cacheCmd|action|redirect|pad|clipboard|mode|JScommand|info|cmd|userid|u|p)(['"]?[[:space:]]*\]|)
--action:


--search
<\?([^p])
--replace
<?php\1

--search
<\?php([^[:space:]])
--replace
<?php \1



--search . finds occurencies where we pass vars on url...
&[[:alpha:]_0-9]*=
\?[[:alpha:]_0-9]*=





************************************************************
** Testing the new frontend (8)
************************************************************ 

Removing call_time_pass_by_reference:

--search:
[^&]&[[:space:]]*\$

These functions are affected:

ext_process_hierarchyInfo
copyGifOntoGif
makeEffect
applyOffset
makeText
reduceColors
SpacedImageTTFText
makeShadow
inputLevels
adjust
inputLevels
outputLevels
autoLevels
calcOffset
makeShadow
makeEmboss
makeText
maskImageOntoImage
copyImageOntoImage
makeBox
makeOutline
scale
crop
applyOffset

substituteMarkerInObject
clearTSProperties

t3lib_stdgraphic.php:
-- Functions without passing references:
applyOffset
-- Functions with passing references to im
autoLevels|inputLevels|outputLevels|maskImageOntoImage|copyGifOntoGif|copyImageOntoImage|reduceColors|SpacedImageTTFText|makeOutline|makeBox|makeText|makeEmboss|makeShadow|adjust|makeEffect|crop|scale


ext_process_hierarchyInfo
fsockopen


--search (environment variable that should go into getenv())
(\$GLOBALS\[[[:space:]]*["']?|\$)(QUERY_STRING|HTTP_ACCEPT|HTTP_ACCEPT_ENCODING|HTTP_ACCEPT_LANGUAGE|HTTP_CONNECTION|HTTP_COOKIE|HTTP_HOST|HTTP_USER_AGENT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|SERVER_ADDR|SERVER_ADMIN|SERVER_NAME|SERVER_PORT|SERVER_SIGNATURE|SERVER_SOFTWARE|GATEWAY_INTERFACE|SERVER_PROTOCOL|REQUEST_METHOD|SCRIPT_NAME|PATH_TRANSLATED)(["']?[[:space:]]*\]|)([^A-Za-z0-9_])
--replace
getenv("\2")\4

--search: Check all instances of these vars: (excl POST/GET/COOKIE/SERVER)
(\$GLOBALS\[[[:space:]]*["']?|\$)(QUERY_STRING|HTTP_ACCEPT|HTTP_ACCEPT_ENCODING|HTTP_ACCEPT_LANGUAGE|HTTP_CONNECTION|HTTP_COOKIE|HTTP_HOST|HTTP_USER_AGENT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|SERVER_ADDR|SERVER_ADMIN|SERVER_NAME|SERVER_PORT|SERVER_SIGNATURE|SERVER_SOFTWARE|GATEWAY_INTERFACE|SERVER_PROTOCOL|REQUEST_METHOD|SCRIPT_NAME|PATH_TRANSLATED|INIT_VERSION|previous|TERM|HOSTTYPE|CONSOLE|HOME|PREVLEVEL|RUNLEVEL|SHELL|runlevel|AUTOBOOT|BOOT_IMAGE|OSTYPE|SHLVL|QUERY_STRING|DOCUMENT_ROOT|HTTP_ACCEPT|HTTP_ACCEPT_ENCODING|HTTP_ACCEPT_LANGUAGE|HTTP_CONNECTION|HTTP_COOKIE|HTTP_HOST|HTTP_USER_AGENT|REDIRECT_QUERY_STRING|REDIRECT_STATUS|REDIRECT_URL|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|SCRIPT_FILENAME|SERVER_ADDR|SERVER_ADMIN|SERVER_NAME|SERVER_PORT|SERVER_SIGNATURE|SERVER_SOFTWARE|GATEWAY_INTERFACE|SERVER_PROTOCOL|REQUEST_METHOD|REQUEST_URI|SCRIPT_NAME|PATH_TRANSLATED|PHP_SELF|HTTP_ENV_VARS|HTTP_REFERER|PATH_INFO)(["']?[[:space:]]*\]|)([^A-Za-z0-9_])

--search: Find all arrays without "" (4000+...)
\[[A-Za-z0-9_]+\]		-- all
\$[[:alnum:]]*\[[A-Za-z_]+\]	--only one-dim arrays

? How about these on windows?
REQUEST_URI
PATH_INFO
DOCUMENT_ROOT
PHP_SELF



************************************************************
** Replacing global vars; cObj, tc, be_user (9)
************************************************************ 
cObj goes into TSFE:
--search
(\$GLOBALS\[[[:space:]]*["']?)cObj(["']?[[:space:]]*\])([^A-Za-z0-9_])
--replace
$GLOBALS["TSFE"]->cObj\3


$be_user converted to $BE_USER;
--search
(\$GLOBALS\[[[:space:]]*["']?)be_user(["']?[[:space:]]*\])([^A-Za-z0-9_])
--replace
$GLOBALS["BE_USER"]\3

--search
\$be_user([^A-Za-z0-9_])
--replace
$BE_USER\1

(asved 8a)

$tc converted to $TCA

tables.php updated.
!!! (update your extTables.php file!!!)

--search
(\$GLOBALS\[[[:space:]]*["']?)tc(["']?[[:space:]]*\])([^A-Za-z0-9_])
--replace
$GLOBALS["TCA"]\3

--search
(global[^;])\$tc([^A-Za-z0-9_])
--replace
\1$TCA\2


--search, case insensitive
\$tc([^A-Za-z0-9_])
--replace
$TCA\1




************************************************************
** (10)
************************************************************ 


in tslib_fe, these vars were renamed:

BE_USER_LOGIN
FE_PREVIEW
GET_URL_ID_TOKEN
show_hidden_page
cache_timeout_default
cacheContent_flag
no_cache_beforePageGen
typo3_DIV_SECTION
SWORD_REGEX
sword_list
cobj_depth_counter
ACCESSKEY
IMAGES_ON_PAGE
LAST_IMAGE_INFO
parsetime_start

--search, non-regex case-insensitive, check first
->BE_USER_LOGIN  	->beUserLogin
->FE_PREVIEW		->fePreview
->GET_URL_ID_TOKEN	->getMethodUrlIdToken
->show_hidden_page	->showHiddenPage
->cache_timeout_default	->cacheTimeOutDefault
->cacheContent_flag	->cacheContentFlag
->no_cache_beforePageGen	->noCacheBeforePageGen
->typo3_DIV_SECTION	->divSection
->SWORD_REGEX		->sWordRegEx
->sword_list		->sWordList
->cobj_depth_counter	->cObjectDepthCounter
->ACCESSKEY		->accessKey
->IMAGES_ON_PAGE	->imagesOnPage
->LAST_IMAGE_INFO	->lastImageInfo
->parsetime_start	->parseTimeStart


--search, check:
(BE_USER_LOGIN|FE_PREVIEW|GET_URL_ID_TOKEN|show_hidden_page|cache_timeout_default|cacheContent_flag|no_cache_beforePageGen|typo3_DIV_SECTION|SWORD_REGEX|sword_list|cobj_depth_counter|ACCESSKEY|IMAGES_ON_PAGE|LAST_IMAGE_INFO|parsetime_start)


(saved 9a)

Changed 

--search
([^[:alnum:]])GPvar([[:space:]]*\()
--replace
\1t3lib_div::GPvar\2








--search
\$row\[['"]?[0-9]*['"]?\]
count[[:space:]]*\([[:space:]]*\*[[:space:]]*\)
--action
Some of these instances was converted to mysql_fetch_assoc which resulted in the wrong number of records return. If mysql_fetch_assoc is used, it should probably be converted to mysql_fetch_row() instead.




-------------------------------
BACKEND (init.php):

Globals removed (TYPO3_CONF_VARS used instead...):
$fileadminDir 
$lockRootPath 
$userHomePath 
$groupHomePath

global var $PROCEED_IF_NO_USER -> constant TYPO3_PROCEED_IF_NO_USER

global var $f_ext removed and substituted with TYPO3_CONF_VARS[BE][fileExtensions]

Globals converted to uppercase:
--search
(\$GLOBALS\[[[:space:]]*['"]?|\$)(webmounts|filemounts|fileicons|browser|parsetime_start|browser)(['"]?[[:space:]]*\]|)
--action
 manually to uppercase
--check:
(\$GLOBALS\[[[:space:]]*['"]?|\$)(webmounts|filemounts|fileicons|browser|parsetime_start|browser|f_ext)(['"]?[[:space:]]*\]|)


--search
([^A-Za-z0-9_>:])(slashJS)[[:space:]]*\(
--Replace with:
\1t3lib_div::\2(



Changing global var names:
pagesTypes -> PAGES_TYPES
iconTypes -> ICON_TYPES
langGeneralLabels -> LANG_GENERAL_LABELS
modules -> TBE_MODULES

typo3/template.php:
$iGraphics -> $TBE_iGraphics
$template -> $TBE_TEMPLATE
$lang -> $LANG


Specific for modules:
localLang -> $LOCAL_LANG
conf -> MCONF
lang -> MLANG

backPath -> BACK_PATH

------------------------------------------------
List of url-parameters used in Typo3:
pointer
source
ftu
table
file
target
number
missing
ONLY
depth
edit
return_id
id
lastEdited
template
sObj
importFile
sys_dmail_uid
createMailFrom
edit_content
CMD
pages_uid
tt_address_uid
uid
redirect
pages_uid
fixLostRecords_table
fixLostRecords_uid
based_on_uid
dataRec
samedoc
document
closeDocuments
edit_content
field
value
formRef
dirTree
pageTree
sendLogoutSignal
expData
currentMenuFane
logid
cacheCmd
action
redirect
pad
clipboard
mode
JScommand
info
cmd
userid
u
p

(\$GLOBALS\[[[:space:]]*['"]?|\$)(document|closeDocuments|edit_content|field|value|formRef|dirTree|pageTree|sendLogoutSignal|expData|currentMenuFane|logid|cacheCmd|action|redirect|pad|clipboard|mode|JScommand|info|cmd|userid)(['"]?[[:space:]]*\]|)



____________END.


t3lib_div::checkbrowser was substituted with t3lib_div::clientInfo which returns information about the client browser in an array. Please update your scripts if you use the old function!