I wrote this PHP function in the hopes that it would properly use a TCL
proc I wrote about 4 years ago:
if (!function_exis ts('proper_case ')) {
/**
* Ths function will convert a string into a proper case format using
the customized TCL proc "PROPER_CAS E" from the included TCL string
tools libraries
*
* @access public
* @param mixed $text
* @param mixed $tclLibPath Path to TCL Library files
* @param DBActionPerform er $dbAP You must generate a descendant of
MethodGenerator ForActionPerfor mer to retrieve customized command-line
formatting to call TCL shell
* @return mixed $text properly formatted in Proper Case Form
* @see DBActionPerform er
* @uses tcl_string_tool s::PROPER_CASE
*/
function &proper_case($t ext, $tclLibPath, $dbAP) {
if (!is_object($db AP)) $dbAP =& new DBActionPerform er(); // NO NEED TO
CONNECT NOR DISCONNECT
list('tclKomman d', 'tclRedirect') =
@array_values($ dbAP->getKommandOSAr ray('tcl'));
$tclSourceStrin g = @tcl_lib_includ e($tclLibPath);
if (!preg_match('/;[\n\r\s\t]*$/i', $tclSourceStrin g))
$tclSourceStrin g .= ';'; // ADD ";" TO ADD ONE MORE TCL COMMAND TO THE
SINGLE LINE
$msg = exec("$tclKomma nd \"$tclSourceStr ing puts [PROPER_CASE
{$text}]\" $tclRedirect");
if (preg_match('/^[eE](rror:)/i', $msg)) {
trigger_error(" Error involving TCL proc \"PROPER_CAS E\" on \"$text\":
" . nl2br($msg), E_USER_WARNING) ; // GENERATE WARNING ONLY
return $text;
} else {
return $msg;
}
}
}
-----------------------------
Problem is very simple: <b>tclsh</b>. I have no idea how to put all of
the TCL commands onto the same line as "tclsh" command. ELSE I have no
idea how to work with the generated <b>tclsh</b> environment from
Apache/PHP.
In short, I'm stuck. I have to get this up and running and rather than
rewriting an entire series of TCL procs into PHP, I need a faster and
more practical solution to this one!
thanx
Phil
proc I wrote about 4 years ago:
if (!function_exis ts('proper_case ')) {
/**
* Ths function will convert a string into a proper case format using
the customized TCL proc "PROPER_CAS E" from the included TCL string
tools libraries
*
* @access public
* @param mixed $text
* @param mixed $tclLibPath Path to TCL Library files
* @param DBActionPerform er $dbAP You must generate a descendant of
MethodGenerator ForActionPerfor mer to retrieve customized command-line
formatting to call TCL shell
* @return mixed $text properly formatted in Proper Case Form
* @see DBActionPerform er
* @uses tcl_string_tool s::PROPER_CASE
*/
function &proper_case($t ext, $tclLibPath, $dbAP) {
if (!is_object($db AP)) $dbAP =& new DBActionPerform er(); // NO NEED TO
CONNECT NOR DISCONNECT
list('tclKomman d', 'tclRedirect') =
@array_values($ dbAP->getKommandOSAr ray('tcl'));
$tclSourceStrin g = @tcl_lib_includ e($tclLibPath);
if (!preg_match('/;[\n\r\s\t]*$/i', $tclSourceStrin g))
$tclSourceStrin g .= ';'; // ADD ";" TO ADD ONE MORE TCL COMMAND TO THE
SINGLE LINE
$msg = exec("$tclKomma nd \"$tclSourceStr ing puts [PROPER_CASE
{$text}]\" $tclRedirect");
if (preg_match('/^[eE](rror:)/i', $msg)) {
trigger_error(" Error involving TCL proc \"PROPER_CAS E\" on \"$text\":
" . nl2br($msg), E_USER_WARNING) ; // GENERATE WARNING ONLY
return $text;
} else {
return $msg;
}
}
}
-----------------------------
Problem is very simple: <b>tclsh</b>. I have no idea how to put all of
the TCL commands onto the same line as "tclsh" command. ELSE I have no
idea how to work with the generated <b>tclsh</b> environment from
Apache/PHP.
In short, I'm stuck. I have to get this up and running and rather than
rewriting an entire series of TCL procs into PHP, I need a faster and
more practical solution to this one!
thanx
Phil
Comment