This topic is locked

Undocumented session variables [5.3]

9/13/2011 5:32:04 PM
PHPRunner General questions
E
electromotive author

[this post was getting a bit long winded so I chopped it back]
The help and several forum posts reference a session variable $_SESSION[$strTableName.'_advsearch']

But this session variable is not documented in the help.
Is there a master list of session variables available, defines scope, when and how these session variables should be used, how they fit into the event lifecycle? When you click ShowAll or do a quick search what happens to these?
Can I overwrite this variable, for instance? Programmatically create a search filter?



global $strTableName;

if (isset($_SESSION[$strTableName.'_advsearch'])) {

$searchClauseObj = unserialize($_SESSION[$strTableName.'_advsearch']);

}
$fieldSearchData = $searchClauseObj->getSearchCtrlParams("FieldName");

$fieldSearchData = $searchClauseObj->_where[$strTableName."_srchFields"];
for($i=0; $i<count($fieldSearchData); $i++){

$fName = $fieldSearchData[$i]['fName'];

$val1 = $fieldSearchData[$i]['value1'];

$val2 = $fieldSearchData[$i]['value2'];

$srchCat = $fieldSearchData[$i]['opt'];

$srchNot = $fieldSearchData[$i]['not'];

echo "Search was completed.".", ";

echo "Search Field: ".$fName.", ";

echo "Search Option: ".$val1."
";

}



Then there are some variables are mentioned in help such as $_SESSION[$strTableName.'_asearchfor'] but no further official information appears to be available. When I test the $_SESSION[$strTableName.'_search'] (mentioned in help) it tends to always to be 0. When is it a 1 or 2? Also what is an 'integrated' search?

Sergey Kornilov admin 9/14/2011

Sorry, don't have a positive answer for you.
This sample code in the manual is provided as is. These functions were not planned as a public API and there is no guarantee they will work being placed to another event or will survive the upgrade. Use it on your own risk.

P
procheck 9/16/2011

If this does not work for version 6, will there will be another method to determine the search keys? I rely heavily on this in my app.
Al

E
electromotive author 9/20/2011



Sorry, don't have a positive answer for you.
This sample code in the manual is provided as is. These functions were not planned as a public API and there is no guarantee they will work being placed to another event or will survive the upgrade. Use it on your own risk.



I understand you are saying that using the $_SESSION search variables is unreliable and not recommended. Can you update the respective documentation on the next release?