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_include ($tclLibPath);
if ($tclSourceStri ng && !preg_match('/;[\n\r\s\t]*$/i',
$tclSourceStrin g)) $tclSourceStrin g .= ';'; // ADD ";" TO ADD ONE MORE
TCL COMMAND TO THE SINGLE LINE
$tclSourceStrin g = str_replace(';' , ";\n", $tclSourceStrin g);
$msg = exec("$tclKomma nd << ':eof'\n$tclSou rceString puts [PROPER_CASE
\{$text}]\n:eof $tclRedirect");
if (preg_match('/^[eE](rror:)/i', $msg) ||
strcmp(strtolow er(trim($msg)), strtolower(trim ($text))) != 0) {
trigger_error(" Error involving TCL proc \"PROPER_CAS E\" on \"$text\":
" . nl2br($msg), E_USER_WARNING) ; // GENERATE WARNING ONLY
return $text;
} else {
return $msg;
}
}
}
This is a PHP function that utilizes a prior-written TCL proc I wrote
that converts a name to proper case.. however, upon running it, you get
thousands of these lines:
":eof" No such file or directory
What in the world am I doing wrong?
Thanx
Phil
/**
* 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_include ($tclLibPath);
if ($tclSourceStri ng && !preg_match('/;[\n\r\s\t]*$/i',
$tclSourceStrin g)) $tclSourceStrin g .= ';'; // ADD ";" TO ADD ONE MORE
TCL COMMAND TO THE SINGLE LINE
$tclSourceStrin g = str_replace(';' , ";\n", $tclSourceStrin g);
$msg = exec("$tclKomma nd << ':eof'\n$tclSou rceString puts [PROPER_CASE
\{$text}]\n:eof $tclRedirect");
if (preg_match('/^[eE](rror:)/i', $msg) ||
strcmp(strtolow er(trim($msg)), strtolower(trim ($text))) != 0) {
trigger_error(" Error involving TCL proc \"PROPER_CAS E\" on \"$text\":
" . nl2br($msg), E_USER_WARNING) ; // GENERATE WARNING ONLY
return $text;
} else {
return $msg;
}
}
}
This is a PHP function that utilizes a prior-written TCL proc I wrote
that converts a name to proper case.. however, upon running it, you get
thousands of these lines:
":eof" No such file or directory
What in the world am I doing wrong?
Thanx
Phil
Comment